LET# and STO#

One can define variables to be used in the following records. After the leadin LET# (only valid within current program) or STO# (value will be saved to database) the name of the variable is appended directly (up to 16 characters of an alpha-numerical text, 1st character has to be a letter) and an optional index. For temporary variables a simple numerical positive value may be also used as name. The variables can be used then instead of numbers. This item is followed a separation character and the value to be assigned to the variable.

The value may be either numeric or a literal inclosed in quotes. LET# or STO# do not alter the currently defined record name and thus must be given in each assignment. Names of variables must not contain special characters or collide with a reserved sequence of characters like (SIN, COS or SQR). Instead of one numerical value a list of values or a primary generation instruction or a literal may be entered. In this case the rest of the values is assigned to the variables following the input variable. This defines an array if a named variable is used.

The unit of a variable is depending on the context, where this variable is used. Thus it is not possible in general to use the same variable for a section definition in [mm] ] and a system definition in [m]. But it is possible to assign a unit to a variable, then the given value will be converted immediately and the value can be used everywhere. If a variable has been assigned a unit, it will be inherited to all other variables and expressions. However this will also trigger a check if the obtained unit is allowed for the current use.

If for example a stress is expected and defined as #P/#A, both variables may have no unit, #P may be a force and #A an area, or #P may be a load per length while #A is a width. If a constant is added or subtracted to a variable, the constant will be taken as specified in the same unit.

An array has for all members the unit which has been defined for the item with index 0.

A variable is used if a leading # sign allows the clear identification as a variable name. If the expression starts with an additional leading = character, all unidentified characters will be taken as variable names.

For local usage the legacy convention to use scalar variables with pure number between 1 and 9999 instead of a name is still supported.

Assigning a literal
LET#TXT 'My Text'

Assigned to legacy variables 11,12,13
LET#11 4,5,6

4,5,6 and 7,8,9 are assigned to A[0:5]
LET#A 4,5,6 7,8,9

Assignment to a single array element
LET#A(2) 5.1

Using first element of array
LET#1 #A

Using second element of array
LET#1 =A(1)

Assignment to consecutive elements (3) and (4)
LET#A(3) 7,8

Access to the element with index #i
LET#1 #A(#i)

Using third element of array
LET#1 #A(2)

Copy all elements of array A to array B
LET#B #A(:)

Copy all elements starting at 3 of array A to array B
LET#B #A(3:)

Copy 3 elements starting at 2 of array A to array B
LET#B #A(2:4)

Create a new array with different sequence (but lists of sub-arrays are not allowed)
LET#B #A(2:3) #A(5:6)

Value of the variable, whose number is stored in legacy variable 11, is assigned to variable 4
LET#C #A(#11)

Assignment with unit
LET#B 20[mm]
LET#D 1.5[m]
LET#A #B*#D    ! Assignment with unit: A is 0.3[m2]
LET#X #B*#D[-] ! Assignment without unit: A is 0.3[-]

If a variable is assigned to an expression, the expression is calculated first and then its value is assigned to the variable.

To print variables for debugging purpose you may use the construct PRT# with a similar syntax for addressing the variable name. The name of the variable is expected without separation characters immediately behind the #. For more comfort one should use TXB / TXE or < TEXT > within literal text.

Variables with a name may be saved permanently in the database. The command STO#name will save the current or specified value of this variable in the database, which then can be used by all other programs accessing the database from that. E.g.

STO#C 30 ! Assignment and storage of the variable in the database

If a save variable should be removed from the database there is the command DEL#name. For this case it is also allowed to specify wild card characters. The commands DEL#OPT* or DEL#A?00 will delete all variables with that pattern. The use of DEL# within a control construct like a loop or an IF-block may yield unexpected results.

For special cases it is possible to reinitialize a variable with the last saved value with the following commands:

  • RCL#ALL (read all named variables)

  • RCL#name (read one named variable/array)

  • RCL#name(3) (read one entry of an array)

  • RCL#name cdbfile (read variable from another CDB)

There are some RESERVED NAMES which are automatically created by a programm run. The user may use and redefine those names however within his CADINP-data block with new values.

  • Variables VERSION(0) and VERSION(1) will be preset with the version number of the Release (dll) and the program itself, allowing to define common input data for multiple versions.

  • Variable #PI will be preset to 3.141593.

  • The arrays of variables GRP_MASS, SCT_MASS and MAT_MASS as well as GRP_REIN and SCT_REIN are redefined after a print or evaluation of system statistics. They contain the masses (MASS) and reinforcements (REIN) of all groups (GRP_) and section numbers (SCT_) or Materials (MAT_), where the index 0 contains the total sum.

All other variables start with the first three characters of the program creating them followed by an underline:

  • ASE uses the array ASE_ITER as follows: * ASE_ITER(0) = first loadcase number * ASE_ITER(1) = last loadcase number * ASE_ITER(2) = last achieved load factor

  • Variables of array AQB_USAGE will be set by AQB with the usage factors of design tasks of the last input block.

  • All variables starting with OPT_ are reserved for OPTIMA.

  • The CADINP variables are arrays of real numbers (DOUBLE)

  • The variable types LET and STO will be treated differently. The LET variable will be used locally only inside one block PROG...END. The STO variable will be saved inside the database an can be used anywhere inside the DAT input file.

  • You may also assign literal with form let#variable 'literal'

  • Literals larger than 8 letters will be saved as an array #variable(0) = 'String-L', #variable(1)='iteral'

  • It is possible to get access to different parts of the literal by using a specific index for begin and end (similar to FORTRAN). The start index begins with 1, e.g. #\variable(3:6) equals ‘’ring’’.

  • Arrays will be defined as a list, divided by comma, without any blank lines

  • Descriptions and literal names are not directly accessible, because they were saved in the database as integer values (Definition as [chr], [bhr] oder [str])

  • With the function LIT() the values can be saved as readable text variable in CADINP.


!Is the same as