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 June 12th, 2007, 12:10 AM
Registered User
 
Join Date: Apr 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to response.write a looping variable ?

I have these variable :
var_1 = "A"
var_2 = "B"
var_3 = "C"... and so on.

i would like to write down : ABCDEFG... and so on.

how should i write the response.write syntax (using for next)?

*surely it's not like this :
for x = 1 to 26
     response.write var_x
next

pls help...
thx for any kind of help... would appreciate it very much :D
 
Old June 12th, 2007, 10:06 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Put the values in an array and loop through the array??

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
 
Old June 13th, 2007, 02:21 AM
Registered User
 
Join Date: Apr 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thx very much.

It works perfectly... :D

 
Old June 20th, 2007, 06:22 PM
Authorized User
 
Join Date: Jun 2007
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Tiahvera,

 I face problem like you. Can you show me the way to write?


apple
 
Old June 20th, 2007, 06:34 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

This will do.
Dim arr(3)

arr(0) = "1"
arr(1) = "2"
arr(2) = "3"
arr(3) = "4"

For Each item in arr
  Response.Write(item & "<br />")
Next

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
 
Old June 20th, 2007, 06:52 PM
Authorized User
 
Join Date: Jun 2007
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

dparson,

Hi, Nice to meet you. Just want to ask you do u do before limit quantity in ASP? I have problem like this:

How to do comparison limit item quantity 100 with database?

For example:

noofitem = ("SELECT SUM(*)FROM table1 where Typeofrequest = @Typeofrequest and Name=@name and DateRequire = getdate() group by Typeofrequest")

if noofitem <= 100 Then

else

Response.write("Error! 100 items only can key in!")

sql = ("INSERT INTO table1 ( Name, Typeofrequest, Noofitem,Description, Priority, DateRequire) VALUES ('"& request.form("name") &"','"& request.form("typeofrequest") &"','"& request.form("typeofrequest.noofitem") &"','"& request.form("description") &"','"& request.form("status") &"','"& request.form("date") &"')")

end if

1. First of all i want let user key in untill 100 item. If compare less than 100 item, then SQL insert will proceed. If not the msgbox exist to block database insert information.

2. My problem is exist Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'noofitem'

Thanks.

apple



apple
 
Old June 20th, 2007, 09:24 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Try this:

If CInt(noofitem) <= 100 Then
....

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
Response.Write doesn't work? Ron Howerton Pro JSP 1 March 27th, 2007 02:03 AM
Response.Write won't work? Ron Howerton JSP Basics 1 March 23rd, 2007 07:39 AM
response.write crmpicco Classic ASP Basics 1 January 27th, 2005 06:31 PM
response.write netcrawler Classic ASP Databases 4 September 29th, 2004 10:13 AM
Response.write Sach Classic ASP Components 5 March 19th, 2004 06:40 AM





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