Как вариант проблему можно решить через указатели.
Structure TypeDef
Name.s
*VarField.Var[#MAX_VARFIELDS]
VarFields.i
CodeNum.i
EndStructure
Structure Var
Name.s
DataType.b ;DataType = DATATYPE_
CustomType.TypeDef ;If DataType = DATATYPE_CUSTOM then this is the typedef this custom variable is
TypeDef.TypeDef ;Type definition this variable belongs to
Scope.b
Owner.Func ;Scope = SCOPE_
Value.s ;Value of a SCOPE_CONSTANT variable
CustomTypeTemp.s ;Temporary fields
DefinitionPos.i ;Location of variable definition
CodeNum.i
EndStructure