No announcement yet.

AFIND for NUL Character

  • Filter
  • Time
  • Show
Clear All
new posts

  • AFIND for NUL Character

    Good afternoon, I am reading a barcode scanner into port 2 of a D0-06 and have had some issues with bad reads resulting in nul characters. I believe I have resolved the issue but need to implement a check on the read barcode before allowing the process to proceed to ensure that I have read a valid barcode. I would like to use the AFIND function. The problem I am encountering is that I am not sure which string item I need to search for? I have used "nul", "null", . (period) as that is how a null character is displayed in a data table while online with the processor, and *. None of these has produced the desired result. Does anyone know what I should search for with the AFIND in order to locate a nul character in an ascii string? I have been able to solve the issue using a for next loop and following a CMPV (K1) with a SWAPB and looping 7 times but I think for documentation and training purposes that the AFIND would be much cleaner. Thanks for any help or consideration. Thanks,

    Barcode length = 14 characters, all numeric

  • #2
    Try $00 - if you mean a hex zero character.



    • #3

      Thank you Bill, worked like a charm! Could have saved myself a few hours.... Have a great night,