Note | This command is not available in the Core and Vulcan dialects |
Note | This command is defined in a header file and will be preprocessed by the X# preprocessor to a function call. If you disable the standard header (-nostddefs) files then this command will not be available. If you tell the compiler to use a different standard header file (-stddef ) then this command may also be not available |
Copy public and private memory variables visible within the current routine to a disk file.
SAVE TO <xcTargetFile> [ALL [LIKE | EXCEPT <Skeleton>]
<xcTargetFile> | The name of the file, including an optional drive, directory, and extension. See SetDefault() and SetPath() for file searching and creation rules. The default extension is .MEM. |
If <xcTargetFile> does not exist, it is created. If it exists, this command attempts to open the file in exclusive mode and, if successful, the file is overwritten without warning or error. If access is denied because, for example, another process is using the file, NetErr() is set to TRUE. |
ALL | Saves all private and public variables. |
LIKE | EXCEPT <Skeleton> |
Specifies a set of visible public and private variables to save (LIKE) or exclude (EXCEPT). <Skeleton> can include literal characters as well as the standard wildcard characters, * and ?. If no variables match the <Skeleton>, nothing happens. |
The scope of the variable is not saved but is instead established when the variable is restored. Arrays and declared variables cannot be saved or restored.
This example saves all visible private and public variables to TEMP.MEM:
PRIVATE cOne := "1"
SAVE ALL TO temp
This example saves all visible private and public variables with names beginning with c to MYVARS.MEM:
SAVE ALL LIKE c* TO myvars
This example saves all visible private and public variables with names that do not begin with c to MYVARS2.MEM:
SAVE ALL EXCEPT c* TO myvars2
XSharp.RT.DLL
PRIVATE, PUBLIC, RESTORE, SetDefault(), SetPath()