Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: Link on January 14, 2013, 04:40:56 pm
-
I have been looking at the docs and needed to get a string as input. However I couldn't find a way to do so. Is there an easy way to get a whole string as the input in Axe? say the user inputs 8*7+6-5, I want all of that to be stored in Str0. How can I do this? (An Axiom is Fine)
-
I don't believe that there's any way to easily do that with axe.
I don't know about axioms, though
-
Here's a program ztrumpet made a while ago. It may or may not be what you are looking for, but it can be easily modified to fit your needs I think. :)
http://ourl.ca/4129/122465
-
Sweet, Thanks for the link, does it work on numbers? And symbols like pi, e etc?
Here's a pastebin btw: http://pastebin.com/VMrzDVQN
-
if you mean input to a string as in the OS variable, that is very possible. if you mean Str0 as it is used within Axe itself, that is not. Str0-9, Gdb0-9, and Pic0-9, as used in Axe, are not data structures that can be modified during runtime. rather, they are just pointers to locations in your program where data structures can be inserted at compile time. if you want to store temporary data, you need to either use one of the free ram areas or store it in an OS variable. for an in-depth explanation of exactly HOW to get that data from the keys and into your storage space, see the discussion that begins here (http://ourl.ca/17878/331051).
-
Essentially I mean I get a set of input from the user, put in a as a variable or "string" and do my manipulations in the program, and then when program exits it gets erased.
-
alrighty, then you'll have to manually interpret the key presses and dynamically display the current contents of the string as the user inputs his desired values. see the link i pasted above for more details.
-
You can get string input using the Axe input command and then convert it to ASCII using the Detokenize Axiom (http://ourl.ca/17834). The detokenize command is a bit large (about 115 bytes), but still smaller than a sophisticated input routine.
-
Sweet, thats pretty much perfect :D Thanks.
Edit: Question? Will the input routine return stuff such as say a () or [] or maybe pi, e and so on?
-
Axe's input lets the user enter any token. The user can get tokens from the Catalog, and they can even use 2nd+Rcl to recall strings.
-
But how do I use it? I called up #Axiom(DETOKENI) and then tried to run it with: Detokenize(K,Str0,768) but it says the command is undefined?
Never-mind, found the token, was typing in letters :p
-
Okay, Question, How do I use this in a loop?
input->K
Detokenize(K,L1,768)
Disp L1
I tried to get in a loop with a goto and label, but that kept crashing after one iteration, how do I go to the next start of the loop and get new input (on a new line after output) over and over again?
-
You shouldn't have any problem putting that in a loop. It's probably an issue with pointers or memory; for example, you might have code that depends on previous results which have been overwritten. It might be helpful for us to see the code you're trying. Perhaps we can spot a mistake.
(I'm not ruling out a bug in the Axiom, but if there is a bug, I need to know how to reproduce it.)