- Doors CS 'AnsStack' Feature Completed
- 28 Jul 2010 07:01:05 pm
- Last edited by KermMartian on 28 Jul 2010 10:32:23 pm; edited 1 time in total
A few users suggested that Doors CS contain functions for a stack-type feature. It was originally suggested that it let you push and pop the value of Ans for real and complex numbers. I had originally put it off, but since I've more or less completed the major features and bug-fixes of Doors CS as of DCS 6.8 beta, I figured I might as well implement the Ans stack. It took me somewhere between 300 and 400 bytes, and supports the following variable types:
:: Real Number
:: Complex Number
:: Real List
:: Complex List
:: String
:: Real Matrix
Unfortunately, there's no _CreateTempCMat ROMcall that I could find in any published documentation, so I didn't allow complex matrices. Enjoy this demo code and screenshot of pushing and popping all the different allowable data types.
Note that as per the DCSBLibVersion (sum(5)) routine, only DCSB versions 3 and higher have sum(14) and sum(15) (PushAnsStack and PopAnsStack, respectively).
:: Real Number
:: Complex Number
:: Real List
:: Complex List
:: String
:: Real Matrix
Unfortunately, there's no _CreateTempCMat ROMcall that I could find in any published documentation, so I didn't allow complex matrices. Enjoy this demo code and screenshot of pushing and popping all the different allowable data types.
BASIC Code wrote:
:[[1,100
:sum(14
:{1,3,9
:sum(14
:{1i,1+3i,1.1+9.4i
:sum(14
:"TESTING...
:sum(14
:133337
:sum(14
:"CPLX ^, REAL v
:sum(14
:123+88.9i
:sum(14
:44444444
:For(X,1,7
:sum(15
:Disp Ans
:End
Generated by SourceCoder, © 2005-2010 Cemetech
:sum(14
:{1,3,9
:sum(14
:{1i,1+3i,1.1+9.4i
:sum(14
:"TESTING...
:sum(14
:133337
:sum(14
:"CPLX ^, REAL v
:sum(14
:123+88.9i
:sum(14
:44444444
:For(X,1,7
:sum(15
:Disp Ans
:End
Generated by SourceCoder, © 2005-2010 Cemetech
Note that as per the DCSBLibVersion (sum(5)) routine, only DCSB versions 3 and higher have sum(14) and sum(15) (PushAnsStack and PopAnsStack, respectively).