Thread Closed 
Reading one or two arguments
03-14-2021, 10:54 AM
Post: #4
RE: Reading one or two arguments
(03-13-2021 08:40 PM)essen Wrote:  If your calculator settings are in RPL mode, then a program can read stack values
with Ans(N). Where N is the stack number. This work in RPL mode only. The RPL mode
on the Prime is humbug. So if your are going continue with Prime, I strongly advice you to set it in Algebraic mode, if not buying a dedicated RPL calculator. Input to your Prime program when it is in algebraic mode should be done programmatically via the Input() function. Read up on this command in help.

The TYPE() and type() functions are unreliable to use. Because, they change as
the wind blows. Not only changes from shifting CAS/HOME, but also changes in
interaction with other functions in a program. And sometimes it spits out some
numbers and names than given in the help menu. For example, if your program
expects 0 for a float number, it sometimes give you a name; DOM_FLOAT.
Do this, EVAL(TYPE(MyARG)). By this a type name gets evaluated to a number.
This will ease type decision making in the program.

I' m trying out this calculator myself. It's a failure

Hi Essen,

to start with your last comment: I could not agree more, loosing the RPL programming functionality as on the 48GX makes this calculator near to useless for my kind of work. I bought the calculator anticipating it would again be a major improvement over previous models, but it is not. A fancy back-lit colour display is the last thing I need in a calculator, and also one may wonder if it is truly useful to have multiple ways operating the calculator itself (RPN, Home, CAS), while a high power consumption (compared to the 48GX) in combination with an battery-pack behind a lid-with-screws instead of standard AAA-batteries, is not very helpful for those who use it in the field. To me it seems that the Prime was designed by a young generation programmers with no connection to the past and oblivious of one of the major (if not the largest) user groups: the surveyors (at least here in the Netherlands that is).

Thanks for the input method using Ans(). I found it yesterday on another thread as well and meanwhile implemented it, that at least works for me.

I found out that the TYPE() command is quite buggy. Yesterday it kept on returning 3 (complex type), regardless the item I put on the stack. Only after I cleared the stack it started working properly again. I will add the EVAL() command to it, thanks for that suggestion!

Using INPUT() may not work for me. The program I am trying to replicate takes the result of previous calculations from the stack. These results are either X/Y coordinates or distance/direction pairs, at times as separate arguments and otherwise as complex types. With north being 0 degrees, I use them as (Y,X) and (dist,dir). I can add them easily in whatever combination and order, but at times either one of the two arguments of a pair needs modification. For that I need to split the complex type into separate elements, do further calculations on either one or both of them, and recombine them to a complex type to add them to another complex type. So the program I need does nothing else than splitting and combining. If I understand well, using INPUT will give me an input field where I have to enter the argument(s) manually instead of taking them from the stack (but I could be wrong there as the 48GX could retrieve from the stack, but it does add several keystrokes again).

Another nuisance is how polar complex types are dealt with. If I split a vector in the 48GX, the resulting arguments depended on the polar setting of the calculator. The Prime does not have a split function and has another way of showing complex types (i.e. each complex type on the stack has its own display mode). I believe there is no general polar setting and splitting the complex seems only be possible using IM(), RE(), ABS() and ARG(), which of course work independently from the polar setting for the complex type. So what I managed so far is to return a space-separated string containing all these four arguments. But now I have to remove the quotes around it to get them on my stack as separate arguments before I can use them again in further calculations, quite cumbersome. Using my 48GX I needed only three keystrokes to split a vector, with the prime the complex is split with no less than 10 keystrokes, despite my little program.

Another nuisance is that if I assign my program to a user key, that key will only place the text of my program (i.e. MyProg) on the command line, after which I have to press ENTER to get it executed. It seems impossible to execute it straight away, or am I missing something?

Once again I totally agree with you that this instrument is a total failure (compared to the 48GX).

Anyway, thanks for you help, that is much appreciated!

Nicolàs
Find all posts by this user
Thread Closed 


Messages In This Thread
Reading one or two arguments - HillyBoy - 03-13-2021, 04:18 PM
RE: Reading one or two arguments - essen - 03-13-2021, 08:40 PM
RE: Reading one or two arguments - HillyBoy - 03-14-2021 10:54 AM
RE: Reading one or two arguments - Han - 03-14-2021, 05:20 AM
RE: Reading one or two arguments - essen - 03-14-2021, 11:54 AM
RE: Reading one or two arguments - essen - 03-14-2021, 10:08 PM
RE: Reading one or two arguments - essen - 03-15-2021, 12:27 PM
RE: Reading one or two arguments - essen - 03-16-2021, 09:00 PM
RE: Reading one or two arguments - Gene - 03-17-2021, 08:55 PM



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