##### Shinobi Library - Memory Card Function

# buGetLastError

Returns the last error that was generated

### FORMAT

`

  Sint32 buGetLastError( drive )
  Sint32 drive

`

### PARAMETER

  `drive` | Extension socket number

### RETURN

  Error code

### DESCRIPTION

  Finds the last error generated while accessing the extension socket.

  The following values can be designated for the argument `drive` that specifies extension sockets.

  BUD_DRIVE_A1 | Extension socket 1 on board A
  BUD_DRIVE_A2 | Extension socket 2 on board A
  BUD_DRIVE_B1 | Extension socket 1 on board B
  BUD_DRIVE_B2 | Extension socket 2 on board B
  BUD_DRIVE_C1 | Extension socket 1 on board C
  BUD_DRIVE_C2 | Extension socket 2 on board C
  BUD_DRIVE_D1 | Extension socket 1 on board D
  BUD_DRIVE_D2 | Extension socket 2 on board D

  The meaning of the returned error codes are as follows:

  BUD_ERR_OK | No error
  BUD_ERR_BUSY | Executing command
  BUD_ERR_INVALID_PARAM | Invalid function parameter
  BUD_ERR_ILLEGAL_DISK | Last block failed
  BUD_ERR_UNKNOWN_DISK | Memory card is unknown
  BUD_ERR_NO_DISK | Memory card is not found
  BUD_ERR_UNFORMAT | Disk is not formatted
  BUD_ERR_DISK_FULL | Memory card is full
  BUD_ERR_FILE_NOT_FOUND | File not found
  BUD_ERR_FILE_EXIST | File already exists
  BUD_ERR_CANNOT_OPEN | File cannot be opened
  BUD_ERR_CANNOT_CREATE | Cannot create execute file
  BUD_ERR_EXECFILE_EXIST | Execute file already exists
  BUD_ERR_CANNOT_DELETE | Cannot delete file
  BUD_ERR_ACCESS_DENIED | File access denied
  BUD_ERR_VERIFY | Verify error
  BUD_ERR_WRITE_ERROR | Write error
  BUD_ERR_FILE_BROKEN | File is corrupted
  BUD_ERR_BUPFILE_CRC | Backup file CRC error
  BUD_ERR_BUPFILE_ILLEGAL | Backup file illegal
  BUD_ERR_GENERIC | Generic error

### EXAMPLE

      if (buGetLastError(BUD_DRIVE_A1) == BUD_ERR_OK) {
      	/* Save successful */
      } else {
      	/* Error was generated */
      }

buGetLastError

COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999