@%="+F8.6"
Bryan (8467) 468 posts |
I have a BASIC program which used to compile when it had statements like @%=&1020608 Recently, I discoved @%=“+F8.6” and changed all of the many different instances to the string format, which all worked perectly under interpretation and were/are much easier to understand when reading the code. But, now it won’t compile (an obvious Type Mismatch). What is the recommended way to solve this dilema? |
Rick Murray (539) 13851 posts |
Note that ABC supports a version of BASIC as it was in the RISC OS 3.10 days. LOCAL quirks aside, it is woefully out of date compared to the BASIC interpreter itself. |
Bryan (8467) 468 posts |
I think I would describe this as a fudge rather than a quirk. I now know that despite the apparant attempt to assign a string to an integer variable, the end result is that @% finishes up with an integer value; as shown by. >@%="+F8.6" >PRINT ~@% 1020608 It looks like I am going to have to edit it all back to how it was with RISC OS Maybe, I should create some new constants >F8pt6=&1020608 >@%=+F8pt6 >PRINT ~@% 1020608 |
Colin Ferris (399) 1818 posts |
How about |
Grahame Parish (436) 481 posts |
I would have thought the EVAL was the problem here – it isn’t compilable, and Bryan’s original format is probably dealt with as an EVAL to be able to set an integer variable from a string. |
Colin Ferris (399) 1818 posts |
The ‘SYS Eval’ version doesn’t do everything -but can be very handy with the ABC compiler. |
Alan Adams (2486) 1149 posts |
Yes, this is a special case in BASIC. |
Bryan (8467) 468 posts |
It has been described here as a ‘quirk’ or a ‘special case’. My prefered option is still ‘fudge’. I will be changing the code to use the canstants decribed above |
Steve Drain (222) 1620 posts |
Do not bother with ABC, perhaps. ;-)
Yes it is. The string form was introduced as ANSI printf comparable. It is really simple to make |