KRASCHE
&
BYRNE
         ELZED  HOME       NEWS       DOCS       DOWNLOADS       LICENSING       SUPPORT       FAQ       ABOUT  US

What's An Elzed?
Features
Licensing
Downloads
Documentation
Elzed News
    ELZED 
 Documentation 
 The Details 

Variables

Elzed is very flexible in its support of variables. Simple variables and arrays of all three data types are supported. You may link Elzed variables to corresponding variables in your code. All Elzed variables are scoped, so you can control access to your data across contexts.

Variable names may be of any length, but must begin with a letter. You may include digit characters in subsequent positions of the variable name. Variable names must be unique within their intended scope. You may have variables with identical names in different scopes, but they can hide each other. Variable "foobar", for example, at local scope will hide any other foobars at global and cosmic scope.

Variables can be created in two ways: by declaration in an expression, or programmatically with calls to Elzed functions.

Variables created in expressions must be declared before thay can be used. Declarations have three parts: the scope modifier, the data type, and the variable name.

scope modifier
optional
cosmic, global, or local
data type
required
number, string, or boolean
variable name
required
first character must be a letter

To declare a global 64-character string variable named "fred", you would use the following expression:

global string fred[ 64 ]

When declaring a string variable, you may set the string size (its maximum length) in this way. If you omit the length part of the declaration, the string will be created with a size of 256 characters.

If "fred" is an array, the declaration might look like this:

global string fred[ 2, 2, 64 ]

Once again, we declared the string length to be 64, but in this case fred is an array of 4 64-character strings.

Simple variables (that is, variables that are not arrays) of all data types may be declared implicitly with an assignment:

fred = "My name is Fred"
joe = 6.28
tom = true

The result of the above expressions are string variables created at local scope, with the indicated values. Implicitly declared string variables have a maximum length of 256 characters. Keep in mind that implicitly declared variables are always created at local scope. Array variables may also be created at local scope, but must be declared explicitly.

Declarations made without a scope modifier create variables and arrays at local scope.

You may use Elzed API calls to create and modify variables and arrays programmatically.

Elzed variables may be associated with data in your code through the process of "linking". Your variable and the linked Elzed variable actually share the same space in memory, so a change to one is automatically a change to the other. Use the lzLink...Var and lzLink...Array function calls to link Elzed variables to your C++ and/or VB variables.

See the "External Variable Test" portion of the sample code for more information on variable linking.



  Copyright  ©  MMXXIV  by  R R Le Cropane   •   All Rights Reserved   •   Terms of Use   •   Privacy Policy