Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.acorn.programmer > #5755

Re: Font problem

Newsgroups comp.sys.acorn.programmer
Date 2019-05-14 21:10 -0700
References <003219b257.Alan.Adams@ArmX6.adamshome.org.uk> <57b27c5a25Paul@sprie.nl> <e52928b357.Alan.Adams@ArmX6.adamshome.org.uk>
Message-ID <101d047b-eaea-4a5a-8955-bc6e52ad7eac@googlegroups.com> (permalink)
Subject Re: Font problem
From jgh@mdfs.net

Show all headers | View raw


> Partly because about a year I replaced all CLOSE# calls with a function 
> call which checked the handle for zero, closed it if non-zero, and set it 
> to zero.

A function call? How do you do that?

DEFFNclose(chn%)
IF chn%<>0 THEN CLOSE#chn%:chn%=0
=some_return_value

....won't do what you expect as it only changes the *local* value of
chn%.

DEFFNclose(chn%)
IF chn%<>0 THEN CLOSE#chn%
=0

...with handle%=FNclose(handle%) would do it, though I tend to code
it inline explictly as: IF hnd%:CLOSE#hnd%:hnd%=0 

However, with the magic of passing-by-reference:

DEFPROCclose(RETURN chn%)
IF chn%:CLOSE#chn%:chn%=0
ENDPROC

would work, giving you PROCclose(handle%). I'd go further and do:

DEFPROCclose(RETURN chn%)
LOCAL tmp%
IF chn%:tmp%=chn%:chn%=0:CLOSE#tmp%
ENDPROC

...so if an error occurs in the CLOSE#, the handle has already been
zeroed, so won't cause an attempt to reclose it.

Back to comp.sys.acorn.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Font problem Alan Adams <alan@adamshome.org.uk> - 2019-05-10 19:25 +0100
  Re: Font problem Alan Adams <alan@adamshome.org.uk> - 2019-05-10 19:35 +0100
    Re: Font problem Alan Adams <alan@adamshome.org.uk> - 2019-05-10 20:19 +0100
  Re: Font problem Matthew Phillips <spam2011m@yahoo.co.uk> - 2019-05-10 21:21 +0100
  Re: Font problem Harriet Bazley <harriet@bazleyfamily.co.uk> - 2019-05-11 01:20 +0100
  Re: Font problem Paul Sprangers <Paul@sprie.nl> - 2019-05-11 14:28 +0200
    Re: Font problem Alan Adams <alan@adamshome.org.uk> - 2019-05-12 20:44 +0100
      Re: Font problem Martin Wuerthner <spamtrap@mw-software.com> - 2019-05-13 19:43 +0200
        Re: Font problem Alan Adams <alan@adamshome.org.uk> - 2019-05-13 21:54 +0100
        Re: Font problem Alan Adams <alan@adamshome.org.uk> - 2019-05-14 11:57 +0100
      Re: Font problem jgh@mdfs.net - 2019-05-14 21:10 -0700
        Re: Font problem Alan Adams <alan@adamshome.org.uk> - 2019-05-15 10:11 +0100

csiph-web