add 1 to the first 3 characters of a string

jimmy1981

Member
Joined
Nov 14, 2011
Messages
24
Programming Experience
Beginner
Hi,

I have a barcode that once scanned returns a string 8 characters long.

Further along the program I have this line of code:


VB.NET:
Mid(Header_FirstStop, 1, 3) = (Mid(Header_FirstStop, 1, 3) + 1)

Eg, 00100000 I would want to then be 00200000 or eg, 01200000 would be 01300000, yet when I add 1 it is not giving the desired result

Can somebody advise what I am doing wrong?
 
it's ok, i sorted it, for anyone interested!

VB.NET:
[SIZE=2]Mid(Header_FirstStop, 1, 3) = Format((Mid(Header_FirstStop, 1, 3) + 1), [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"000"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])
[/SIZE]
 
Back
Top