Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: PickleMan on April 14, 2012, 07:51:49 am

Title: Isn't the 'input' function rather useless?
Post by: PickleMan on April 14, 2012, 07:51:49 am
I don't know much about Axe Parser and TI-83/84s, but when I did something like:

Code: [Select]
input->A
for(I,0,length(A)-1)
    {A+I}->B
    Disp B->DEC,i
end

and looked at the bytes it printed out, 1 byte tokens were encoded as 1 byte, and 2 byte tokens were encoded as 2 bytes, rather than both being 2.
If this *is indeed* the case, how are you supposed to know where one token ends and another starts if each token is a variable length?

Also, a semi-related question, given a pointer returned from input, how can I draw that string to the buffer?
Title: Re: Isn't the 'input' function rather useless?
Post by: Yeong on April 14, 2012, 04:07:47 pm
I'm just wondering but what kind of value can input take?
Title: Re: Isn't the 'input' function rather useless?
Post by: Runer112 on April 14, 2012, 05:10:09 pm
In the current state of Axe, I agree, the input comamnd is a little lacking in terms of supporting commands. It returns a string of tokens, but there are no Axe commands to handle strings of tokens...


However, you can always make your own. :) Here's a routine I whipped up to return 1 if a token pointed to is a 2-byte token, or 0 if it's a 1-byte token.

Code: [Select]
.INPUT=pointer to token
Lbl Is2B
Return inData({},[BB5C5D5E606162637EAAEF00])+255/256

You could then call this routine from another routine, like this routine I wrote to print a length-prefixed string of tokens (that's what the input command returns) to the screen/buffer:

Code: [Select]
.INPUT=pointer to first token
Lbl Print
→r₁+{-2}ʳ→r₂
Lbl PL
Return!If -r₁
Text Select(r₁,+Is2B()+1→r₁)►Tok
r₂:Goto PL
Title: Re: Isn't the 'input' function rather useless?
Post by: kindermoumoute on April 14, 2012, 06:12:01 pm
 *.*

That's so usefull, why Axe haven't this feature ?

Here a screen of runer'code.


EDIT : how to know when tokens exceed screen to jump to the next line ?