Velocity: adding a Hex valued scan terminator

Version 2

    This article will go over the creation of a script in Velocity to add a custom hex value to the end of your scanned data..



    The Script:

    function onScan(event)

    { =, 16)) );



    WLEvent.on("Scan", onScan);




    1. function onScan(event)

         creates a function to process the scan


         This is the scanned data that is coming in


         This is telling the script that we are going to add to the end of the barcode

    4. String.fromCharcode

         This call returns the string created from Unicode character values

    5. parseInt with 16

         This converts the string value to a hexadecimal format

    6. WLEvent.on("Scan", onScan);

         Register the onScan function to be called when a scan occurs. Without this it will never run.