11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

DescriptionThe SET command assigns a value to a variable. It can set a single variable, or set multiplevariables using any combination of two syntactic forms. It can assign values to variables byspecifying a comma-separated list of variable=value pairs. For example:SET a=1,b=2,c=3It can assign the same value to multiple variables by specifying a comma-separated list ofvariables enclosed in parentheses. For example:SET (a,b,c)=1You can combine these two syntactic forms in any combination. For example:SET (a,b)=1,c=2,(d,e,f)=3The maximum number of assignments you can perform with a single invocation of SET is128.If a specified variable does not exist, SET creates it and assigns the value. If a specifiedvariable exists, SET replaces the previous value with the specified value.A value can be a literal or an expression that evaluates to a value.ArgumentspcAn optional postconditional expression. <strong>Caché</strong> executes the command if the postconditionalexpression is true (evaluates to a non-zero numeric value). <strong>Caché</strong> does not execute the commandif the postconditional expression is false (evaluates to zero). For further details, referto Command Postconditional Expressions in Using <strong>Caché</strong> <strong>ObjectScript</strong>.variableSETThe variable to receive the value resulting from the evaluation of value. It can be a localvariable, a process-private global, a global variable, or a special variable. A local variable,process-private global, or global variable can be either subscripted or unsubscripted. A globalvariable can be specified with extended global reference (see Global Structure in Using <strong>Caché</strong>Multi-Dimensional Storage).Local variables, process-private globals, and special variables are specific to the currentprocess; they are mapped to be accessible from all namespaces. A global variable persistsafter the process that created it terminates. A global is specific to the namespace in which it<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 127

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!