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
  • What are you exactly trying to do?

    You do something like this, as this is what I use for my "looping":

    ASSIGN/COUNT=0
    TOTAL_LBL =LABEL/
    ASSIGN/COUNT=COUNT+1
    IF/COUNT=="4"
    ASSIGN/X_VAR=1.313*0
    ASSIGN/Y_VAR=1.25*3
    GOTO/PART_LBL
    END_IF/
    IF/COUNT=="3"
    ASSIGN/X_VAR=1.313*0
    ASSIGN/Y_VAR=1.25*2
    GOTO/PART_LBL
    END_IF/
    IF/COUNT=="2"
    ASSIGN/X_VAR=1.313*0
    ASSIGN/Y_VAR=1.25*1
    GOTO/PART_LBL
    END_IF/
    IF/COUNT=="1"
    ASSIGN/X_VAR=1.313*0
    ASSIGN/Y_VAR=1.25*0
    GOTO/PART_LBL
    END_IF/
    PART_LBL =LABEL/
    LOOP_XY =GENERIC/POINT,DEPENDENT,CARTESIAN,$
    NOM/XYZ,<0+0,0+0,0+0>,$
    MEAS/XYZ,<X_VAR,Y_VAR,0+0>,$
    NOM/IJK,<0+0,0+0,1+0>,$
    MEAS/IJK,<0+0,0+0,1+0>
    LOOP_ALN =ALIGNMENT/START,RECALL:FIXTURE_ALN,LIST=YES
    ALIGNMENT/TRANS,XAXIS,LOOP_XY
    ALIGNMENT/TRANS,YAXIS,LOOP_XY
    ALIGNMENT/END
    


    Then I have a code at the end that satisfies the total loop count to then end the program or it goes back to the label. You can do this with the DO / UNTIL flow control as well. ​​
  • Have variable like: V1=5, V=12, V3=20.... that are feed from a form.

    Within a loop I populate another Variable (VCALL) with the value of V+counter. For example 2nd loop, the Vcall will be 12, 3rd loop the VCALL would be 20 and so on.
Reply Children
No Data