Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Invalid 'for' loop control variable

Posted on 2001-06-23
3
Medium Priority
?
3,899 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 600 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

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…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

636 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