Post Reply 
HP 50g - Storing local variables while branching???
03-05-2018, 09:52 PM (This post was last modified: 03-05-2018 09:52 PM by Carsen.)
Post: #1
HP 50g - Storing local variables while branching???
Hello all:

While working on a 50g UserRPL program that allows me to calculate days between two dates based on either a 365 day basis or 30/360 day basis, I stumbled across a problem. I cannot store local variables in my IF...THEN...ELSE...END branching. You can see that this issue happened when I tried to store mm1, dd1, yy1, mm2, dd2, & yy2. Here's the incomplete program...

<< -> DT1 DT2 << "Day-Count Convention" { { "Actual Day Basis" 1 } { "30/360 Day Basis" 0 } } 1 CHOOSE NOT IF THEN DT1 DT2 ELSE IF THEN DT1 DT2 DDAYS ELSE DT1 DUP IP SWAP FP 100 * DUP IP SWAP FP 10000 * DT2 DUP IP SWAP FP 100 * DUP IP SWAP FP 10000 * IF -42 FC? THEN -> mm1 dd1 yy1 mm2 dd2 yy2 ELSE -> dd1 mm1 yy1 dd2 mm2 yy2 END END END >> >> ***The bold area is my problem right now***

The 50g will highlight one of the program containers at the end of the program (i.e the [ >> ]) and reply with "INVALID SYNTAX". Of course, when I remove the [ -> ] that's before the mm1 dd1 yy1...etc. The syntax error goes away.

May anyone help me out here a little bit. I've been resolving this issue to the point of sheer frustration. Plus I would like to understand why this isn't working. With my understanding, it should work but it doesn't. Thank you

-Carsen
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP 50g - Storing local variables while branching??? - Carsen - 03-05-2018 09:52 PM



User(s) browsing this thread: 1 Guest(s)