hexagon logo

Assigning a variable from a variable assignment

Hello I would like to do something like the following but I cannot get it to work and coffee has still to hit my this Friday morning:

Assign - Counter=1
Assign - V1=1
Assign - VCALL="V"+Counter

Now, I would like for VCALL to take the value of 1 instead of the string "V1". Keep in mind that this is a super simplified example but should give the idea of what I am after. I tried these pointer brackets {} but they don't seem to work. Creating a function does not seem to work either. I am getting a string with the name of the variable instead of the value in the variable :S

Any help here guys please?
Parents
  • Like this ?
    ASSIGN/V1=ARRAY(1,3,5,1000)
    V2 =LOOP/START,ID=YES,NUMBER=4,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
    ASSIGN/V3="V"+V2
    ASSIGN/V4=V3.XYZ
    ASSIGN/V5=V3.IJK
    F1 =GENERIC/POINT,DEPENDENT,CARTESIAN,$
    NOM/XYZ,<V4.X,V4.Y,V4.Z>,$
    MEAS/XYZ,<V4.X,V4.Y,V4.Z>,$
    NOM/IJK,<V5.I,V5.J,V5.K>,$
    MEAS/IJK,<V5.I,V5.J,V5.K>​
    LOOP/END


    or
    ASSIGN/V4="V"+V2+".XYZ"
    ASSIGN/V5="V"+V2+".IJK"
Reply
  • Like this ?
    ASSIGN/V1=ARRAY(1,3,5,1000)
    V2 =LOOP/START,ID=YES,NUMBER=4,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
    ASSIGN/V3="V"+V2
    ASSIGN/V4=V3.XYZ
    ASSIGN/V5=V3.IJK
    F1 =GENERIC/POINT,DEPENDENT,CARTESIAN,$
    NOM/XYZ,<V4.X,V4.Y,V4.Z>,$
    MEAS/XYZ,<V4.X,V4.Y,V4.Z>,$
    NOM/IJK,<V5.I,V5.J,V5.K>,$
    MEAS/IJK,<V5.I,V5.J,V5.K>​
    LOOP/END


    or
    ASSIGN/V4="V"+V2+".XYZ"
    ASSIGN/V5="V"+V2+".IJK"
Children
No Data