Solved

Invalid 'for' loop control variable

Posted on 2001-06-23
3
3,808 Views
Last Modified: 2011-09-20
OK basically here is the scoop..



I have dumped a bunch of first names into an array. The array is named FiltUpArray

If I use this:

For Each val In FiltUpArray    
     
     If val = "Joe" Then

     Response.Write "That Name Exist In Your Array!"

      End If
Next
########################

It works pefectly... But.. If I use it as shown below in a form so that I can check the check boxes in the form it craps out with this error:

##########################
Microsoft VBScript compilation error '800a0410'

Invalid 'for' loop control variable

/filtersUpdate_hd.htm, line 156

For Each val in FiltUpArray
-------------^
##########################



############Code I use in HTML form##############
<input type="checkbox"
          <%
          For Each val In FiltUpArray    
            If val = "Acura" Then
          %>
            checked
          <%
            End If
           Next
          %>  
     
          name="Acura" value="ON">
###############################################

Any idea why?
0
Comment
Question by:muchowebdotcom
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 33

Accepted Solution

by:
hongjun earned 200 total points
ID: 6222420
Try this

<input type="checkbox"
<%
For Each val In FiltUpArray    
     If Cstr(val) = "Acura" Then
          Response.Write " checked "
                Exit For
    End If
Next
%>  
name="Acura">

hongjun
0
 
LVL 1

Author Comment

by:muchowebdotcom
ID: 6222427
I just gave you the points because I already solved it another way.. Thanks and enjoy the points..
0
 
LVL 33

Expert Comment

by:hongjun
ID: 6222435
Oh thanks anyway. Perhaps you just made a careless mistake and that's all. Your logic is there.

hongjun
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question