83Plus:Software:usb8x/BASIC Interface/ImportVariable

From WikiTI
Jump to: navigation, search

Synopsis

Name: ImportVariable

Function Number: 8

Minimum usb8x version: 0.10

Imports *.8x* variable from specified directory to RAM or Flash.

Inputs

  • 2: String variable to use (Str1-0)
  • 3: Flags byte
Value Effect
00 Store in RAM and do not overwrite existing variable if necessary
01 Store in RAM and overwrite existing variable if necessary
02 Store in Flash and do not overwrite existing variable if necessary
03 Store in Flash and overwrite existing variable if necessary

Outputs

  • 1: Error code (0 = success)

Notes

Be sure to initialize the mass storage driver with MSDInit before calling this entry point.

You have your choice of Str1-Str0 to use with this function. Pass this number as the second element in Ans. The string is formatted as follows:

"/FOLDER1/FOLDER2/GAME.8XP"

Pass the flag value of your choice as the third element in Ans.

Example

The following code will import ZTETRIS.8XP from the root directory and store it in RAM (without overwriting any duplicates):

OpenLib(USBDRV8X
{7
ExecLib ;initialize mass storage driver
"/ZTETRIS.8XP->Str1
{8,1,0
ExecLib ;import variable

See Also

MSDInit - Initialize the mass storage driver