GETISVALID

EXPORT BOOLEAN GETISVALID(PhysicalType alias) := expression;

PhysicalTypeThe value type of the input parameter to the function.
aliasThe name of the input to use in the expression.
expressionThe operation to perform on the input.

GETISVALID defines the callback function to determine that data values are in the specified physical format.

Example:

EXPORT NeedC(INTEGER len) := TYPE
  EXPORT STRING LOAD(STRING S) := 'C' + S[1..len];
  EXPORT STRING STORE(STRING S) := S[2..len+1];
  EXPORT INTEGER PHYSICALLENGTH(STRING S) := len;
  EXPORT INTEGER MAXLENGTH(STRING S) := len;
  EXPORT BOOLEAN GETISVALID(STRING S) := S[1] <> 'C';
END;
          
// delimited string data type
EXPORT dstring(STRING del) := TYPE
  EXPORT INTEGER PHYSICALLENGTH(STRING s) :=
               Std.Str.Find(s,del)+length(del)-1;
  EXPORT STRING LOAD(STRING s) :=
               s[1..Std.Str.Find(s,del)-1];
  EXPORT STRING STORE(STRING s) := s + del;
END;

See Also: TYPE Structure