Post Reply 
Program works in real, not virtual
12-06-2021, 07:32 AM
Post: #1
Program works in real, not virtual
Helo

I have written a short program:

EXPORT ElM1(n,f1,f2)
BEGIN
LOCAL m1;
rowSwap(IDENMAT(n),f1,f2)▶m1;
RETURN m1;
END;

And it works in the real calculator (ROM 2.1.14597) changing the rows of a Identity matrix, but gives me error in the virtual one (ROM 2.1.14592):
"rowSwap(IDENMAT(n),f1,f2) Error: Bad Argument Type"

Do you heve some idea how to solve this small error?

Thanks very much

Toni
Find all posts by this user
Quote this message in a reply
12-06-2021, 04:23 PM
Post: #2
RE: Program works in real, not virtual
For me your program runs from Home fine but fails when run from CAS. See C.Ret's answer here:

https://www.hpmuseum.org/forum/thread-17790.html

I think it's the same issue.

-road
Find all posts by this user
Quote this message in a reply
12-07-2021, 09:33 AM
Post: #3
RE: Program works in real, not virtual
Thanks very much for your answer.

In my real calculator it works both modes: CAS and HOME.
But you are right in the virtual one, it works in HOME and not in CAS.


There are some things that still do not understand in the thread you suggest:
I have changed to
EXPORT ElM1(n,f1,f2)
BEGIN
LOCAL m1;
RETURN rowSwap(IDENMAT(n),f1,f2);
END;

And still gives me the same error in CAS

Well at least works in virtual-HOME and in any mode in real.

Thanks

Toni


Attached File(s) Thumbnail(s)
       
Find all posts by this user
Quote this message in a reply
12-07-2021, 03:29 PM
Post: #4
RE: Program works in real, not virtual
Try this:

EXPORT ElM1(n,f1,f2)
BEGIN
LOCAL m1;
RETURN CAS(EVAL("rowSwap(IDENMAT("+n+"),"+f1+","+f2));
END;

On the emulator works for me in CAS and Home.

-road
Find all posts by this user
Quote this message in a reply
12-07-2021, 05:53 PM
Post: #5
RE: Program works in real, not virtual
Helo

Thanks very much for your ideas.

It works, both (HOME and CAS) on the virtual calculator.

If this is useful for other programs, and you heve some doc on this, please let me know.
If not, I will just try with this ideas.

Thanks again

Toni
Find all posts by this user
Quote this message in a reply
12-07-2021, 07:10 PM
Post: #6
RE: Program works in real, not virtual
The only document I know of on running CAS commands from PPL other than the users manual is here:

https://www.hpmuseum.org/forum/attachment.php?aid=3547

It may be somewhat outdated with with the current update though. Generally, if you want to run a CAS command from a PPL program you have to use this format:

CAS(EVAL("a string exactly like what you would type on the CAS command line"))

I don't think that's always required so you have to experiment to find the best method for any particular application.

-road
Find all posts by this user
Quote this message in a reply
12-08-2021, 09:26 AM
Post: #7
RE: Program works in real, not virtual
Very interesting

I will try

Thanks very much
Find all posts by this user
Quote this message in a reply
Post Reply 




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