Help me with HP50g -DOSUBS !
|
03-21-2014, 09:21 AM
Post: #1
|
|||
|
|||
Help me with HP50g -DOSUBS !
I started programming in RPN with the HP33E (1974) and continued up to the HP41C.
When I bought the new HP50G I encountered a lot of problems to understand the UserRPN: manuals are not exhaustive ! But the worst came with the command DOSUBS: I really cannot understand how it works: Is there any gentle soul who can write a @comment after every line of the “explanatory example” programs of the RPN Programming manual (!) ? Example 1: { A B C D E } « - » DOSUBS returns { 'A-B' 'B-C' 'C-D' 'D-E' }. Example 2: { A B C } 2 « DUP * * » DOSUBS returns { 'A*(B*B)' 'B*(C*C)' }. Example 3: Entering: { 1 2 3 4 5 } « → a b « CASE 'NSUB==1' THEN a END 'NSUB==ENDSUB' THEN b END 'a+b' EVAL END » » DOSUBS returns { 1 5 7 5 } |
|||
03-21-2014, 12:05 PM
(This post was last modified: 03-21-2014 12:05 PM by Dalil.)
Post: #2
|
|||
|
|||
RE: Help me with HP50g -DOSUBS !
Hello,
Code: { A B C D E } @ list of element on which the command will be applied What happens is: the command requires 2 arguments (number1 - number2), so for each iteration, the DOSUBS push 2 items onto the stack. What happens at the stack level is, step by step is: Code: 1st iteration before operation: |1st iteration after operation: at this point all items in the list have been used, the resulting list is constructed and output, i.e. the output is Code: {'A-B' 'B-C' 'C-D' 'D-E'} Code: Example 2: Something similar to the previous example happens at the stack level. Code: Example 3: Entering: |
|||
03-21-2014, 05:21 PM
Post: #3
|
|||
|
|||
RE: Help me with HP50g -DOSUBS !
nowhere is written that DOSUBS puts the arguments it needs on the stack !
Now I can go on ! Grazie mille (Thanks a lot !) Carlo |
|||
03-21-2014, 06:32 PM
Post: #4
|
|||
|
|||
RE: Help me with HP50g -DOSUBS !
(03-21-2014 05:21 PM)carlovan Wrote: nowhere is written that DOSUBS puts the arguments it needs on the stack ! You should get yourself an HP-48G/GX manual instead: http://h10032.www1.hp.com/ctg/Manual/c00442262.pdf (See page 17-5) Gerson. |
|||
03-23-2014, 10:19 AM
Post: #5
|
|||
|
|||
RE: Help me with HP50g -DOSUBS !
Your help has been useful!
Those who write the HP manuals must be convinced that people who read them is becoming more and more clever, so progressively are shrinking the explanations ! In the next manual, the explanation of the DOSUBS command will be: "guess how it works" ! |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)