Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: ztrumpet on September 22, 2010, 05:00:51 pm
-
I've noticed that there are people that don't know how to use the input command, myself included. Does anyone care to explain how to use input? Thanks. :)
input - Prompts for an input string just like BASIC then returns a pointer to the string structure. Don't forget, its a string of tokens, not characters.
-
well, this is how to Disp-lay the inputted text:
input->P .store the pointer to the inputdata to var P
Disp P
you could also check the length or whatever, because the text will be stored to the pointer returned by the input command. I'm not sure where this is exactly, and the last time I heard something about it, Quigibo didn't know it either.
.check length of inputdata to save screen to appvar with user-defined name:
Lbl IPT
input->P .get the input for the name
length(P)->L .get the length of the name
If L > 8 .check the length of the name
Disp "TOO LONG NAME!"
Goto IPT
End
Copy(P,L5+1,8) .copy the name to L5
Copy("appv",L5,1) .set the appv token in front of the name
GetCalc(L5,768)->V .create a new appvar
Copy(L6,V,768) .copy screen data to appvar
i hope you'll understand it a little more right now, and correct me if I'm wrong (which I don't think, but I know I'm good at making mistakes somtimes :P)
-
I think we should make a page devoted only to screenshots of how to do certain commands. such as input. or displaying b as a number, and other things like that.
-
well, I think this is a very good idea! let's call it the Axe Commands Catalog :P
-
You should never use copy with only one byte:
Copy("appv",L5,1)
More simply, just do:
E15->{L5}
Which is the actual value of the appv token.
-
well, this is how to Disp-lay the inputted text:
input->P .store the pointer to the inputdata to var P
Disp P
you could also check the length or whatever, because the text will be stored to the pointer returned by the input command. I'm not sure where this is exactly, and the last time I heard something about it, Quigibo didn't know it either.
.check length of inputdata to save screen to appvar with user-defined name:
Lbl IPT
input->P .get the input for the name
length(P)->L .get the length of the name
If L > 8 .check the length of the name
Disp "TOO LONG NAME!"
Goto IPT
End
Copy(P,L5+1,8) .copy the name to L5
Copy("appv",L5,1) .set the appv token in front of the name
GetCalc(L5,768)->V .create a new appvar
Copy(L6,V,768) .copy screen data to appvar
i hope you'll understand it a little more right now, and correct me if I'm wrong (which I don't think, but I know I'm good at making mistakes somtimes :P)
The input command is a string of tokens, not characters. For this reason, you shouldn't simply Disp-lay input as in your first example. Additionally, trying to create an appvar with GetCalc() using a string of tokens for the name is bound to have undesirable results if the user enters any non-alphanumeric tokens.
-
Well, the uppercase characters and numbers luckily have the same token and ascii values (which might be fine for this purpose), but everything else I wouldn't count on.
-
i know this isn't an explanation of the input command (i haven't used it very often myself), but here's a snippet of code that may be of interest. it reads a 2-character long string, converts it to a number and stores it into variable A. note that the only values this will work with is 0 - 99.
{input}^r->A/256-48*10*(A>255)+(A^256-48)->A
-
Just wondering: Where does the input command store to?
-
I found a method:
:"Str1"=>Str1
:input=>A //now you can disp A everywhere
:lenght(A)=>L
:If L<9
:GetCalc(Str1,8)=>T
:Copy(L5,T,8)
:Archive Str1
:End
Why archive? Because always program crash attend the end (only at the end !)
So we can use input command.
-
The input command for me corrupts everything. :P
Junk output shows up if I ever use it... :(
-
When I use the Input command on 2.43, it works as I expected. When I use it on 2.53, the cursor scrolls vertically and when I press enter, it crashes. Is there something we're supposed to do before input in 2.53?
-
The cursor scrolling vertically sounds like the cursor is located outside the bounds of the screen. Did you try putting ClrHome before Input?
-
Now it displays some tokens before the cursor, and I can use input but the tokens stay there. It doesn't crash though.
-
Now it displays some tokens before the cursor, and I can use input but the tokens stay there. It doesn't crash though.
Quigibo is working on this; I've had the same problem.
-
When I use the Input command on 2.43, it works as I expected. When I use it on 2.53, the cursor scrolls vertically and when I press enter, it crashes. Is there something we're supposed to do before input in 2.53?
solution: change from mathprint to classic in options.
-
When I use the Input command on 2.43, it works as I expected. When I use it on 2.53, the cursor scrolls vertically and when I press enter, it crashes. Is there something we're supposed to do before input in 2.53?
solution: change from mathprint to classic in options.
Sounds like the problem is already fixed:
Now it displays some tokens before the cursor, and I can use input but the tokens stay there. It doesn't crash though.
Anyway, bump:
Just wondering: Where does the input command store to?