VBScript Illegal assignment: 'i'
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: VBScript Illegal assignment: 'i'

  1. #1
    Join Date
    Dec 2004
    Posts
    438

    VBScript Illegal assignment: 'i'

    I've just learning VBScript, so this is probably easy to sort out:

    Code:
      Microsoft VBScript runtime error '800a01f5'
    
      Illegal assignment: 'i'
    
      /dima_devel/template_display_functions.asp line 15
    I have a template which is working perfectly on all pages, but when I include the md5.asp file I get an error, obviously the two must be clashing. Here is the code for the line it's referencing:


    Code:
    	'Displays the breadcrumb bar using the parameter array as the source of the data
    	Sub outputBreadcrumbArray(breadcrumb_array)
    	array_length = UBound(breadcrumb_array)
    
    	'Response.write(array_length)
    
    	If array_length < 2 Then
    		x = 0
    	Else
    		x = 1
    	End if
    
    	for i = x to array_length
    		if i=array_length then
    		%>
    			<a href="<%=breadcrumb_array(i,1) %>" class="blue_bar_text"><%=breadcrumb_array(i,0) %></a>
    		<%
    		Else
    		%>
    			<a href="<%=breadcrumb_array(i,1) %>" class="blue_bar_text"><%=breadcrumb_array(i,0) %></a> > 
    		<%
    		end if
    	Next
    End Sub

    The for i = x to array_length line is line 15. I've tried changing i and x variables in md5.asp which is the file it's referencing. The md5 file is a standard set of functions for generating md5 hashes in asp. Like I say if I take out the link to this md5 file everything works, but obviously without the functionality to make it do hashes.


    Just posting here as a last resort.

  2. #2
    Join Date
    Apr 2008
    Posts
    5

    Re: VBScript Illegal assignment: 'i'

    I'm not too up on ASP but I would say that somewhere in the MD5.asp page there is a declaration of I that would conflict with it being an Integer (as in your FOR loop). Try changing the I in your FOR loop to something like IJK.

    Code:
    	for IJK = x to array_length
    		if IJK=array_length then
    		%>
    			<a href="<%=breadcrumb_array(IJK,1) %>" class="blue_bar_text"><%=breadcrumb_array(IJK,0) %></a>
    		<%
    		Else
    		%>
    			<a href="<%=breadcrumb_array(IJK,1) %>" class="blue_bar_text"><%=breadcrumb_array(IJK,0) %></a> > 
    		<%
    		end if
    	Next

  3. #3
    Join Date
    Jan 2006
    Location
    Chicago, IL
    Posts
    14,990

    Re: VBScript Illegal assignment: 'i'

    Just declare it before you use it.
    Code:
    DIM i
    vba doesn't like types as i recall. it likes variant
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center