Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: awalden0808 on February 02, 2013, 03:38:53 pm

Title: Displaying only a portion of a string?
Post by: awalden0808 on February 02, 2013, 03:38:53 pm
So, I have two appvars. One contains a long string of words - a string of strings. The other contains, in order, the location of each string relative to the string appvar's pointer. How can I display one of those strings if I have where its first letter is and where its last letter is? I'm having trouble with this...
Title: Re: Displaying only a portion of a string?
Post by: Matrefeytontias on February 02, 2013, 03:57:03 pm
As you describe it, it seems that you only can use a custom text routine. Let's say that S is the offset to the starting letter, E the offset to the ending letter and A the address of your appvar :
Code: [Select]
:While S<E
:Disp {A+S}>Char
:S++
:End
Of course, it can be optimized.

EDIT : I don't remember if this automatically goes to the next line if the right of the screen is reach ...
Title: Re: Displaying only a portion of a string?
Post by: awalden0808 on February 02, 2013, 04:00:05 pm
As you describe it, it seems that you only can use a custom text routine. Let's say that S is the offset to the starting letter, E the offset to the ending letter and A the address of your appvar :
Code: [Select]
:While S<E
:Disp {A+S}>Char
:S++
:End
Of course, it can be optimized.

EDIT : I don't remember if this automatically goes to the next line if the right of the screen is reach ...
I did this, but it wasn't working... Maybe my files were corrupt or something. Something happened, because I checked the source file and the strings actually appeared in the source file, when they should only be in the appvar... I'm gonna clean things up again and see if I can get this to work.

And so I don't lose anything, I'll use Wabbit and TokenIDE instead of trying to manage with the calc.
Title: Re: Displaying only a portion of a string?
Post by: Runer112 on February 02, 2013, 08:08:03 pm
Can you put a null terminator at the end of every word/string unit (like was just recently brought up here (http://ourl.ca/4050/336976) and here (http://ourl.ca/4057/337020))? If each small piece ended in a null byte, then you could display each one just like a normal string, given the pointer to its start.

If speed is not of huge importance, you would also then have the option of using stdDev() (http://axe.eeems.ca/Commands.html#miscellaneousCommands) to get the pointer to individual strings given their index in the "list" of strings. Not sure if that would make it easier or harder for you, but you would have the option.