Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherProgramming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old February 2nd, 2006, 11:14 AM
slackerJr slackerJr is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2006
Posts: 3 slackerJr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 39 sec
Reputation Power: 0
Variabel declared in ASP

Hi!

How can I check if a variabel is declared or not in classic ASP?

Thank you!

Reply With Quote
  #2  
Old February 2nd, 2006, 11:30 AM
mehere's Avatar
mehere mehere is offline
Senior Sarcasm Wizardess
Click here for more information.
 
Join Date: Feb 2005
Location: Dreamland
Posts: 12,867 mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)mehere User rank is General 12nd Grade (Above 100000 Reputation Level)  Folding Points: 10976 Folding Title: Novice Folder
Time spent in forums: 4 Months 4 Weeks 15 h 20 m 54 sec
Reputation Power: 1762
have <%option explicit%> at the top of your ASP page ... then if you use a variable without first using this type of statement 'DIM your_Variable' ... it will tell you that variable is undefined.
__________________
Come JOIN the party!!!

Quote of the Month:
Retirement: Because you've given so much of yourself to the company that you don't have anything left we can use.

Questions to Ponder:
What do you do when you see an endangered animal eating an endangered plant?

iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm")
copyright© 2008 sbenj69

Reply With Quote
  #3  
Old February 2nd, 2006, 11:36 AM
slackerJr slackerJr is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2006
Posts: 3 slackerJr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 39 sec
Reputation Power: 0
Quote:
Originally Posted by mehere
have <%option explicit%> at the top of your ASP page ... then if you use a variable without first using this type of statement 'DIM your_Variable' ... it will tell you that variable is undefined.


Thank you for your quick reply.

What I want to do is something like:

if isDeclared(variableName) then
...
else
...
end if

Is there some easy way I can do that?

Reply With Quote
  #4  
Old February 2nd, 2006, 11:40 AM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,776 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 8 h 27 m 42 sec
Reputation Power: 470
No, the Option Explicit statement requires that all variables be declared before using them.

There isn't anything like an "IsDeclared" function in ASP.

Reply With Quote
  #5  
Old February 2nd, 2006, 04:33 PM
slackerJr slackerJr is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2006
Posts: 3 slackerJr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 39 sec
Reputation Power: 0
Well, thank you anyway, I'll find out some other way to do it.

Reply With Quote
Reply

Viewing: ASP Free ForumsOtherProgramming Help > Variabel declared in ASP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT