Wrox Programmer Forums
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 6th, 2003, 01:32 PM
Authorized User
Join Date: Aug 2003
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Default Option Explicit and Item

I'm getting an Error - "Item is undefined" with the following:

<%Option Explicit%>
For Each Item in Request.QueryString

How does one declare Item as a variable or is it documented that you don't use <%Option Explicit%> when you setup a for next loop that loops through a collection?

Old October 6th, 2003, 01:54 PM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

Hi there,

Just declare it right before the loop, or anywhere else in the page. The loop will reuse the variable for each item it iterates over:
<%Option Explicit%>
Dim Item
For Each Item in Request.QueryString


Imar Spaanjaars
Everyone is unique, except for me.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Check Boxes/Option buttons/Option Group hewstone999 Access VBA 1 March 14th, 2008 07:25 AM
FOR XML Explicit and ASP tonyellard SQL Server ASP 1 April 8th, 2005 10:41 AM
For XML Explicit bmains SQL Server 2000 5 March 8th, 2004 09:18 AM
SQL Server For XML Explicit tonyellard Classic ASP Databases 0 November 3rd, 2003 03:03 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.