I have put 2 fields into a barcode and an additional delimiter also. The barcode content will be for example 123456789|abcdefg where pipe is the delimiter. Now i have to sacn this barcode once and then make the first part appear in one field and 2nd part ie whatever is after the | in the seconf field in progress 4gl? How can i do it??
Asked
Active
Viewed 311 times
-2
-
How are you trying to read? What did you try so far? This information will help us to help you! – Austin Jan 12 '15 at 10:10
-
I have just used the pipe as a delimiter and i scan it and everything comes and sits in one field.I a m not getting how to write a code for - if scanned then until delimiter put in field a then after delimiter put ion field b. – NexteerIndia QADSupport Jan 12 '15 at 12:00
1 Answers
0
You can create the first field formatted as it can handle all the code. Then, into the RETURN event of the field (assuming that you using an SmartWindow and your barcode reader do a CR/LF at the end of barcode reading) you use the content of the first field and split it into two fields. Something like this :
DEF VAR cField1 AS CHAR NO-UNDO FORMAT 'x(50)'.
DEF VAR cField2 AS CHAR NO-UNDO FORMAT 'x(50)'.
UPDATE cField1 WITH WIDTH 333. /* Here you 'bip' your barcode */
ASSIGN cField2 = ENTRY(2,cField1,'|')
cField1 = ENTRY(1,cField1,'|').
DISP cField1 cField2.
Hope it helps.

Bruno
- 102
- 1
- 6