Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,39 +1,20 @@
|
|||
/*REXX program shows how to assign an empty string, & then check for empty/not-empty str*/
|
||||
-- 8 Nov 2025
|
||||
include Setting
|
||||
|
||||
/*─────────────── 3 simple ways to assign an empty string to a variable.*/
|
||||
auk='' /*uses two single quotes (also called apostrophes); easier to peruse. */
|
||||
ide="" /*uses two quotes, sometimes called a double quote. */
|
||||
doe= /*··· nothing at all (which in this case, a null value is assigned. */
|
||||
say 'EMPTY STRING'
|
||||
say version
|
||||
say
|
||||
a=''; b='string'
|
||||
if a='' then
|
||||
say 'a is empty'
|
||||
if length(a)=0 then
|
||||
say 'a is empty'
|
||||
if b<>'' then
|
||||
say 'b is not empty'
|
||||
if \(b='') then
|
||||
say 'b is not empty'
|
||||
if length(b)>0 then
|
||||
say 'b is not empty'
|
||||
exit
|
||||
|
||||
/*─────────────── assigning multiple null values to vars, 2 methods are:*/
|
||||
parse var doe emu pug yak nit moa owl pas jay koi ern ewe fae gar hob
|
||||
|
||||
/*where emu, pug, yak, ··· (and the rest) are all set to a null value.*/
|
||||
|
||||
/*───or─── (with less clutter ─── or more, depending on your perception)*/
|
||||
parse value 0 with . ant ape ant imp fly tui paa elo dab cub bat ayu
|
||||
/*where the value of zero is skipped, and the rest are set to null,*/
|
||||
/*which is the next value AFTER the 0 (zero): nothing (or a null).*/
|
||||
|
||||
/*─────────────── how to check that a string is empty, several methods: */
|
||||
if cat=='' then say "the feline is not here."
|
||||
if pig=="" then say 'no ham today.'
|
||||
if length(gnu)==0 then say "the wildebeest's stomach is empty and hungry."
|
||||
if length(ips)=0 then say "checking with == instead of = is faster"
|
||||
if length(hub)<1 then method = "this is rather obtuse, don't do as I do ···"
|
||||
|
||||
nit='' /*assign an empty string to a lice egg.*/
|
||||
if cow==nit then say 'the cow has no milk today.'
|
||||
|
||||
/*─────────────── how to check that a string isn't empty, several ways: */
|
||||
if dog\=='' then say "the dogs are out!"
|
||||
/*most REXXes support the ¬ character. */
|
||||
if fox¬=='' then say "and the fox is in the henhouse."
|
||||
if length(rat)>0 then say "the rat is singing" /*an obscure-ish (or ugly) way to test.*/
|
||||
|
||||
if elk=='' then nop; else say "long way obtuse for an elk to be tested."
|
||||
|
||||
if length(eel)\==0 then fish=eel /*a fast compare (than below), & quick.*/
|
||||
if length(cod)\=0 then fish=cod /*a not-as-fast compare. */
|
||||
|
||||
/*────────────────────────── anyway, as they say: "choose your poison." */
|
||||
include Abend
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue