Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Dynamo variables "UNDEFINED"

3 posts in General Discussion (old) Last posting was on 2000-03-13 19:16:31.0Z
Dave Appleton Posted on 2000-03-11 09:12:32.0Z
Newsgroups: sybase.public.easerver
From: "Dave Appleton" <dave@calistra.com>
Subject: Dynamo variables "UNDEFINED"
Date: Sat, 11 Mar 2000 17:12:32 +0800
Lines: 67
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_0010_01BF8B7C.FCA74750"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
NNTP-Posting-Host: ad202.166.109.89.magix.com.sg 202.166.109.89
Message-ID: <347_vNV6vqzi$GA.202@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:26597
Article PK: 157603

we have a session variable session.user
 
whe we try to use it we check to see if it exists
 
exists(session.user)  returns true
session.user returns undefined
typeof(session.user) returns undefined
 
but we cannot check for 'undefined'
 
we can find no way to check for this condition...
 
if (session.user != "") does not seem to work either...
 
Any suggestions?


Michael F. Nicewarner [TeamSybase] Posted on 2000-03-13 19:16:31.0Z
Newsgroups: sybase.public.easerver
From: "Michael F. Nicewarner [TeamSybase]" <mike.nicewarner@ibpinc.com>
Subject: Re: Dynamo variables "UNDEFINED"
Date: Mon, 13 Mar 2000 13:16:31 -0600
Lines: 123
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_0038_01BF8CEE.591C3870"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
NNTP-Posting-Host: secure.ibpinc.com 198.133.192.2
Message-ID: <347_JIR#FFSj$GA.285@forums.sybase.com>
References: <347_vNV6vqzi$GA.202@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:26509
Article PK: 157523

Actually, you can use the typeof() function, just as you did in your post.
IF (typeof(session.user == 'undefined') or even better, if you want it to be a string, IF(typeof(session.user != 'string') then error...
I have used the typeof() function in a SWITCH block to behave differently depending on the datatype of the incoming parameter, and I have a default: to handle the undefined condition.  You almost have to use the typeof() function when dealing with HTML forms, since some of them like "multiple selects" return objects.
 
HTH.
 
--

Michael F. Nicewarner [TeamSybase]
mailto:mike.nicewarner@ibpinc.com
http://www.datamodel.org
 
 
Dave Appleton <dave@calistra.com> wrote in message news:vNV6vqzi$GA.202@forums.sybase.com...
we have a session variable session.user
 
whe we try to use it we check to see if it exists
 
exists(session.user)  returns true
session.user returns undefined
typeof(session.user) returns undefined
 
but we cannot check for 'undefined'
 
we can find no way to check for this condition...
 
if (session.user != "") does not seem to work either...
 
Any suggestions?


Roy Kiesler [TeamSybase] Posted on 2000-03-12 00:05:50.0Z
Newsgroups: sybase.public.easerver
From: "Roy Kiesler [TeamSybase]" <SPAM_FREE_rkiesler@noblestar.com>
Subject: Re: Dynamo variables "UNDEFINED"
Date: Sat, 11 Mar 2000 19:05:50 -0500
Lines: 90
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_0189_01BF8B8C.D0DA6840"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6700
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
NNTP-Posting-Host: user-2ive04v.dialup.mindspring.com 165.247.0.159
Message-ID: <347_eK2gkd7i$GA.202@forums.sybase.com>
References: <347_vNV6vqzi$GA.202@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:26582
Article PK: 157590

if ( session.user == "" + "undefined" )
{
    // this should do the trick
}
"Dave Appleton" <dave@calistra.com> wrote in message news:vNV6vqzi$GA.202@forums.sybase.com...
we have a session variable session.user
 
whe we try to use it we check to see if it exists
 
exists(session.user)  returns true
session.user returns undefined
typeof(session.user) returns undefined
 
but we cannot check for 'undefined'
 
we can find no way to check for this condition...
 
if (session.user != "") does not seem to work either...
 
Any suggestions?