# VB Script Error OnProcessData Overflow: 'N' Follow

I have a function that calculates the Adler32 checksum of data and then coverts the base of that data from decimal to base 31. Why we chose this number base is beyond me, but it's everywhere. The Adler32 portion generates the expected output for the given input. The base conversion part is where I'm running in to trouble. Up to this point this function has worked just fine in Bartender but today as I'm designing a label I get this error.

The actual error is:

OnProcessData (Line23): Overflow: 'N'

The problem code is this (assume Value = 2235173065)...

Const BASE_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTU"

n = Value

Do

ToBase = Mid(BASE_CHARS, n Mod 31 + 1, 1) & ToBase

n = Int(n / 31)

Loop While n > 0

Value = ToBase

The specific line that appears to generate the error is:

ToBase = Mid(BASE_CHARS, n Mod 31 + 1, 1) & ToBase

I've run through the code manually one iteration at a time in a text editor and the expected result is returned. The error message from the Visual Basic Script Editor is so vague that I'm not exactly sure what it's trying to communicate. I'm hoping someone can shed some light on what the error message is trying to communicate and/or why this code is problematic

##### 1 comments

###### Pete Thane

I think VB Script can only handle numbers up to 2147483647 and not beyond that.

Please sign in to leave a comment.