Newbie Questions
|
01-08-2014, 11:05 AM
(This post was last modified: 01-08-2014 11:25 AM by The Shadow.)
Post: #1
|
|||
|
|||
Newbie Questions
Hello, I'm a HP calc user from way back. Can't afford the physical Prime just now, but I've been messing around a fair bit with the emulator... and in the process have gathered some questions.
1. Is there any way for a program to return more than one value to the stack in RPN entry mode? I'm not seeing one, but maybe I'm missing it. If not, a suggestion might be to add two new commands: One to turn the RPN stack into a list, and vice versa. Then it would be easy to add as many things to the list as you like, then transform it. Or even just re-add the DEPTH, ->LIST, and LIST-> commands. (A version of EXPR that works nicely with RPN would be wonderful too, but let's not get too greedy. :) 2. Is there any way to retrieve the number of arguments a program is expecting? 3. Is there any equivalent for the old KEYEVAL command? (For those who might not know, it simulates the press of a particular key.) Key reassignment really comes into its own with this ability. 4. How would one go about storing a value in a variable name INPUT'ed by the user? Is this even possible? 5. How does one insert a line feed? I can't find it in the CHARS menu. There will probably be more later, but that'll do for now! Thanks in advance for your help. Oh, and I guess there's one more: 6. Any plans to make another calculator that's basically the 50g with the Prime hardware and the new Prime commands? 'Cause I will break the sound barrier ordering one if so. :) |
|||
01-08-2014, 02:46 PM
Post: #2
|
|||
|
|||
RE: Newbie Questions
I can answer a couple of questions:
1. The best way to return multiple answers is to use a list or vector. Example: RETURN [A,B,C...]; RETURN {A,B,C...}; Not sure about 2 and 3. 4. Using the INPUT command will automatically store the value. So INPUT(A); will prompt for A and store its value in A. 5. Good question regarding the line feed, I can't find it either. |
|||
01-08-2014, 03:53 PM
Post: #3
|
|||
|
|||
RE: Newbie Questions
(01-08-2014 11:05 AM)The Shadow Wrote: 3. Is there any equivalent for the old KEYEVAL command? (For those who might not know, it simulates the press of a particular key.) Key reassignment really comes into its own with this ability.Any example when you need this? The scripts are pretty "sandboxed" in my opinion so I don't think there is a direct way (you can call views and other things) (01-08-2014 11:05 AM)The Shadow Wrote: 5. How does one insert a line feed? I can't find it in the CHARS menu. Code: char(10) example Code: msgbox("hello"+char(10)+"cruel world"); (01-08-2014 11:05 AM)The Shadow Wrote: There will probably be more later, but that'll do for now! Thanks in advance for your help. Oh, and I guess there's one more:I think this might happen with the current device, if is "rooted" some day. My website: ried.cl |
|||
01-08-2014, 04:45 PM
Post: #4
|
|||
|
|||
RE: Newbie Questions
Thank you both for taking the time to reply!
(01-08-2014 02:46 PM)Eddie W. Shore Wrote: I can answer a couple of questions: Granted, but I meant put A, B, and C on separate levels of the stack. There doesn't seem to be any way to take a list apart, RPN-style. Quote:4. Using the INPUT command will automatically store the value. So INPUT(A); will prompt for A and store its value in A. I guess I didn't make myself clear. I meant being able to store a value in a variable specified by the user. So a program could store a value in MyNewVariable, named by the user on the spot. eried Wrote:Any example when you need this? The scripts are pretty "sandboxed" in my opinion so I don't think there is a direct way (you can call views and other things) I'd like to be able to create key reassignments that, for example, activate when the key is held down for half a second, or with another key held down simultaneously, while leaving its ordinary behavior unchanged. I use this *all the time* on my 50g, it's made it immensely more functional. Quote:char(10) Thank you! Quote:I think this might happen with the current device, if is "rooted" some day. I sincerely hope you are right! Though the keyboard will still leave a lot to be desired, IMO - the more so if repurposed as a "51g". I'll gladly live with it, though! |
|||
01-08-2014, 05:04 PM
Post: #5
|
|||
|
|||
RE: Newbie Questions
The problem is that PPL programming does not support RPN stack operations and RPN is only available in Home view, where direct keystroke programming is not available. To me the Prime is more akin to an HP 71B than one of the RPL calculators like the HP 50g. The Prime is basically designed to be an algebraic entry type machine with very limited RPN capabilities, and that's how I am using mine. Like you, I'd love to see an updated HP 51g with an improved backlit screen and better keyboard.
|
|||
01-08-2014, 05:48 PM
Post: #6
|
|||
|
|||
RE: Newbie Questions
(01-08-2014 05:04 PM)Michael de Estrada Wrote: The problem is that PPL programming does not support RPN stack operations and RPN is only available in Home view, where direct keystroke programming is not available. Right now, it appears to be so, yes. But give me the ability to make lists from the stack and vice versa, and I can recreate a large chunk of those operations right now. |
|||
01-08-2014, 08:05 PM
Post: #7
|
|||
|
|||
RE: Newbie Questions
The Prime is an open device, as shown by the fact modified firmware upgrades just work ( http://tiplanet.org/hpwiki/index.php?tit...ware_files , http://tiplanet.org/forum/viewtopic.php?...29&lang=en - maybe replacing armfir.elf embedded into the FAT16 filesystem would just work ?), so it's bound to be rooted
As a newcomer to the HP community (I'm an old-timer of the TI community, where people are definitely interested in low-level tinkering with calculators), it's quite disappointing to see the HP community showing so little love to the powerful Prime... That can be explained by facts such as the low number of Prime calculators in users' hands, and the wide availability of devices even more open, much more powerful, and cheaper than the Prime - but still, it's currently the most powerful calculator on the market, it's an open platform, and it's virgin territory, perfect for tinkerers Although it took years, and despite the fact that the hardware is undocumented (no public datasheet), Linux was eventually ported to the Nspire. Another page of TI-Planet's hpwiki contains links to Linux and QEMU-based emulators which support the same SoC as the one used by the prime. |
|||
01-08-2014, 08:22 PM
Post: #8
|
|||
|
|||
RE: Newbie Questions
(01-08-2014 05:48 PM)The Shadow Wrote:(01-08-2014 05:04 PM)Michael de Estrada Wrote: The problem is that PPL programming does not support RPN stack operations and RPN is only available in Home view, where direct keystroke programming is not available. If you are really inclined, you think can re-implement RPN using the user keyboard and writing your own display routine. Everything else can be saved in lists. If you want a key-press to be handled by the built-in system routines, then just have your custom keys return the key-value that you wish the system to evaluate. Graph 3D | QPI | SolveSys |
|||
01-08-2014, 11:29 PM
Post: #9
|
|||
|
|||
RE: Newbie Questions
(01-08-2014 08:22 PM)Han Wrote: If you are really inclined, you think can re-implement RPN using the user keyboard and writing your own display routine. Everything else can be saved in lists. I've actually thought about it, though it would be a huge project. I can already see how to do the directories and variables. What I can't figure out is how to refresh the display while still handling keypresses. See below. Quote:If you want a key-press to be handled by the built-in system routines, then just have your custom keys return the key-value that you wish the system to evaluate. This was one of my questions in the first post - I'm not clear on how to do this exact thing. |
|||
01-11-2014, 02:57 AM
Post: #10
|
|||
|
|||
RE: Newbie Questions
Okay, I'm feeling really stupid here, but I keep seeing references to "CAS programs" and don't know what they are. I know what CAS commands are, but the programs are clearly something beyond just PPL programs that use the commands.
Judging by the PDQ program, they use a slightly different syntax, for one. And when I tried entering it in the program editor, it threw errors. So what am I missing here, and how can I find out more? |
|||
01-11-2014, 03:46 AM
Post: #11
|
|||
|
|||
RE: Newbie Questions
There are some good posts by Joe Horn about his a while back. Just search the archives.
You can create a dummy CAS program by entering some like this in CAS view g(x):=x^2 Then, g shows up in the program catalog as a CAS program. Now, you can edit this dummy program by inserting a BEGIN and END; statement (x) -> BEGIN //your code here (assuming you want to pass along one parameter, but you can change that as well) END; That's it in a nutshell. |
|||
01-11-2014, 03:57 AM
Post: #12
|
|||
|
|||
RE: Newbie Questions
(01-11-2014 03:46 AM)Helge Gabert Wrote: There are some good posts by Joe Horn about his a while back. Just search the archives. The confusing part is that it shows up in CAS on Home view in the Vars CAS Vars menu, rather than in the Toolbox CAS menu, even though it is a program/function, not a variable. |
|||
01-11-2014, 04:06 AM
Post: #13
|
|||
|
|||
RE: Newbie Questions
I agree, I also think that is confusing. But it does show up in the Vars CAS Program menu!
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)