[Gambas-user] no IF ... THEN ... ELSE ... in one line?
Rolf-Werner Eilert
eilert-sprachen at ...221...
Wed Oct 10 10:46:52 CEST 2012
Hi,
just stumbled over this one:
IF teil.Count > 1 THEN mesVon.Add(teil[1]) ELSE mesVon.Add("")
IF teil.Count > 2 THEN mesStatus.Add(teil[2]) ELSE mesStatus.Add("")
IF teil.count > 3 THEN mesPri.Add(teil[3]) ELSE mesPri.Add("")
IF teil.Count > 4 THEN mesRef.Add(teil[4]) ELSE mesRef.Add("")
IF teil.Count > 5 THEN mesText.Add(teil[5]) ELSE
mesText.Add("Fehler: Defekte Message-Datei")
Doesn't seem to be possible in Gambas, so I would have to write
IF teil.Count > 1 THEN
mesVon.Add(teil[1])
ELSE
mesVon.Add("")
END IF
for all of the above cases - a bit roundabout and not so well readable,
isn't it?
Regards
Rolf
More information about the User
mailing list