Clbfile
This keyword declares a character large object (CLOB) variable.
Local Clbfile NAME(LENGTH)Local Clbfile NAME(LENGTH)(DIMENSIONS)Variable Clbfile NAME(LENGTH)(DIMENSIONS)Value Clbfile NAME(LENGTH)(DIMENSIONS)Const Clbfile NAME(LENGTH)(DIMENSIONS)
NAME
is the name of the variable declared.LENGTH
is an integer value between 0 and 20.DIMENSIONS
can be:Several variable declarations can be done on the same line, separated by a comma.
Local declarations create the variables in the current local variable class that is not seen by nested or calling sub-programs. The Call / Subprog and func / Funprog insulate the local variables as well as the calls of method by fmet.
Const, Variable, and Value declarations state the arguments sent by a Call, func, or fmet. With these syntaxes, the dimensions and the index ranges can be omitted wherever the parentheses are present. The dimension and index ranges are defined by the calling program.
# Direct declarationsLocal Clbfile MYTEXT(2), MYCOMMENTS(2), REFERENCES(3) : # Local large character variablesLocal Clbfile MYTEXT_ARRAY(2)(1..10) : # An array of 10 large texts# A sub-program sending a text and returning a resultFunprog SEND_TEXT(TEXT)Variable Clbfile TEXT()(,) : # A 2 dimensions matrix of pictures is sent as references...End SEND_STATUS# A sub-program storing textsSubprog STORE_TEXTS(TEXT)Value Clbfile TEXT()(1..3) : # An array of 3 elements is sent (a copy is done when passing the arguments)...End
The dimension is used to size per default the variable, but if a value exceeding this size is assigned, the execution engine will automatically resize the variable.
The correspondence between the dimension and the default memory size allocated is given by the following table:
Dimension | Memory size | Maximum number of characters stored |
---|---|---|
0 | 1020 | 510 |
1 | 2044 | 1022 |
2 | 4092 | 2046 |
3 | 8188 | 4094 |
N | 1024*2^N-4 | 512*2^N-2 |
There is still a Global declaration variable that exists for variables that have to be seen in the scope of a process execution, but its use is strongly discouraged.
The Clbfile data type will implicitly convert Date and Clbfile to a Char
Local Clbfile MY_CLOB(1) # Declare ClobLocal Char MY_CHAR(30) #Local Date MY_DATEMY_DATE=[31/12/2099]MY_CHAR="AAAA"MY_CLOB = MY_CHAR-MY_DATE # MY_CLOB = "AAAA 20991231"
Global, Local, Variable, Value, Const, Tinyint, Shortint, Date, Integer, Float, Double, Decimal, Char, Blbfile, Uuident, Datetime, Instance.