Scripting: Parse Scan Data

Version 4

    Verified Product Versions

    Terminal Emulation 7.3

    The below script is designed to parse through scanned data and look for a key letter(s), strip everything before those letters and then display the resulting scanned data..The key letter is in random places in the barcode



    In the below example I am looking through the scanned data and finding the letters "YB". YB in its location is random


    Barcode: 1234yb567890



    End Result after the script should be:





    The below script will accomplish this type of parse and print.When assigning the string and Number to activate this script be sure to select sScan and nParse


    Script( YB_Parse )

    String( sScan )

    String( sNewScan )

    Number( nScanLen )

    Number( nParse )

    Activate( On_Input, sScan, nParse )


        Comment: Original Scan Data

        Comment: Scan_String( sScan, 0 ) Removed this line as it printed to the screen twice


        Comment: Length of Original Scan

        nScanLen = String_Length( sScan )


        Comment: Subtract One to accommodate String_Middle Pointer starting at 0

        nScanLen = Number_Minus( nScanLen, 1 )

        Comment: What to Find and ignore case

        nParse = String_Find_First( sScan, "YB", TRUE )


        sNewScan = String_Middle( sScan, nParse, nScanLen )

        Scan_String( sNewScan, 0 )