| FolderOp | Function (ROM Call 0x69)

vat.h

short FolderOp (SYM_STR SymName, short Flags);

Locks or unlocks a folder table.

FolderOp locks or unlocks a folder table which name is determined by SymName. Returns TRUE if the operation was successful, else returns FALSE. Parameter Flags may have following values (these constants are defined in enum FolderOpFlags):

FOP_UNLOCK | Unlocks a folder table
FOP_LOCK | Locks a folder table
FOP_ALL_FOLDERS | Locks/unlocks all folder tables (SymName is ignored); this value should be ORed with one of FOP_UNLOCK or FOP_LOCK

By locking the folder table, you may be sure that a dereferenced pointer to the table will remain valid even after a lot of heap memory allocations (i.e. a garbage collection will not move the table through memory).
Note: To lock the "home" folder (this is a pseudo-folder which contains all other folders in itself, i.e. this is the table of folders), you need to know that its name consists only of the character with code 0x7F (diamond). So, you can use

    FolderOp (SYMSTR ("\x7F"), FOP_LOCK);

to do this.

Uses: SymCmp, TokToStrN, HeapLock, HeapUnlock, strcmp, _mu16u16
Used by: VarOpen, EV_defaultHandler, HomeExecute, VarCreateFolderPopup