Hello, I am trying to read a PDF417 bar code into an edit box control on a form. However, the data comes in as a single line. When I scan the same bar code into a notepad I get many line feeds.
Does West Wind offer any form level controls that would allow for the scanning of a PDF417 2-D type bar code?
A Carriage Return (CR, chr(13)) is usually not "alone" in a file, often it's combined with a Line Feed (LF), chr(10)). And different programs treats a "lonely" CR differently. Some programs will show lines on top of each other, some will show lines after each other and some will show lines as separate lines.
Try to add a LF to every CR and see if that fixes it. Something like this will do the job:
yourEditBox.value = strtran(yourEditBox.value, chr(13), chr(13)+chr(10))
If this fixes you problem, I'm pretty sure that the bar code reader can be programmed to add the LF automatically.
Thank you for the suggestion Tore Bleken. But I tried all kinds of variations of that without success. Both at the scanner level and in VFP logic like you suggested. I suspect the PDF417 has control codes that a VFP text box does not know what to do with. If I read the same PDF417 from a file into a string. (e.g. filetostr()) then it works fine.
I ended up creating a simple C# project. The C# form has a text box just like my VFP form did. But, the C# text box handles the incoming data from the scanner just fine. Very strange.