Structures with Variables of Type Point

If a variable is of type point, the user can still use the .X, .Y, .Z, .I, .J, and .K extensions to get at individual items of the point. The user can also use any of the extensions from this example in their structures without being forced to use them as point elements .

ASSIGN/V1.X="Some string"
ASSIGN/V1.Y=ARRAY(1,3,5,9,7)
ASSIGN/V1.Z=MPOINT(3,5,7)

COMMENT/REPT,V1.X

Output is "Some string"

COMMENT/REPT,V1.Y[2]

Output is 3, the second element of the array.

COMMENT/REPT,V1.Z.Y

Output is 5, the Y value of the MPOINT.

By combining structures with the function capability of the PC-DMIS expression language, it is possible to have dynamic structure references as shown here:

ASSIGN/DYNAMICSTRUCT=FUNCTION((X,Y),X.Y)
C1=COMMENT/INPUT,Please enter in item
ASSIGN/TESTSTR=C1.INPUT
ASSIGN/FRONT=LEFT(TESTSTR,INDEX(TESTSTR,".")-1)
ASSIGN/BACK=MID(TESTSTR,INDEX(TESTSTR,"."))
ASSIGN/RESULT=DYNAMICSTRUCT(FRONT,BACK)

This portion of the example asks you to input a variable reference, splits the reference at the first '.', and then assigns RESULT to be equal to that reference by using the function DYNAMICSTRUCT.

So, if from you had typed V1.Y[4] for the C1.INPUT variable, RESULT would end up with the value of 9 (the fourth element of the array assigned to V1.Y).

The learn time evaluation of expressions has been enhanced to accurately show all elements of a structure or an array.