ListGetType Function

Action

Returns the type of a list as a number, where the return values represent the following list types:
  • 1: number
  • 2: float
  • 3: boolean
  • 4: string

Include file

List.bdh

Syntax

ListGetType(
   in theList) : number;
Parameter Description
theList List of number, boolean, float or string.

Return value

  • data type of theList (1, 2, 3, or 4)

Example

transaction TAListGetType
var
  lstNumber: list of number;
  lstFloat:  list of float;
  lstBoolean: list of boolean;
  lstString:  list of string;
begin
  writeln("number:  " + string(ListGetType(lstNumber)));
  writeln("float:   " + string(ListGetType(lstFloat)));
  writeln("boolean: " + string(ListGetType(lstBoolean)));
  writeln("string:  " + string(ListGetType(lstString)));
  writeln("number-constant:  " + string(LIST_TYPE_NUMBER));
  writeln("float-constant:   " + string(LIST_TYPE_FLOAT));
  writeln("boolean-constant: " + string(LIST_TYPE_BOOLEAN));
  writeln("string-constant:  " + string(LIST_TYPE_STRING));
end TAListGetType;

Output

number:  1
float:   2
boolean: 3
string:  4
number-constant:  1
float-constant:   2
boolean-constant: 3
string-constant:  4