I have to agree with Jonathon on this one.
Why would you use let var = "" and expect it to return a null.
I always just LET var = NULL...
Of course I have to admit I have always worked in UNIX systems
(ULTRIX, AIX, HP-UX, System V, etc) but have never had a problem.
Rob Vorbroker
Am I missing something???
John Carlson <John_Carlson@whsmithusa.com> wrote in message
news:91t39d$5mm$1@news.xmission.com...
>
> What about returning a variable set to null . . . i.e.
>
> let p_rtn = 0
>
> if (condition) then
> let p_rtn = null
> end if
>
> return p_rtn
>
>
>
> Also, conversely on the function call . . . .
>
> let p_var1=1
> let p_var2="Test"
> let p_var3=null
>
> call my_funct(p_var1, p_var2, p_var3)
>
> John Carlson
> Informix Database Administrator
> EDS - WHSmith USA
> 3200 Windy Hill Road, Suite 1500 West
> Atlanta, GA 30330
>
>
>
>
> -----Original Message-----
> From: Andrew Hamm [mailto:ahamm@sanderson.net.au]
> Sent: Thursday, December 21, 2000 2:04 AM
> To: informix-list@iiug.org
> Subject: Re: 4gl and NULL integers with 7.30.UC1
>
>
> Jonathan Leffler wrote in message <3A415379.D76BA73C@informix.com>...
> >
> >Well, using the character string is a dubious way of writing NULL. I'm
> >not sure I approve of it at all.
> >
> Dubious or not, there are odd locations where you CANNOT use null. Try
this
> (don't know if 7.3X is fixed)
>
> return NULL
>
> and you get a stupid error message about NULL being an undefined variable.
>
> | The symbol "null" does not represent a defined variable.
> | See error number -4369.
>
> Function call is also bad news:
>
> call x(NULL)
>
> with the same compiler error result.
>
> There are one or two more situations (can't recall them off the top of my
> head, or the sides) where "" must be used instead of NULL, which is kinda
> irritating.
>
> Regardless of this, although it may rightly be called "dubious" it is
> nevertheless correct since 4GL (RDS or C) supports conversion of string to
> numeric, and thus any kinda null string should be correctly converted to
> it's equivalent null numeric.
>
> signed: Andrew "with the occasional dubious programming practice" Hamm.
>
>