Set System Variable in a program
|
02-27-2015, 05:56 AM
Post: #1
|
|||
|
|||
Set System Variable in a program
Apparently I am stuck again and need help....
When in RPN I can change Base Variable as follows: 2 'Base' ► The only question I have HERE is why 2 is still resident on the stack. Is Base being evaluated after storing and can I turn that off? However in a program I encountered serious difficulties with the above. Part of my user keyboard is the following Code:
What I tried to do is set Base to the corresponding value in CASE1..3 instead of the 'base_active' variable. I just can't get it to work... Is it too simple to see atm? So can anybody help here? I remember someone (was it TW?) explained a non-cas program being executed in home Mode. So if you are able to store it in HOME, a program should be, too. Tahnk you very much suggestion: RETURN(30) at the end of a program seems to be still broken. I can't imagine why the people at HP don't see the beauty and the need of having something like above evaluated instantly, but returning ENTER would be, if working, a way to try. |
|||
02-27-2015, 06:37 AM
Post: #2
|
|||
|
|||
RE: Set System Variable in a program
By doing
2 'Base' ► you store the value 2 in the variable 'Base'. When you store a value in a variable it will remain on the stack, this is a normal behavior in RPN. reto |
|||
02-27-2015, 07:22 AM
(This post was last modified: 02-27-2015 07:24 AM by Angus.)
Post: #3
|
|||
|
|||
RE: Set System Variable in a program
yes, but since there are no stack commands (afaik) like drop I was wondering if it could be avoided. At least when the programming issues are solved I expect that to be the next problem otherwise. ;-) In the case of my Program I could avoid that, but I want to get to a level where I am the master of my calculator.
|
|||
02-27-2015, 07:31 AM
(This post was last modified: 02-27-2015 07:32 AM by Didier Lachieze.)
Post: #4
|
|||
|
|||
RE: Set System Variable in a program
In programming mode you cannot use RPN notation, so instead of:
Code: IF btn=4 THEN 3 'Base' ► ; Code: IF btn=4 THEN Base:=3; |
|||
02-27-2015, 07:59 AM
Post: #5
|
|||
|
|||
RE: Set System Variable in a program | |||
02-27-2015, 08:42 AM
Post: #6
|
|||
|
|||
RE: Set System Variable in a program
I didn't know that ja can mix non-rpn assignments. Wenn invoking functions their rpn notation is needed. Like with r->b(). I will dig into that, thanks.
Well, backspace acts as drop, however the main questin is about programming. I was initially under the impression that I have to use rpn notation for assignments (calling functions do) which would result in 2 on the stack. Then I would have needed a drop() command. Not a key. If assignments can ideed be done in the a:=b notation that would be no issue. |
|||
02-27-2015, 11:14 AM
(This post was last modified: 02-27-2015 11:41 AM by Angus.)
Post: #7
|
|||
|
|||
RE: Set System Variable in a program
Thanks a lot so far. Your information about Variable assignment was indeed helpful. I could change my Key to the following which pretty much satifies my needs. Only two points are left on my wishlist:
1) as mentioned numerous times before: getting rid of the needed keystroke <ENTER>. Having the returned String passed to the parser by a new command or RETURN(30) working. :-) (Although you could see a positive aspect: If I just want to change the current Base setting I could e.g. hit F2 and abort. Base has changed and no conversion happens. As said if I try to see a positive side-effect) 2) Activate the Softkey permanently. When I need Integer Base conversions I would like to have my Softkey at hand. The F-Keys in Home are more or less useless anyway. Further ideas and comments are always welcome! See screenshot about what I have in mind. Code:
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)