Added February 2022
.ISDEF(ds.member)
.ISDEF(ds.@member$)
.ISDEF() returns true (-1) or false (0) depending on whether the specified DYNSTRUCT member exists—i.e., whether the DYNSTRUCT is bound to a structure that contains the specified member.
In both variations, ds should be either an mapped instance of a structure, or the structure definition name from the defstruct. The difference between the two variations is that in the first case, member must be an actual reference to a member of the specified structure, whereas in the second case member$ should be a string variable whose value matches a member of the structure. See Dynamic Structure Reference / Usage for more details.
Example
map1 ds,DYNSTRUCT
map1 field$,s,30
...
if .ISDEF(ds.foo) then
? "ds.foo exists; value = ";ds.foo
endif
...
field$ = "foo"
if .ISDEF(ds.@field$) then
? "ds.@";field$;" exists; value = ";ds.@field$
endif
See Also
| • | MX_DYNSTRUCT (DYNOP_INFO) for an alternate approach to determining the details of the current binding for a specified DYNSTRUCT. |
History
2022 February, A-Shell 6.5.1711: Function added to A-Shell