xHarbour Reference Documentation > Command Reference xHarbour Developers Network  

SAVE

Saves dynamic memory variables to a memory file.

Syntax

SAVE TO <memFilename> [ALL [LIKE | EXCEPT <mask>]]

Arguments

FROM <memFilename>
This is the name of the memory file to create. It can include path and file extension. When no path is given, the file is created in the current directory. The default file extension is MEM. <memFilename> can be specified as a literal file name or as a character expression enclosed in parentheses.
ALL [LIKE|EXCEPT <mask>]
Mask to define the variable names of visible dynamic memory variables to include or exclude from saving. <mask> can be specified using the wildcard characters (*) and (?).

Description

The SAVE command writes dynamic memory variables currently visible to a memory file. The default extension for memory files is MEM. Only variables of data type Character, Date, Logic and Numeric can be written to a MEM file. Other data types are not supported. The vaiables can later be loaded into memory using the RESTORE command-

Dynamic memory variables are PRIVATE and PUBLIC variables. Their symbolic names exist at runtime of an application. Thus, the symbolic names are written into a memory file along with their values.

The option ALL stores all currently visible dynamic variables. When combined either with LIKE (include) or with EXCEPT (exclude), followed by a skeleton specifying a group of variable names using wild card characters, the intended group of variables is selectively stored.

GLOBAL, LOCAL and STATIC memory variables cannot be written to a memory file with the SAVE command.

Info

See also:GLOBAL, HB_Serialize(), LOCAL, PRIVATE, PUBLIC, RESTORE, STATIC
Category: Memory commands
Source:vm\memvars.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// Refer to the RETSORE example

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe