Information
Enter Setup
BA Replace a string with another
Syntax=BAnnNN SS NN SS
2
1 1 2
nn: The count of replacements to be made, if nn=00 or nn>=the number of occurrences of a string to be replaced, then replace
all occurrences of that string.
NN : The length of the string to be replaced, NN >0.
1 1
SS
1
: The ASCII hex value of each character in the string to be replaced.
NN : The length of replacement string, NN >=0. To replace string “SS ” with NUL (i.e. deIete string “SS ”), you should set NN to
2 2 1 1 2
00 and leave out SS
2
.
SS
2
: The ASCII hex value of each character in the replacement string.
From the current cursor position, search forward for the occurrence of “SS ” string (of length “NN ”) and replace the string
1
1
with “SS ” string (of length “NN ”) in the output message until every “SS ” stringis replaced or the count of replacements made
2 2 1
reaches “nn” times, without moving the cursor.
BA Example: Replace “23”s with “ABC”s in barcode data
If the barcode has a string of characters that the host application does not want included, you can use the BA command to
replace the string with something else. In this example, you will replace the “23”s in the barcode above with “ABC”s.
Command string: BA0002323303414243F100
BA is the “Replace a string with another” command
00 is the count of replacements to be made, 00 means to replace all occurrences of that string 02
is the length of the string to be replaced
32 is the hex value for 2 (character in the string to be replaced)
33 is the hex value for 3 (character in the string to be replaced)
03 is the length of the replacement string
** Exit Setup
193