SIZEOF

SIZEOF(data [, MAX ] )

dataThe name of a dataset, RECORD structure, a fully-qualified field name, or a constant string expression.
MAXSpecifies the data is variable-length (such as containing child datasets) and the value to return is the maximum size..
Return:SIZEOF returns a single integer value.

The SIZEOF function returns the total number of bytes defined for storage of the specified data structure or field.

Example:

MyRec := RECORD
INTEGER1 F1;
INTEGER5 F2;
STRING1 F3;
STRING10 F4;
QSTRING12 F5;
VARSTRING12 F6;
END;
MyData := DATASET([{1,33333333333,'A','A','A',V'A'}],MyRec);
size0 := SIZEOF(MyRec); //result is 39
size1 := SIZEOF(MyData.F1); //result is 1
size2 := SIZEOF(MyData.F2); //result is 5
size3 := SIZEOF(MyData.F3); //result is 1
size4 := SIZEOF(MyData.F4); //result is 10
size5 := SIZEOF(MyData.F5); //result is 9 -12 chars stored in 9 bytes
size6 := SIZEOF(MyData.F6); //result is 13 -12 chars plus null terminator
size7 := SIZEOF('abc' + '123'); //result is 6
OUTPUT(size0);
OUTPUT(size1);
OUTPUT(size2);
OUTPUT(size3);
OUTPUT(size4);
OUTPUT(size5);
OUTPUT(size6);
OUTPUT(size7);

See Also: LENGTH