riregistrylib
This library is the Blitz Basic interface to registry.library, Red When Excited’s database of program settings: “libraries” of named variables that hold strings, data, booleans or integers. That library was only given out as a pre-release and cannot be found any more, and neither can its documentation, so this library is of no practical use; it is part of the BB2 C port for completeness. What a command does beyond calling registry.library is described here; what registry.library itself does with the call is not known.
The library opens registry.library when the program starts;
IsRegistryOpen tells whether that worked. Without it every command
does nothing and returns 0. The commands work on the registry structure
that LockRegistry returned last; before the first LockRegistry, or
if it returned 0, they call nothing and return 0. Locks can be nested
up to 15 deep, and UnlockRegistry returns to the one before. Locks
still held are released when the program ends.
The fixed bugs of the library are listed in Fixes in riregistrylib.
Library number 3.
Commands
ChangeRegistryAccess
Calls registry.library’s function of the same name for the current lock; the command’s own description says it changes the registry to read access.
Statement. Help text: -- Change registry to read access
No arguments.
ChangeRegistryVariable
Changes a variable to new data of the given type and size and returns registry.library’s result.
Statement or function, result .l. Help text: VariableName,Data,Type,ByteSize
Arguments: $, .l, .l, .l
DeleteRegistryLibrary
Deletes a library and returns registry.library’s result.
Statement or function, result .w. Help text: LibraryName
Arguments: $
DeleteRegistryLibraryVariables
Deletes the variables of a library.
Statement. Help text: LibraryName
Arguments: $
DeleteRegistryVariable
Deletes a variable and returns registry.library’s result.
Statement or function, result .w. Help text: VariableName
Arguments: $
ExistsRegistryLibrary
Asks registry.library whether a library of that name exists and returns its answer.
Function, result .l. Help text: LibraryName
Arguments: $
FreeStructureVariables
Releases the data allocated by GetStructureVariables, with the same two arguments.
Statement. Help text: -- release data allocated by GetStructureVariables
Arguments: .l, .l
GetLibraryValue$
Asks registry.library for the value of a library and returns it if it is a string, else “”.
Function, result $. Help text: LibraryName
Arguments: $
GetRegistryBoolVariable
The value of a boolean or integer variable, or 0 for a variable of another type.
Function, result .l. Help text: VariableName
Arguments: $
GetRegistryIntVariable
The value of an integer or boolean variable, or 0 for a variable of another type.
Function, result .l. Help text: VariableName
Arguments: $
GetRegistryStringVariable
The value of a variable if it is a string, else “”.
Function, result $. Help text: VariableName
Arguments: $
GetRegistryVariable
Asks registry.library for a variable and returns its result, the variable’s type - 1 string, 2 data, 3 boolean, 4 integer.
Function, result .w. Help text: VariableName
Arguments: $
GetStructureVariables
Passes a description and a structure to registry.library’s function of the same name and returns its result; FreeStructureVariables releases what it allocated.
Statement or function, result .l. Help text: Description,Structure
Arguments: .l, .l
InsertNewRegistryLibrary
Like NewRegistryLibrary, placing the new library before the library InsertBefore.
Statement or function, result .l. Help text: LibraryName,LibraryValue,InsertBefore[,VariableFilename]
2 forms:
$, $, $$, $, $, $
IsRegistryOpen
Returns a value other than 0 if registry.library could be opened when the program started, else 0.
Function, result .l. Help text: -- returns 0 if registry not opened
No arguments.
LoadLibraryVariables
Loads the variables of a library from a file and returns registry.library’s result.
Statement or function, result .l. Help text: LibraryName,Filename
Arguments: $, $
LoadRegistryLibrary
Loads a library from a file and returns registry.library’s result.
Statement or function, result .l. Help text: LibraryName,FileName
Arguments: $, $
LockRegistry
Locks the registry with an access mode and makes the registry structure it returns the current one, on which the other commands work. Returns that structure, or 0.
Function, result .l. Help text: AccessMode
Arguments: .l
Locks can be nested up to 15 deep. A 16th LockRegistry returns 0
without calling registry.library, and the 15th structure stays the
current one.
NewRegistryLibrary
Creates a library with a value, and optionally a file for its variables, and returns registry.library’s result.
Statement or function, result .l. Help text: LibraryName,LibraryValue[,VariableFilename]
2 forms:
$, $$, $, $
NextParseItem
Moves to the next item of the library started with ParseRegistryLibrary and returns registry.library’s result; ParseItemName$ and ParseItemValue$ read the item.
Statement or function, result .w. No help text.
No arguments.
NumRegistryLibraryVariables
Asks registry.library for the number of variables of a library and returns its result.
Function, result .l. Help text: VariableName
Arguments: $
ParseItemName$
The name of the item reached last with NextParseItem.
Function, result $. Help text: -- return the name associated with the last parse
No arguments.
ParseItemValue$
The value of the item reached last with NextParseItem, if it is a string, else “”.
Function, result $. Help text: -- return the string value associated with the last parse
No arguments.
ParseRegistryLibrary
Starts going through the items of a library and returns registry.library’s result; NextParseItem goes on.
Statement or function, result .l. Help text: LibraryName
Arguments: $
RenameRegistryLibrary
Renames a library and returns registry.library’s result.
Statement or function, result .l. Help text: LibraryName,NewLibraryName
Arguments: $, $
RenameRegistryVariable
Renames a variable and returns registry.library’s result.
Statement or function, result .l. Help text: VariableName,NewVariableName
Arguments: $, $
SaveLibraryVariables
Saves the variables of a library to a file and returns registry.library’s result.
Statement or function, result .l. Help text: LibraryName,Filename
Arguments: $, $
SaveRegistryLibrary
Saves a library to a file and returns registry.library’s result.
Statement or function, result .l. Help text: LibraryName,FileName
Arguments: $, $
SetLibraryValue
Sets the value of a library and returns registry.library’s result.
Statement or function, result .l. Help text: LibraryName,Value
Arguments: $, $
SetRegistryBaseLibrary
Passes a library name to registry.library’s function of the same name and returns its result.
Statement or function, result .l. Help text: LibraryName
Arguments: $
SetRegistryBoolVariable
Sets a boolean variable and returns registry.library’s result.
Statement or function, result .l. Help text: VariableName,True/False
Arguments: $, .l
The size passed to registry.library is 4.
SetRegistryIntVariable
Sets an integer variable and returns registry.library’s result.
Statement or function, result .l. Help text: VariableName,#
Arguments: $, .l
The size passed to registry.library is 4.
SetRegistryVariable
Sets a variable to a string, or to ByteSize bytes of data from Address, and returns registry.library’s result.
Statement or function, result .l. Help text: VariableName,Value$ OR VariableName,Address,ByteSize
2 forms:
$, $$, .l, .l
In the string form, the size passed to registry.library is the length of the string.
SetRegistryVariableIndex
Sets a variable to data of the given type and size at an index and returns registry.library’s result.
Statement or function, result .l. Help text: VariableName,Data,Type,ByteSize,Index
Arguments: $, .l, .l, .l, .l
UnlockRegistry
Releases the current lock; the lock before it becomes the current one again.
Statement. Help text: -- unlock and release the registry
No arguments.
Without a lock, it does nothing.