Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's TI-BASIC subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. TI-Basic => TI-BASIC
United-TI Archives -> TI-Basic
 
    » Goto page Previous  1, 2, 3  Next
» View previous topic :: View next topic  
Author Message
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 13 Jan 2004 05:35:39 am    Post subject:

"hello "->str0
94->A
57->B
Repeat 1
If A:Then
Text(B,A,str0
A-1->A
Else
For(X,0,length(Str0
Text(X," " //4 spaces
End
94->A
End
End


Last edited by Guest on 13 Jan 2004 05:39:11 am; edited 1 time in total
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 13 Jan 2004 05:45:31 pm    Post subject:

Arcane Wizard wrote:
"hello "->str0
94->A
57->B
Repeat 1
If A:Then
Text(B,A,str0
A-1->A
Else
For(X,0,length(Str0
Text(X," " //4 spaces
End
94->A
End
End


Code:
"Hello " -> Str0
94 -> A
While 1
Text(57, A, Str0
DS<(A,0
End
For(I,0,94
Text(57,I," "
End
94 -> A
End
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 14 Jan 2004 11:17:58 am    Post subject:

Hmm, btw, that repeat 1 should be repeat 0.
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 14 Jan 2004 05:06:49 pm    Post subject:

That is why I fixed it.

Also, I think I finally figured out a use for the DS<( statement.
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 15 Jan 2004 06:14:41 am    Post subject:

There are several uses for it, but all of them work just fine if you'd use if..then..else..end instead.

And, not an awfull lot of people seem to even know about it, so if..then..else.end would be more understandable when showing an example program or somesuch.
Back to top
Toksyuryel
Crimson Dragon Software


Elite


Joined: 14 Jun 2003
Posts: 880

Posted: 15 Jan 2004 11:00:00 am    Post subject:

Feel free to optomize this (note: "!=" means "Does not equal")

Code:
:Input "Text=",Str1
:Lbl 0
:Input "Speed=",D
:If D<0
:Goto 0
:94->A
:Repeat getKey
:If A
:Then
:Text(57,A,Str1
:A-1->A
:For(B,1,D
:If getKey
:Goto 1
:End
:Else
:If length(Str1)!=1
:Then
:For(B,2,length(str1
:Text(57,A,sub(Str1,B,length(Str1)-B+1
:For(C,0,D
:If getKey
:Goto 1
:End
:End
:End
:End
:94->A
:Text(57,0,"     //5 Spaces
:End
:End
:Lbl 1
:ClrDraw
:ClrHome

This will allow it to scroll off the left edge of the screen. If you use spaces or lowercase letters (or anything else that doesn't have a width of 4 pixels) in your text you will notice some jittering when the text starts to scroll off-screen. Don't like it? Learn ASM.


Last edited by Guest on 15 Jan 2004 11:00:24 am; edited 1 time in total
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 17 Jan 2004 12:18:57 pm    Post subject:

Newbie wrote:
I don't want so when you execute the program you input speed and text.

Then replace the input statements with something like ' "HELLO"->Str1' and '4->D'
Back to top
Toksyuryel
Crimson Dragon Software


Elite


Joined: 14 Jun 2003
Posts: 880

Posted: 17 Jan 2004 11:11:14 pm    Post subject:

Newbie wrote:
When you enter all that nothing happens. It goes to a blank screen and if you press a key it stops.

You either typed the program in wrong, typed no text, or you made the speed so slow that the text takes forever to even get onto the screen.
Quote:
How do you change text white on black. I know their is a pxl- Change in there, but what is the code?

Only works in ASM. There's a system flag for inversing text. Go to Ticalc and download BASICtools.


Last edited by Guest on 17 Jan 2004 11:12:13 pm; edited 1 time in total
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 18 Jan 2004 04:27:33 am    Post subject:

JACstudios_ceo wrote:
Quote:
How do you change text white on black. I know their is a pxl- Change in there, but what is the code?

Only works in ASM. There's a system flag for inversing text. Go to Ticalc and download BASICtools.

Or read some of the other 100,000 topics on this forum about inverting text. Neutral
Back to top
Spyderbyte


Advanced Member


Joined: 29 May 2003
Posts: 372

Posted: 18 Jan 2004 12:49:39 pm    Post subject:

JACstudios_ceo wrote:
Quote:
How do you change text white on black. I know their is a pxl- Change in there, but what is the code?

Only works in ASM. There's a system flag for inversing text. Go to Ticalc and download BASICtools.

GASP! Supporting a solution other than Codex? You can get it here, and read about it here.

Spyderbyte
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 18 Jan 2004 02:43:04 pm    Post subject:

You might want to take out the For(B,1,D loops to try it. Also, doesn't using Gotos in loops cause memory leakage?
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 18 Jan 2004 02:54:02 pm    Post subject:

Jup, using goto's inside if..then..else..end statements or loops would hog up the memory.
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 18 Jan 2004 03:01:20 pm    Post subject:

Also, I think that could be done without gotos altogether.
Back to top
Jedd
1980 Pong World Champion


Elite


Joined: 18 Nov 2003
Posts: 823

Posted: 18 Jan 2004 04:51:43 pm    Post subject:

I don't know if this is what you want, but here's my code:


Code:
Disp "ENTER TEXT"
Input "",Str1
"                "+Str1+"                "->Str1        //16 spaces each
length(Str1)->B
Repeat 0
1->A
For(A,1,B-15
Text(-1,54,0,sub(Str1,A,16
End
End


I think someone might have posted a similar program already, but this is my version. Enjoy!


Last edited by Guest on 18 Jan 2004 04:52:43 pm; edited 1 time in total
Back to top
Jedd
1980 Pong World Champion


Elite


Joined: 18 Nov 2003
Posts: 823

Posted: 18 Jan 2004 05:06:52 pm    Post subject:

Errr yes there is a way, but it would run slower and take up more ram. To slow it down, just throw a For( loop in before Text(. For example

For(C,1,100
End

As for small text, I'll have to re-write the program. I'll get back to you within the next hour.
Back to top
Jedd
1980 Pong World Champion


Elite


Joined: 18 Nov 2003
Posts: 823

Posted: 18 Jan 2004 05:27:34 pm    Post subject:

Ok this is reallt 2 programs in 1, because it first moves the string across the screen, then it displays it while deleting 1 letter at a time. It runs too fast when there is less to output, and it's kinda too fast to read too. But it DOES work, which is always good Smile


Code:
Disp "ENTER TEXT"
Input "",Str1
Str1+"    "->Str1
length(Str1)->B
Repeat 0
For(A,94,0,-4
Text(57,A,Str1
End
For(A,1,B
Text(57,0,sub(Str1,A,B-A+1
End
End


Feel free to optomize and change to your liking.
Back to top
Jedd
1980 Pong World Champion


Elite


Joined: 18 Nov 2003
Posts: 823

Posted: 18 Jan 2004 06:35:09 pm    Post subject:

You can't make it exactly 10 seconds, but you can make it loop however many times you like. To do so, replace

Repeat 0

with

For(C,1,10

That would make it loops 10 times. Change the 10 to make it loop however many times you like.

As for going fast with spaces, you could avoid it, there are lots of ways. Me? I have to study for finals. Good luck with it.


Last edited by Guest on 18 Jan 2004 06:36:29 pm; edited 1 time in total
Back to top
Jedd
1980 Pong World Champion


Elite


Joined: 18 Nov 2003
Posts: 823

Posted: 18 Jan 2004 07:27:52 pm    Post subject:

My high school. I'll give you the basic idea on how to fix it. Test the character that it is about to delete, and if it equals a space, skip one loop. I can code it, just not right now. I'll get back to you within the next few days if no one else can.
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 19 Jan 2004 12:11:48 pm    Post subject:

Newbie wrote:
What school has finals at this time? Can anybody help me on fixing the problem?

High schools on a block schedule all have finals.

It's easy to fix the spacing problem, but there are other tokens such as "w" or "sin(" that are not a standard size in the small font.
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    » Goto page Previous  1, 2, 3  Next
» View previous topic :: View next topic  
Page 2 of 3 » All times are GMT - 5 Hours

 

Advertisement