Usage of ISNULL function in Jbase

188 views
Skip to first unread message

Sankararam K

unread,
Jun 27, 2008, 5:50:55 AM6/27/08
to jB...@googlegroups.com
Hi all,
I was using isnull in Universe for checking null characters. What is its usage in Jbasic.
I used to use IF ISNULL(v.var) THEN. How to use the same in Jbasic.


Kind Regards
Sankararam

x

unread,
Jun 27, 2008, 11:34:47 AM6/27/08
to jBASE
IF v.var = "" THEN
That is nothing between quotes.

Tom Turkington

unread,
Jun 27, 2008, 1:01:51 PM6/27/08
to jB...@googlegroups.com
Or perhaps IF NOT(ASSIGNED(v.var)) ... I was curious re: the answer to
this, as I'm not sure what Universe defines as NULL... is it UNASSIGNED or
an empty string.

Tom @ Proco, Inc
800-867-7626 x4
t...@proman.com

Mark Hogden

unread,
Jun 27, 2008, 1:05:35 PM6/27/08
to jB...@googlegroups.com
ISNULL function
Syntax
ISNULL (variable)
Description
Use the ISNULL function to test whether a variable is the null value. If
variable is the null value, 1 (true) is returned, otherwise 0 (false) is
returned. This is the only way to test for the null value since the null
value is not equal to any value, including itself.
Example
X = @NULL
Y = @NULL.STR
PRINT ISNULL(X), ISNULL(Y)
This is the program output:
1 0

Jim Idle

unread,
Jun 27, 2008, 1:33:03 PM6/27/08
to jB...@googlegroups.com
On Fri, 2008-06-27 at 11:50 +0200, Sankararam K wrote:
Hi all,
I was using isnull in Universe for checking null characters. What is its usage in Jbasic.
I used to use IF ISNULL(v.var) THEN. How to use the same in Jbasic.

Actually, a better question is what YOU want this to mean. UniVerse has a very broken concept of NULL, which it introduced to try and deal with the semantics of SQL. Internally to Universe NULL has the value 0x80/CHAR(128), which represents a NULL concept. Hence the only use of this function is to check a value to see if it represents the SQL NULL concept in some application specific form (it is that last part of that statement that reveals why it was a dumb idea - NULL has a very specific formal meaning).

So, rather than tell you to use UNASSIGNED(), which won't do the same things as ISNULL(Var<5>), perhaps you could fill in a little more information about what you are really trying to achieve here? Other than for APIs or state-full initialization you should program not to have unassigned variables. NULL is of course a completely different concept.

Of course, some people think that programing to avoid unassigned variables, means turning off the "Variable unassigned - zero used. Debug>" message, but this has been talked about many times.

Jim

Mike Preece

unread,
Jul 1, 2008, 8:11:25 AM7/1/08
to jBASE


On Jun 27, 6:05 pm, "Mark Hogden" <m...@proman.com> wrote:
> ISNULL function
> Syntax
> ISNULL (variable)
> Description
> Use the ISNULL function to test whether a variable is the null value. If
> variable is the null value, 1 (true) is returned, otherwise 0 (false) is
> returned. This is the only way to test for the null value since the null
> value is not equal to any value, including itself.
> Example
> X = @NULL
> Y = @NULL.STR
> PRINT ISNULL(X), ISNULL(Y)
> This is the program output:
> 1 0
>

Are these @NULL and @NULL.STR system constants peculiar to a
particular emulation or something? They cause compilation errors on my
jBASE 5.0.3 system with Pr1me emulation.

>
>
> -----Original Message-----
> From: jB...@googlegroups.com [mailto:jB...@googlegroups.com] On Behalf Of
>
> Tom Turkington
> Sent: Friday, June 27, 2008 10:02 AM
> To: jB...@googlegroups.com
> Subject: RE: Usage of ISNULL function in Jbase
>
> Or perhaps IF NOT(ASSIGNED(v.var)) ...  I was curious re: the answer to
> this, as I'm not sure what Universe defines as NULL...  is it UNASSIGNED or
> an empty string.
>
> Tom @ Proco, Inc
> 800-867-7626 x4
> t...@proman.com
>
> -----Original Message-----
> From: jB...@googlegroups.com [mailto:jB...@googlegroups.com] On Behalf Of x
> Sent: Friday, June 27, 2008 8:35 AM
> To: jBASE
> Subject: Re: Usage of ISNULL function in Jbase
>
> IF v.var = "" THEN
> That is nothing between quotes.- Hide quoted text -
>
> - Show quoted text -

Jim Idle

unread,
Jul 1, 2008, 12:18:23 PM7/1/08
to jB...@googlegroups.com
On Tue, 2008-07-01 at 05:11 -0700, Mike Preece wrote:


On Jun 27, 6:05 pm, "Mark Hogden" <m...@proman.com> wrote:
> ISNULL function
> Syntax
> ISNULL (variable)
> Description
> Use the ISNULL function to test whether a variable is the null value. If
> variable is the null value, 1 (true) is returned, otherwise 0 (false) is
> returned. This is the only way to test for the null value since the null
> value is not equal to any value, including itself.
> Example
> X = @NULL
> Y = @NULL.STR
> PRINT ISNULL(X), ISNULL(Y)
> This is the program output:
> 1 0
>

Are these @NULL and @NULL.STR system constants peculiar to a
particular emulation or something? They cause compilation errors on my
jBASE 5.0.3 system with Pr1me emulation.

They are not supported by the jBASE compiler. Not because they could not be but because the whole NULL concept would have to be implemented. If that was going to be done then it would need to be done properly and the way UniVerse does that isn't a very good way in the first place.

Jim
Reply all
Reply to author
Forward
0 new messages