Author Topic: The input Command  (Read 9679 times)

0 Members and 1 Guest are viewing this topic.

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
The input Command
« 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. :)

Quote
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.
« Last Edit: September 22, 2010, 05:01:04 pm by ztrumpet »

Offline LordConiupiter

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 339
  • Rating: +3/-0
  • Just one of the thousands of Axe-fans...
    • View Profile
Re: The input Command
« Reply #1 on: September 22, 2010, 05:19:03 pm »
well, this is how to Disp-lay the inputted text:

Code: [Select]
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.

Code: (Axe) [Select]
.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)
« Last Edit: September 22, 2010, 05:19:52 pm by LordConiupiter »
everytime that I was down, you would always come around, and get my feedback on the ground. (modified part from 'Seasons in the sun')

No matter how many errors are bothering you, always try to stay rel-Axe!

The HoMM project will be resumed as soon Axe 1.0.0 will be released!
Projects:
Code: [Select]
HoMM:   [==--------]    Project 'resumed': I'm suffering overwhelming new ideas being popped up in my dreams :P
tiDE:   [----------]    Explored and understood the main part of the code: just started writing a Tokenizer.



password of the week: uvanapererubupa (Any pronunciation is the right one ;) )   :D click me, and you'll be raided :D

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: The input Command
« Reply #2 on: September 22, 2010, 05:38:39 pm »
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.
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline LordConiupiter

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 339
  • Rating: +3/-0
  • Just one of the thousands of Axe-fans...
    • View Profile
Re: The input Command
« Reply #3 on: September 22, 2010, 06:03:36 pm »
well, I think this is a very good idea! let's call it the Axe Commands Catalog :P
everytime that I was down, you would always come around, and get my feedback on the ground. (modified part from 'Seasons in the sun')

No matter how many errors are bothering you, always try to stay rel-Axe!

The HoMM project will be resumed as soon Axe 1.0.0 will be released!
Projects:
Code: [Select]
HoMM:   [==--------]    Project 'resumed': I'm suffering overwhelming new ideas being popped up in my dreams :P
tiDE:   [----------]    Explored and understood the main part of the code: just started writing a Tokenizer.



password of the week: uvanapererubupa (Any pronunciation is the right one ;) )   :D click me, and you'll be raided :D

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: The input Command
« Reply #4 on: September 22, 2010, 06:19:33 pm »
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.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: The input Command
« Reply #5 on: September 22, 2010, 06:49:01 pm »
well, this is how to Disp-lay the inputted text:

Code: [Select]
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.

Code: (Axe) [Select]
.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.
« Last Edit: September 22, 2010, 06:53:36 pm by Runer112 »

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: The input Command
« Reply #6 on: September 22, 2010, 06:55:11 pm »
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.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: The input Command
« Reply #7 on: September 22, 2010, 06:59:06 pm »
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.

Code: [Select]
{input}^r->A/256-48*10*(A>255)+(A^256-48)->A


Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: The input Command
« Reply #8 on: September 23, 2010, 02:30:27 pm »
Just wondering: Where does the input command store to?




Offline kindermoumoute

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 836
  • Rating: +54/-3
    • View Profile
Re: The input Command
« Reply #9 on: September 23, 2010, 04:06:15 pm »
 I found a method:
Code: [Select]
:"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.
Projects :

Worms armageddon z80 :
- smoothscrolling Pixelmapping : 100%
- Map editor : 80%
- Game System : 0%

Tutoriel français sur l'Axe Parser
- 1ère partie : en ligne.
- 2ème partie : en ligne.
- 3ème partie : en ligne.
- 4ème partie : 10%
- Annexe : 100%

Offline alberthrocks

  • Moderator
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 876
  • Rating: +103/-10
    • View Profile
Re: The input Command
« Reply #10 on: September 25, 2010, 09:18:35 am »
The input command for me corrupts everything. :P
Junk output shows up if I ever use it... :(
Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/


Proud member of ClrHome!

Miss my old signature? Here it is!
Spoiler For Signature:
Alternate "New" IRC post notification bot (Newy) down? Go here to reset it! http://withg.org/albert/cpuhero/

Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/

Activity remains limited due to busyness from school et al. Sorry! :( Feel free to PM, email, or if you know me well enough, FB me if you have a question/concern. :)

Don't expect me to be online 24/7 until summer. Contact me via FB if you feel it's urgent.


Proud member of ClrHome!

Spoiler For "My Projects! :D":
Projects:

Computer/Web/IRC Projects:
C______c: 0% done (Doing planning and trying to not forget it :P)
A_____m: 40% done (Need to develop a sophisticated process queue, and a pretty web GUI)
AtomBot v3.0: 0% done (Planning stage, may do a litmus test of developer wants in the future)
IdeaFrenzy: 0% done (Planning and trying to not forget it :P)
wxWabbitemu: 40% done (NEED MOAR FEATURES :P)

Calculator Projects:
M__ C_____ (an A____ _____ clone): 0% done (Need to figure out physics and Axe)
C2I: 0% done (planning, checking the demand for it, and dreaming :P)

Offline Camdenmil

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 121
  • Rating: +4/-0
    • View Profile
Re: The input Command
« Reply #11 on: September 26, 2010, 10:07:25 pm »
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?
It is bad luck to be superstitious.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: The input Command
« Reply #12 on: September 26, 2010, 10:11:38 pm »
The cursor scrolling vertically sounds like the cursor is located outside the bounds of the screen. Did you try putting ClrHome before Input?
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Camdenmil

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 121
  • Rating: +4/-0
    • View Profile
Re: The input Command
« Reply #13 on: September 26, 2010, 10:26:38 pm »
Now it displays some tokens before the cursor, and I can use input but the tokens stay there. It doesn't crash though.
It is bad luck to be superstitious.

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: The input Command
« Reply #14 on: September 26, 2010, 10:27:44 pm »
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.
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.