home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 1766
Discussions: 188,403, Posts: 2,243,609, Members: 232,631
Old August 10th, 2004, 07:17 PM   Digg it!   #1 (permalink)
Junior Member
 
Join Date: Aug 2004
Posts: 6
Question
Checking Exsistance of a Variable?

Is is possible to check the exsistance of a variable?

I am wanting to use checkboxes in a form, but I know that if it is not checked then the variable is not even created. Is there anyway to see if a variable was created or not?

mindytruitt is offline   Reply With Quote
Old August 10th, 2004, 07:20 PM     #2 (permalink)
Kawaru wa yo!
 
Whir's Avatar
 
Join Date: Oct 2001
Location: Kingsford, MI
Posts: 16,137
Blog Entries: 7
With what language?

SOP would be to initialize the variable to empty, or 0, and then set it to something else when a selection is made. Then you simply check to see if the variable is empty or 0, and if it's not, you continue with the process.

Whir is online now   Reply With Quote
Old August 10th, 2004, 07:50 PM     #3 (permalink)
Ultimate Member
 
Join Date: Oct 2001
Posts: 21,026
IMO it sounds like poor coding.
Typically its best to declare your variables right at the top.

If you're working in VB, then make sure to put 'Option Explicit' at the top of the module. This will require ALL variables to be declared. Then for your conditional you'll check the value of it as Whir noted above.

vass0922 is offline   Reply With Quote
Old August 11th, 2004, 05:40 AM     #4 (permalink)
may contain mild peril
 
SpookyEddy's Avatar
 
Join Date: Oct 2001
Location: UK
Posts: 3,329
As suggested it would probably be easiest to just use a boolean and initialise it to the default state of the checkbox. You can then toggle its value as you see fit and just check its state when required.

Regards

ed
SpookyEddy is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may post new threads
You may 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
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
to all those who know about dragon ball, z, gt and of course af DarkOracleII General Gaming Discussion 11 May 11th, 2004 09:55 AM
Script Variables Ruler2112 Linux and Unix 5 November 4th, 2003 02:42 PM
Code Investigation vass0922 Webmastering and Programming 14 December 11th, 2002 06:53 PM
Coding practices I HATE!!! Jüš† ä gü¥ Webmastering and Programming 21 October 26th, 2002 02:00 PM
batch file confusion vass0922 Applications and Operating Systems 17 September 22nd, 2002 09:41 PM

Most Active Discussions
Is It Just Me? (2906)
Unarmed man on his stomach shot by .. (6)
Misery Loves Company... (2144)
New Build ( Finally ) (7)
CPU wont boot (7)
Building a gaming computer advice (5)
I think I just killed my computer w.. (24)
RCA 52Inch HDTV wont turn on (5)
Folderchat Weekday thread (444)
Recent Discussions
Please help! multiple problems! (4)
How to transfer music from iPod.. (0)
How to upload your videos to bl.. (0)
RCA 52Inch HDTV wont turn on (5)
New Build ( Finally ) (7)
Common Spyware Solutions (97)
How do you move a hard-drive to.. (4)
Laptop proccesor to desktop mob.. (1)
What is the best external enclo.. (0)
Blackberry Storm, Gears of War .. (1)
Core 2 Quad Q9550 system (3)
COWBOOM Ripoff! Used Laptop w/$.. (4)


All times are GMT -4. The time now is 03:55 AM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28