Your Products have been synced, click here to refresh
Mid Function
string = Mid(strgvar,begin,length)
ASSIGN/V_LINE_1=DOUBLE(MID(GETTEXTEX(1133,1,"SEG=1","FCFLOC1"),1,13)) ASSIGN/V_LINE_2=DOUBLE(MID(GETTEXTEX(1133,1,"SEG=1","FCFLOC1"),14,13)) ASSIGN/V_LINE_3=DOUBLE(MID(GETTEXTEX(1133,1,"SEG=1","FCFLOC1"),27,13)) so on
Hi,
your MID() function looks odd
if the ",length" parameter is not passed then it takes the total length of the string
that means the code you wrote passes the text starting from position 13 to the end.
################################################## #########################
I now assume that the line length is always exactly 13 characters (I can hardly test that):
ASSIGN/V_LINE_1=DOUBLE(MID(GETTEXTEX(1133,1,"SEG=1","FCFLOC1"),1,13)) ASSIGN/V_LINE_2=DOUBLE(MID(GETTEXTEX(1133,1,"SEG=1","FCFLOC1"),14,13)) ASSIGN/V_LINE_3=DOUBLE(MID(GETTEXTEX(1133,1,"SEG=1","FCFLOC1"),27,13)) so on
################################################## #########################
The problem with that is that you should test whether the line is empty.
because you can turn the lines off and on.
preferably with a loop
ASSIGN/VLINECOUNT = -1
ASSIGN/VLINETEXT[0] = "test"
DO/
ASSIGN/VLINECOUNT = VLINECOUNT + 1
ASSIGN/VLINETEXT[VLINECOUNT]=DOUBLE(MID(GETTEXTEX(1133,1,"SEG=1","FCFLOC1"),(V LINECOUNT*13)+1,13))
UNTIL/COUNTER==(VLINETEXT[VLINECOUNT]="") OR (LEN(VLINETEXT[VLINECOUNT])<13)
################################################## #########################
sorry i didn't test this on a machine, just wrote it out from my head. It should work something like this, I'll test it later when I have time
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |