 |
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
|
|
|

June 14th, 2004, 04:59 AM
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
getting asp variables dynamically
how do i get asp variables dynamically in asp? (without hardcoding)
thnks!
|

June 14th, 2004, 05:34 AM
|
Friend of Wrox
|
|
Join Date: Jun 2004
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
What do u mean by <b>asp variables dynamically in asp? </B> make it clear
Love 4 all
|

June 14th, 2004, 05:38 AM
|
Friend of Wrox
|
|
Join Date: Oct 2003
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Do you mean that you need more and more variables when you run through a loop etc. ? You can then use an array if the associated value is of normal data types (string / number).
If you want to use a series of objects, I think you cannot do it in ASP. A change in design may be needed.
|

June 14th, 2004, 12:24 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Hi Macro_1,
Can you explain that a little more?
Cheers!
_________________________
-Vijay G
 Strive for Perfection 
|

June 14th, 2004, 01:31 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 217
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hmm. Something like:
varVariable = Request("var1)
eval Execute(varVariable & "=" & varValue)
I need to look into it. I'll get back to you...
- mega
|

June 14th, 2004, 01:38 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 217
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Jep, this works..
Code:
<%
For i=1 To 30
Eval Execute("varVariable" & i & " = " & i)
Response.Write(varVariable&i & "<br>")
Next
%>
Just out of curiosity, what are you gonna use it for?
- mega
|

June 14th, 2004, 09:44 PM
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
quote:Originally posted by marco_1
how do i get asp variables dynamically in asp? (without hardcoding)
thnks!
|
sorry guys for not explaining it, i mean, how do i get asp variables (w/c are defined using Dim) dynamically without hardcoding it, i need it together w/ the server variables for error tracking if the page fails. thnks
-marco
|

June 15th, 2004, 12:18 AM
|
Friend of Wrox
|
|
Join Date: Jun 2004
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Still confusing explain that why u want to use them and with declaring variable one can how do this ?
Love 4 all
|

June 15th, 2004, 12:30 AM
|
Friend of Wrox
|
|
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
|
|
how do i get asp variables (w/c are defined using Dim) dynamically without hardcoding it, i need it together w/ the server variables for error tracking if the page fails.
If i am correct, then are u talking about arrays? For the second part, do u want to navigate through forms collection?
Om Prakash
|

June 15th, 2004, 12:46 AM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
|
|
I think what Marco is asking is to store all the variable information be it a variable in the page, session variable or request.
So if the page fails he still has all the information?
Is this correct Marco.
If so, I don't think there is a way to loop through variables you create on the page.
You can only do your best to ensure that nothing on the page will cause an error to make the page fail. And failures other than that caused in code would prevent the saving of any variable at all at any rate.
======================================
They say, best men are moulded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
|
|
 |