Re: NULL in variable defined AS STRING
Iwan AB <[email protected]> Sat, 10 May 2025 15:42:05 +0700
| Newsgroups | gmane.comp.lang.4gl.aubit.general |
|---|---|
| Message-ID | <CAHJCSmJWd=cZO2N1xTxmgZ0YpkrfBHQsVuf3U-ciXJfrO0hG5Q@mail.gmail.com> |
--===============1419588907030751360==
Content-Type: multipart/alternative; boundary="00000000000066200a0634c40fc9"
--00000000000066200a0634c40fc9
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
here for example:
DATABASE db
MAIN
DEFINE w_data STRING, w_kd_data CHAR(2)
DECLARE cur1 CURSOR FOR
SELECT kd_data, data FROM t_data
FOREACH cur1 INTO w_kd_data, w_data
DISPLAY w_kd_data, " =3D> ", w_data
END FOREACH
END MAIN
output:
01 =3D>
02 =3D>
03 =3D>
...
On Sat, May 10, 2025 at 2:34=E2=80=AFPM Mike Aubury <[email protected]> wrote:
> Whats the issue on foreach/fetch ?
> Any chance of a small worked example ?
>
> On Sat, 10 May 2025 at 05:39, Iwan AB <[email protected]> wrote:
>
>> Hi Mike, thanks for adding NULL support for STRINGs, it helps us a lot.
>> Tested and it's working, but can not be applied to FOREACH/FETCH.
>>
>> Regards,
>>
>> Iwan
>>
>> On Mon, Apr 28, 2025 at 2:08=E2=80=AFPM Iwan AB <[email protected]> wrote=
:
>>
>>> Dear Mike, please consider the following code:
>>>
>>> MAIN
>>> DEFINE s1 STRING, s2 CHAR(100)
>>>
>>> LET s1 =3D NULL
>>> IF s1 IS NULL THEN
>>> DISPLAY "s1 IS NULL!"
>>> ELSE
>>> DISPLAY "s1 IS NOT NULL!"
>>> END IF
>>>
>>> LET s2 =3D NULL
>>> IF s2 IS NULL THEN
>>> DISPLAY "s2 IS NULL!"
>>> ELSE
>>> DISPLAY "s2 IS NOT NULL!"
>>> END IF
>>>
>>> END MAIN
>>>
>>> it displays s1 IS NOT NULL! and s2 IS NULL, why is that?
>>>
>>> Best regards,
>>>
>>> Iwan Abu Bakar
>>>
>> _______________________________________________
>> Aubit4gl-discuss mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss
>>
>
--00000000000066200a0634c40fc9
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">here for example:<div><br></div><div>DATABASE db<br>MAIN<b=
r>=C2=A0 =C2=A0 DEFINE =C2=A0w_data STRING, w_kd_data CHAR(2)<br><br>=C2=A0=
=C2=A0 DECLARE cur1 CURSOR FOR<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 SELECT kd_da=
ta, data FROM t_data<br><br>=C2=A0 =C2=A0 FOREACH cur1 INTO w_kd_data, w_da=
ta<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 DISPLAY w_kd_data, " =3D> ",=
w_data<br>=C2=A0 =C2=A0 END FOREACH<br><br>END MAIN</div><div><br></div><d=
iv>output:</div><div>01 =3D></div><div>02 =3D></div><div>03 =3D></=
div><div>...</div></div><br><div class=3D"gmail_quote gmail_quote_container=
"><div dir=3D"ltr" class=3D"gmail_attr">On Sat, May 10, 2025 at 2:34=E2=80=
=AFPM Mike Aubury <<a href=3D"mailto:[email protected]">[email protected]</a>&=
gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0=
px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div =
dir=3D"ltr">Whats the issue on foreach/fetch ?<br>Any chance of a small wor=
ked example ?</div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D=
"gmail_attr">On Sat, 10 May 2025 at 05:39, Iwan AB <<a href=3D"mailto:iw=
[email protected]" target=3D"_blank">[email protected]</a>> wrote:<br></div>=
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr">Hi=C2=A0=
Mike, thanks for=C2=A0<span style=3D"color:rgb(51,51,51);font-family:Lato,s=
ans-serif;font-size:14px">adding NULL support for STRINGs, it helps us a lo=
t. Tested and it's working, but can not be applied to FOREACH/FETCH.=C2=
=A0</span><div><span style=3D"color:rgb(51,51,51);font-family:Lato,sans-ser=
if;font-size:14px"><br></span></div><div><span style=3D"color:rgb(51,51,51)=
;font-family:Lato,sans-serif;font-size:14px">Regards,</span></div><div><spa=
n style=3D"color:rgb(51,51,51);font-family:Lato,sans-serif;font-size:14px">=
<br></span></div><div><span style=3D"color:rgb(51,51,51);font-family:Lato,s=
ans-serif;font-size:14px">Iwan</span></div></div><br><div class=3D"gmail_qu=
ote"><div dir=3D"ltr" class=3D"gmail_attr">On Mon, Apr 28, 2025 at 2:08=E2=
=80=AFPM Iwan AB <<a href=3D"mailto:[email protected]" target=3D"_blank">=
[email protected]</a>> wrote:<br></div><blockquote class=3D"gmail_quote" =
style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pa=
dding-left:1ex"><div dir=3D"ltr">Dear Mike, please consider the following c=
ode: <br><br>MAIN<br>=C2=A0 =C2=A0 DEFINE =C2=A0s1 STRING, s2 CHAR(100)<br>=
<br>=C2=A0 =C2=A0 LET s1 =3D NULL<br>=C2=A0 =C2=A0 IF s1 IS NULL THEN<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 DISPLAY "s1 IS NULL!"<br>=C2=A0 =C2=
=A0 ELSE<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 DISPLAY "s1 IS NOT NULL!"=
<br>=C2=A0 =C2=A0 END IF<br><br>=C2=A0 =C2=A0 LET s2 =3D NULL<br>=C2=A0 =C2=
=A0 IF s2 IS NULL THEN<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 DISPLAY "s2 IS N=
ULL!"<br>=C2=A0 =C2=A0 ELSE<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 DISPLAY &qu=
ot;s2 IS NOT NULL!"<br>=C2=A0 =C2=A0 END IF<br><br>END MAIN<br><br>it =
displays s1 IS NOT NULL! and s2 IS NULL, why is that?<div><br></div><div>Be=
st regards,</div><div><br></div><div>Iwan Abu Bakar</div></div>
</blockquote></div>
_______________________________________________<br>
Aubit4gl-discuss mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank"=
>[email protected]</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss" r=
el=3D"noreferrer" target=3D"_blank">https://lists.sourceforge.net/lists/lis=
tinfo/aubit4gl-discuss</a><br>
</blockquote></div>
</blockquote></div>
--00000000000066200a0634c40fc9--
--===============1419588907030751360==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
--===============1419588907030751360==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Aubit4gl-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss
--===============1419588907030751360==--