::: Area #157 (comp.sys.acorn.programmer)Message: #39995 (Read 4 times, has 0 replies, 1508 bytes)Date   : Thu Feb 18 01:45:42 1999From   : Jonathan Graham Harston of fidonet#2:254/27Subject: BBC BASIC float size (reply to #39936)> Message-ID: <19990216.000103.13@cheesey.demon.co.uk>Markus Huber wrote:> How can I get the information of the BBC BASIC float variable size? (5> or 8 bytes) I am in hope for an official solution.I presume you mean how can a running program find out the size of thefloats it is using, and 'look in the manual' is not the required answer...8)Rik Griffin wrote:> Here's a nasty idea:> DIM a% 8> FOR l%=0 TO 7 STEP4:a%!l%=-1:NEXTVery nasty, as by the time l% is 6, it will overwrite memory past the endof the reserved space, filling a%?6, a%?7, a%?8 and a%?9.Try:REM FNSizeOfRealREM ------------REM Returns the size of real variables being used by the programREM Currently only knows about 5-byte and 8-byte realsREM Causes 8-byte memory leak on every callREM Basic V onwards only (use of |):DEFFNSizeOfReal  LOCAL A%  DIM A% 7         :REM Reserve 8 bytes of memory  A%!0=-1          :REM Fill all 8 bytes with &FF  A%!4=-1  |A%=0            :REM Fill either first 5 bytes or 8 bytes with &00IFA%?5=0:=8 ELSE =5--J.G.Harston (JGH BBC PD Library) 70 Camm Street, Walkley, SHEFFIELD S6 3TRjgh@arcade.demon.co.uk - Running on BBCs & Masters with SJ MDFS FileServerZ80+6502/CoPro+Tubes/Econet+SJ -- http://www.libdems.force9.co.uk/usr/jgh/--- ARCbbs RISC OS [1.64á32c] * Origin: Via The Arcade BBS Usenet News Gateway +44 181 655 4412 (2:254/27)