Name that calculator - from the program listing...
|
11-12-2018, 08:00 AM
(This post was last modified: 11-12-2018 08:25 AM by Ángel Martin.)
Post: #6
|
|||
|
|||
RE: Name that calculator - from the program listing...
(11-12-2018 12:43 AM)Sylvain Cote Wrote: Another jewel from Ángel the magician! You're all correct - but let's not set up expectations too high though: - These extensions will be released in a forthcoming revision of the Formula_Evaluation Module, revision 1G. - At the heart of the implementation lies the EVAL? function (which actually is a FOCAL routine, if you need to know). Both WHILE and IF perform some housekeeping with the RTN addresses, foreseeing both a TRUE and a FALSE contingency, and then launch EVAL? for a Boolean evaluation of the test condition stated in ALPHA. Depending on the result the RTN addresses are re-arranged so the program flow responds to the desired scheme. - DO/WHILE supports up to three levels of nested calls, but IF.ELSE.ENDIF currently does not. However, it's possible to have and IF.ELSE.ENDIF structure within a DO/WHILE loop; and vice-versa. Here's a couple of examples to whet you appetite (BTW, the mathematicians out there can provide some real-life application to try?) The code below increments the value in Y until reaching 10, which (showing off the most inefficient way to do it) is tested using the value of its decimal LOG. This shows that the test condition can be *anything* supported by EVAL? Code: 01 LBL "YLO10" The next example shows the Fibonacci numbers between 1 and 100: Code: 01 LBL "FIB$" Exciting times in the ASDL, a.k.a "Archeological Software Development Lab ;-) ÁM "To live or die by your own sword one must first learn to wield it aptly." |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)