Algosim documentation: ValidateStruct

ValidateStruct

Tests if a structure conforms to a specific registered structure type.

Syntax

Description

ValidateStruct(S, s) returns true iff S conforms to the format of the registered structure type named s, even if S is not a typed structure.

Examples

D ≔ date()
year: 2020
month: September
day: 30
ValidateStruct(D, "Date")
true
ValidateStruct(D, "Time")
false
ValidateStruct(struct("year": 2020, "month": 9, "day": 30), "Time")
false
ValidateStruct(struct("year": 2020, "month": 9, "day": 30), "Date")
true