Thread Closed 
Reading one or two arguments
03-14-2021, 10:57 AM
Post: #5
RE: Reading one or two arguments
(03-14-2021 05:20 AM)Han Wrote:  Create a wrapper program that handles the number of arguments. In RPN mode, your program would be called with something like PROG(2) where the 2 here denotes the number of arguments to take from the stack and PROG is the name of your program. The 2 would be changed accordingly. In "Home" mode you would then then separate programs for each scenario (i.e. for each set of arguments: none, 1, 2, 3, etc.). However, if you want a single program to handle any number you would need to create a wrapper program that checks the number of arguments and then based on the arguments. This can be done using the "CAS" mode, which assumes that all input separated by a comma (or whatever separation symbol you use) is a vector/list.

Hi Han,

thanks for that suggestion, it may provide a solution to the export. I wonder if it is possible to detect the display mode of a complex number, because that would be really helpful to limit the output (i.e. only output IM() and RE() when the complex is shown in normal mode and export ABS() and ARG() when it is in polar mode).

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 - Han - 03-14-2021, 05:20 AM
RE: Reading one or two arguments - HillyBoy - 03-14-2021 10:57 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)