How do I write a program with optional arguments? I know that in java i can write two different programs with the exact same name but with different number or type of arguments and java knows which one to run based on what arguments are passed. I tried that on my ti89 and it won't let me create a program with the same file name. Specifically, I would like to make a more robust version of the gcd and lcm commands that can take any number of arguments, or a list, or a matrix. Any help would be appreciated.
thats called overloading. i dont think calculators can do it. not being much of a ti89 person, might i suggest using string inputs, so the user can input a blank space or something, and you can check for it?
Visit Calccrypto for info on crypto
Sadly, the calculator can only accept specific-type overloads, meaning you (the coder) must know what type Ans or whatever will be. However, there is a way that you can pseudo-overload by asking the user certain information beforehand (almost like referencing variables). Say you need a string and an integer in your program. Like calccrypto said, you can input each item into a specific variable for use in your sub-program. You can load a certain way by using Ans. I.e.,
If Ans=1:Then //Load maybe a string and an int End If Ans=2:Then //Load two ints End etc.
Projects: BexIDE (hold), Hadean.NET, Legend of Zelda: Link to the Future