Page tree
Skip to end of metadata
Go to start of metadata

TEXTITEM$ returns a text item selected from the data Slot

Syntax

TEXTITEM$(ValExp)

Arguments

  • ValExp is a value expression containing an integer number.
  • Definition of TEXTITEM in the data slot of the expression the function is used in:
    TEXTITEMx=
    "
    "

    With for x a number which connect it to ValExp

Remarks

  1. If ValExp is out of the range of TEXTITEM$, "NullString" is returned.
  2. Please make sure that the delimiters you are using around your text item are different from the text you use inside the script!
  3. The text items should be stored in the data slot of the expression in which the TEXTITEM$() function is used.
  4. The TEXTITEM definitions in the data slot may be delimited with quotes (") but also other characters may be used as long as the starting and ending is the same and is not used in the template itself. So if you want to use quotes in the content of a TEXTITEM you better use "|" as delimiter (see example)
  5. TEXTITEM$ is very useful in combination with other functions to refer to fixed datasets (for instance series of coefficients etc.). Moreover, it is a very convenient way to combine it with the TEMPLATE$() function so you can write your templates in the dataslot of expression using the TEMPLATE$ function

Examples

For example, if the dataslot of expression:

H$ = TEXTITEM$(Num)

contains the following items:

TEXTITEM0 = "NullString"

TEXTITEM1 = 
"The ship is equiped with a diesel-electric propulsion system. 
"

TEXTITE2 = "CPP propellors are installed. 
"
 

TEXTITEM3 = 
"Main particulars of the ship: 
LPP: 110 m 
B: 15 m 
T: 5 m 
"M

TEXTITEM4 = "The propeller diameter will be 3.5 m "

For Num=3 H$ will be assigned

"Main particulars of the ship: 
LPP: 110 m 
B: 15 m 
T: 5 m 
"


If you need to use quotes (") as content in the TEXTITEM, you shoud use another charater, i.e. one not used in the TEXTITEM itself, e.g. |.

So if you want to put a Telitab set in a TEXTITEM, you can do it as follows:

TEXTITEM1 = 


2 "XC" "YC" 
"1" 1 1 
"2" 2 4 
"3" 3 9 
"4" 4 16 
"5" 5 25 
"6" 6 36 
"7" 7 49 
"8" 8 64 
"9" 9 81 
"10" 10 100|

Quaestor uses the first character behind "=" as text marker.


 

Quick links: Functions overview | Attribute overview | Constants overview | Dimensions overview


  • No labels