|
In all our .PM4 wire programs we set the first element as a #S1 string User Event.
For example, Element 1 = "#S1=HS4782A REV.AB T1-213233-106 DIE 261 TRIM PUNCH LVIBE"
What I would like to accomplish is to take the User Event element 1 and assign it to a string variable of #PROG
Name a new variable #NUMBER
Next take the #NUMBER = STRSUB(#PROG, 5,10) which would give me HS4782
Name a new variable #START
Take the #START=STRSUB(#PROG, 1,5) which would give me #S1=
Name a new variable #END
Name a new variable #LENGTH
#LENGTH = STRLEN(#PROG)
Take the #END=STRSUB(#PROG, 12,#LENGHT ) which would give me REV.AB T1-213233-106 DIE 261 TRIM PUNCH LVIBE
Name a new variable #NEW_PROG
Now concatenate #NEW_PROG = #START + #NUMBER + #END to give me #S1=HS4782 REV.AB T1-213233-106 DIE 261 TRIM PUNCH LVIBE
Then modify User Event element 1 as MOD_UEVENT[EL=1, XS2=0, YS2=0, TX= STRTMP("%NEW_PROG"), LV=0]
What I want is to do is to remove the 11th character from element 1
To go from... #S1=HS4782A REV.AB T1-213233-106 DIE 261 TRIM PUNCH LVIBE
to... #S1=HS4782 REV.AB T1-213233-106 DIE 261 TRIM PUNCH LVIBE
The part I'm having trouble with is assigning the element 1 to a STRING variable.
Regards, Michael Senack
|
