4D v13.4

SAVE VARIABLES

Home

 
4D v13.4
SAVE VARIABLES

SAVE VARIABLES 


 

SAVE VARIABLES ( document ; variable {; variable2 ; ... ; variableN} )  
Parameter Type   Description
document  String in Document in which to save the variables
variable  Variable in Variables to save

The SAVE VARIABLES command saves one or more variables in the document whose name you pass in document.

The variables do not need to be of the same type, but must be of the String, Text, Real, Integer, Long Integer, Date, Time, Boolean, or Picture type.

If you pass an empty string for document, the standard Save File dialog box appears; the user can then choose the document to create. In this case, the 4D system variable Document is set to the name of the document if one is created.

If the variables are properly saved, the OK variable is set to 1. If not, OK is set to 0.

Note: When you write variables to documents with SAVE VARIABLES, 4D uses an internal data format. You can retrieve the variables only with the LOAD VARIABLES command. Do not use RECEIVE PACKET or RECEIVE VARIABLE to read a document created by SAVE VARIABLES.

WARNING: This command does not support array variables. Use the new BLOB commands instead.

Example  

The following example saves three variables to a document named UserPrefs:

 SAVE VARIABLES("User Prefs";vsName;vlCode;vgIconPicture)

If the variables are saved properly, the OK system variable is set to 1; otherwise it is set to 0.

 
PROPERTIES 

Product: 4D
Theme: Variables
Number: 75

The OK variable is changed by the commandThis command modifies the system Document variable

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: < 4D v6

 
SEE ALSO 

BLOB TO DOCUMENT
BLOB TO VARIABLE
DOCUMENT TO BLOB
LOAD VARIABLES
System Variables
VARIABLE TO BLOB