hexagon logo

Using Variables in READLINE

This is probably a simple syntax problem, but searching has not given me any clues.

Goal: automate report display of heat lot code unique to workpiece serial #.

Done: Operator inputs serial # which is assigned to variable V1.

Done: CSV file created with master list of serial #s in first column with heat lot codes in next column.

Not working: getting file pointer to look for a variable (V1 the serial #) to return text after.

The READLINE example from the Help is designed to look for a standard block of text (Part ID, Location, etc) to return text after.

In my code so far, file pointer looks for text "V1" but returns nothing as it's not looking for the value of variable V1.

Code:

C1         =COMMENT/INPUT,YES,'Serial Number:'
            ASSIGN/V1=C1.INPUT
FPTR       =FILE/OPEN,C:\BLADERUNNER\BLADES\ROW_2\ROW2_HEAT_LOT_CODES.CSV,READ
VREAD      =FILE/READLINE,FPTR, "V1" +{VCODE}
            COMMENT/REPT,VCODE
            FILE/CLOSE,FPTR,KEEP
.
.
.


Thanks in advance!
Parents
  • Minor progress:
    VREAD      =FILE/READLINE,FPTR, {V1} + {VCODE}

    This results in an actual value from the target CSV file being read in. Unfortunately it's not the correct value, which would be the code corresponding to my 198 serial # assigned to V1, but merely the value in the first row of the second column.

    This tells me that the code posted above is causing the file pointer to look at the first line of the file, skip over the first block of text no matter what it is, grab the second block of text after the delimiter, and stuff it into the variable VCODE.

    ........TO BE CONTINUED......
Reply
  • Minor progress:
    VREAD      =FILE/READLINE,FPTR, {V1} + {VCODE}

    This results in an actual value from the target CSV file being read in. Unfortunately it's not the correct value, which would be the code corresponding to my 198 serial # assigned to V1, but merely the value in the first row of the second column.

    This tells me that the code posted above is causing the file pointer to look at the first line of the file, skip over the first block of text no matter what it is, grab the second block of text after the delimiter, and stuff it into the variable VCODE.

    ........TO BE CONTINUED......
Children
No Data