News
Forums
Search
Members
Sign Up
My Code Newbie
Username
Password
Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET
C.N. Friends
Planet Rome
Link to Us!
Code Newbie
Code Forums
>
Application and Web Development
>
MS Technologies ( ASP, VB, C#, .NET )
ASP N00b - How to check if a variable is set? or empty?
User Name
Remember Me?
Password
Register
FAQ
Calendar
Search
Today's Posts
Mark Forums Read
LinkBack
Thread Tools
Display Modes
10-29-2004, 02:26 PM
#
1
(
permalink
)
helz
Registered User
Join Date: May 2004
Posts: 5
ASP N00b - How to check if a variable is set? or empty?
hi, ive just recently started with ASP and was wondering what/if there is a way to see if a variable has been set. Either that or to check if a variable is empty?
thanks for any replies
helz
View Public Profile
Find More Posts by helz
11-04-2004, 05:27 AM
#
2
(
permalink
)
rdove
Masked Moderator
Join Date: May 2002
Location: Indianapolis, IN
Posts: 260
You could do:
Code:
If var = "" Or IsNull(var) Then 'Do Something End If
__________________
~Ryan
rdove
View Public Profile
Find More Posts by rdove
11-04-2004, 06:00 AM
#
3
(
permalink
)
helz
Registered User
Join Date: May 2004
Posts: 5
is:
var = ""
the same as:
isEmpty(var)??
helz
View Public Profile
Find More Posts by helz
11-04-2004, 10:19 AM
#
4
(
permalink
)
rdove
Masked Moderator
Join Date: May 2002
Location: Indianapolis, IN
Posts: 260
no
var = "" is closer to IsNull(var), but not the same.
IsEmpty is completely different.
var = ""
IsEmpty(var) - returns false
and
var = Empty
IsEmpty(var) - returns true
and
Dim var
IsEmpty(var) - returns true
IsEmpty:
http://msdn.microsoft.com/library/de...fctisempty.asp
IsNull:
http://msdn.microsoft.com/library/de...sfctisnull.asp
All vbscript functions:
http://msdn.microsoft.com/library/de...ifunctions.asp
__________________
~Ryan
rdove
View Public Profile
Find More Posts by rdove
Bookmarks
Digg
del.icio.us
StumbleUpon
Google
«
Previous Thread
|
Next Thread
»
Thread Tools
Show Printable Version
Email this Page
Display Modes
Linear Mode
Switch to Hybrid Mode
Switch to Threaded Mode
Posting Rules
You
may not
post new threads
You
may not
post replies
You
may not
post attachments
You
may not
edit your posts
BB code
is
On
Smilies
are
On
[IMG]
code is
Off
HTML code is
Off
Trackbacks
are
On
Pingbacks
are
On
Refbacks
are
On
Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
OpenGL.dll
Mr.Anderson
Platform/API C++
3
08-13-2004
10:07 AM
check if session variable is null?
sde
Java
3
07-07-2004
12:27 PM
All times are GMT -8. The time now is
04:01 AM
.
Contact Us
-
CodeNewbie.com
-
Archive
-
Top
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by
vBSEO
3.0.0 RC8
Copyright © 2000-2008,
Milano Interactive
Web Hosting provided by
Portal 360 Web Hosting
LinkBack
LinkBack URL
About LinkBacks