Integer value in Windows-32
Kresimir Majdenic from Croatia  [14 posts]
8 year
I have image with two barcodes (Code128) on it. First one has 10 digits. Second one has 4 digits. Barcode module reads them correctly and most of times first barcode is put in variable BARCODE and second one in variable BARCODE_2. Sometimes it is vice versa. That is why I have a VBScript code which checks where is the 10digit barcode.

VBScript snippet:

BC1 = GetVariable("BARCODE")
BC2 = GetVariable("BARCODE_2")
if (BC1 > 0) and (BC2 > 0) then ... etc.

In Windows 64 it works but have a problem with windows 32 when long barcode gets value such as 2812001529. In that case BC1 becames negative number (I guess this is too big number of integer variable in windows-32).


1. Is there any other way to test if BARCODE has more than 4 digits?
2. How to handle integer number 2812001529 in Windows-32?
Steven Gentner from United States  [1446 posts] 8 year

That is correct that a 32 bit number will turn negative as it approaches the 32 bit limit.

What we recommend is to use


which will return back the full barcode as a string as apposed to attempting to convert it into an int (implied by GetVariable). This will also ensure that any codes that have letters in it is also correctly represented.


This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index