NULL in variable defined AS STRING
Iwan AB <[email protected]> Mon, 28 Apr 2025 14:08:36 +0700
| Newsgroups | gmane.comp.lang.4gl.aubit.general |
|---|---|
| Message-ID | <CAHJCSmK8AF7EyL=o8A5R=4bp7OJaqwd1T6c+Z6YK8sHNrnPL3g@mail.gmail.com> |
--===============7530742210706330332==
Content-Type: multipart/alternative; boundary="000000000000e1102a0633d15ad1"
--000000000000e1102a0633d15ad1
Content-Type: text/plain; charset="UTF-8"
Dear Mike, please consider the following code:
MAIN
DEFINE s1 STRING, s2 CHAR(100)
LET s1 = NULL
IF s1 IS NULL THEN
DISPLAY "s1 IS NULL!"
ELSE
DISPLAY "s1 IS NOT NULL!"
END IF
LET s2 = 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
--000000000000e1102a0633d15ad1
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Dear Mike, please consider the following code: <br><br>MAI=
N<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 N=
ULL THEN<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 DISPLAY "s2 IS NULL!"<br>=
=C2=A0 =C2=A0 ELSE<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 DISPLAY "s2 IS NOT N=
ULL!"<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>Best regards,</d=
iv><div><br></div><div>Iwan Abu Bakar</div></div>
--000000000000e1102a0633d15ad1--
--===============7530742210706330332==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
--===============7530742210706330332==
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
--===============7530742210706330332==--