Marquee

We're glad you came by, but you might find what you're looking for elsewhere.

TI-Basic Developer is not the site it once was. While its information on commands and other calculator features remains almost second-to-none, its forum, archives, and even hosting service, Wikidot, have been decaying for years. The calculator community would love to see what you're working on, or help you in your next coding adventure, but TI-Basic Developer is no longer the place to do it.

Instead, you should head over to Cemetech (primarily American) or TI-Planet (primarily international). Both are active, well-established forums with their own archives, chatrooms, reference material, and abundant coding tools and resources. We'll see you there, we hope.

Routine Summary

Scrolls a string across one line, in marquee fashion, on the home screen.

Inputs

Str1 - the text to be scrolled
A,B - the Output( coordinates for the text
N - the number of characters to display at a time

Outputs

None

Variables Used

Str1, A, B, N, Ans

Calculator Compatibility

TI-83/84/+/SE

Author

Weregoose

URL: United TI

Download

marquee.zip

:Str1
:Repeat getKey
:Output(A,B,sub(Ans,1,N
:sub(Ans,2,length(Ans)-1)+sub(Ans,1,1
:If dim(rand(4
:End

By leaving Str1 by itself on one line, we store it to Ans, which will be easier to work with. Then, the Repeat getKey loop will display the marquee until a key — any key — is pressed.

Output(A,B,sub(Ans,1,N will display N characters of Str1 at A,B. Then, the next line will rotate Str1, so that the next time we're at this point in the loop, the string shifts one character.

Finally, If dim(rand(4 is a clever way of delaying the marquee, so it doesn't scroll too fast. rand(4 generates a list of 4 random numbers, which is a slightly time-consuming process. If dim( is just a way of wrapping this list so it doesn't change Ans. Since dim(rand(4 is always 4, the If statement will always be true, so we don't have to worry about the next line being skipped. By changing 4 to a lower or higher number, you can make the marquee go faster or slower, respectively.

Error Conditions

  • ERR:INVALID DIM is thrown if the length N is longer than the number of characters in Str1.

.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Noncommercial 2.5 License.