Microsoft VBScript runtime error '800a0006' Overflow

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jmagcase
    New Member
    • Feb 2010
    • 1

    Microsoft VBScript runtime error '800a0006' Overflow

    Hey Everyone,

    I am learning ASP at the moment and came across an error with this code:

    Code:
    Function Encrypt( plain, symkey )
    	keylen=Len(symkey)
    	plainlen=Len(plain) 
    	Encrypt=""
    	for i=0 to plainlen-1
    		curchar=mid(plain, i+1, 1)
    		charvalue=asc(curchar)
    		if i<keylen then
    			keypoint=i
    		else
    			keypoint=i-(int(i/keylen)*keylen)
    		End if
    		keyvalue=asc(mid(key,keypoint+1,1))
    		charvalue=charvalue+keyvalue
    		encrypt=encrypt & charvalue & " "
    	next
    End Function
    The error is said to be coming from this line:
    Code:
    keypoint=i-(int(i/keylen)*keylen)
    TIA!
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    print out the values of all the variables at this point.
    Code:
    response.write "keypoint:" & keypoint & "<br>"& vbnewline
    response.write "i:" & i & "<br>"& vbnewline
    response.write "keylen:" & keylen & "<br>"& vbnewline
    response.write "value:" & i-(int(i/keylen)*keylen) & "<br>" & vbnewline
    Does this happen the first time it goes through the loop?

    Jared

    Comment

    Working...