Please enable JavaScript to view this site.

Function to create a new global variable.

Creates the information in memory and, if required, also in retentive memory.

If requested, creates the definition file. Can also create an interface to the global variable.

Syntax

i32 gv_create (string var, string dataType, i32 len, string wrtPsw, i32 flag, i32 gvID, buff)

var

Variable name.

Can contain letters, numbers, spaces, and special characters. Not case sensitive

dataType

Description of data type.

Can contain letters, numbers, spaces and special characters. If omitted (""), the data type will be inserted automatically

len

Size in bytes of the global variable

wrtPsw

Password for write access. If omitted (""), the password is not used

flag

HEX value

Description

0x0001

Persistent variable

0x0002

(Only if defined as a persistent variable)

Overwrites the value of an unlinked persistent variable with the same name and size as the new one

0x0004

(Only if defined as a non-persistent variable)

Disables the creation of the configuration file

0x0008

(Only if defined as a non-persistent variable)

Disables data in the configuration file

0x0010

(Only if a password is used)

Enables write access only to the first linked interface with correct password

gvID

Local variable in which the function inserts the interface-related ID to the global variable. In case of an error, the function inserts 0

buff

Local buffer used as a cache connected to the ID (if any).

It is used to update the global variable information during read and write operations. When the function is called, its value indicates the initialization value of the global variable. It must necessarily be the same size as the global variable

Result

Returns:

Value

Meaning

0

Operation performed successfully

-1

Name or size NULL

-2

Global variable handler not enabled

-3

Existing variable (or same key)

-4

Persistent variable already exists (or same key) or persistent memory full or hash table full

-5

Problem during creation of definition file

-6

Cache size is smaller than global variable size.

Alarm 9900 is generated

Validity

Task

Note


 

  

Keyboard Navigation

F7 for caret browsing
Hold ALT and press letter

This Info: ALT+q
Page Header: ALT+h
Topic Header: ALT+t
Topic Body: ALT+b
Contents: ALT+c
Search: ALT+s
Exit Menu/Up: ESC