new
Creates a new structure of a specific type.
Syntax
-
new(T, ...)
-
T
is a structure type -
...
are structure members
-
Description
new(T, ...)
returns a new instance of T
with default values except for the explicitly specified members ...
. To create a member, use the :
operator.
Examples
TDate ≔ GetStructType("Date")
year: 0 month: 0 day: 0
new(TDate)
year: 0 month: 0 day: 0
new(TDate, "day": 20)
year: 0 month: 0 day: 20
new(TDate, "day": 20, "month": 5)
year: 0 month: 5 day: 20
new(TDate, "day": 20, "month": 5, "year": 2020)
year: 2020 month: 5 day: 20
'(TDate, ans) @ type
structure type structure of type "Date"