Re: Font_DecodeMenu



On 15 Jun, Ste (news) wrote in message
<51e3e527c5steve@xxxxxxxxxxxxxxx>:

In article <mpro.lmuj8p02zu8sw01cg.news@xxxxxxxxxxxxxxxxxx>,
Steve Fryatt <news@xxxxxxxxxxxxxxxxxx> wrote:

1. Preferring, for reasons of non-hack to do something like

I think saying it's a 'hack' to use a deliberate, documented feature of
the BASIC SYS statement is probably pushing it.

Some people use OS_IntOn rather than XOS_GenerateError. I'm not sure which
is fastest or best. There's only one way to find out. Fight!

I think the 'hack' concern comes from the fact that it's not what
XOS_GenerateError is supposed to be used for. It works at present, but
there's always the worry that this might change (although I'm now of the
opinion that this usage is common enough that no-one sane would change the
way the X-form operates).

[snip]

DEF FNread_string(string%)
LOCAL string$

string$ = ""

The above is not required; BASIC initialises local variables for you.

True... The example was written off the top of my head for that post, and I
don't seem to think in BASIC these days.

WHILE ?string% <> 0

Why would you ever bother with the "<> 0" part? It's as pointless as LET.

See above: I'm not (personally) a fan of writing stuff like "while (ptr)"
when what's meant is "while (ptr != NULL)", and as such I would write the
above as "while (*ptr != '\0')" instead of "while (*ptr)" and let the
compiler worry about things.

In BASIC there may be advantages to being terse; I still prefer clarity,
though. :-)

--
Steve Fryatt - Leeds, England

http://www.stevefryatt.org.uk/
.