PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

TI Basic Help

Hello everyone,
I realize that this is not a TI Forum, but I figured there would be a lot of people here who used to code on their calculators. Well, I am trying to write this little chat over link app, and I keep getting an error that is driving me nuts. I have no clue where it comes from. Maybe one of you can spot it:
Code:
Chitchat()
Prgm
Lbl lis
Toolbar
Title "Senden",sn
Title "Name",nm
Title "Ende",nd
EndTBar
If txt (//NOTE: AN UNEQUALS SIGN GOES HERE, DOESN'T DISPLAY IN IE) ""
Then
Disp txt
Define txt = ""
Goto lis
Else
Goto lis
Lbl sn
Dialog
Request "Text:",tnt,alphaon
EndDlog
Define txt = string(nom+": "+tnt)
SendChat txt
DelVar tct
Goto lis
Lbl nm
Local nom
If nom = ""
Then
Dialog
Title "Name"
Text "Bitte Namen eingeben:"
Request "Name:",nom,capson
EndDlogArchive nom
Goto run
Stop
Else
Unarchiv nom
Dialog
Title "Name"
Text "Bitte Namen eingeben:"
Request "Name:",nom,capson
EndDlog
Archive nom
Goto lis
Stop
Lbl nd
EndPrgm

//Missing start or end of block syntax
//(That's the error msg it gives me
//when I try to run it. Goto in the box
//then points me to the last line


(I am so proud that I finally made use of Dan's awsome CODE feature!!!)

Any help would be appreciated. Any help except for "just download one" that is :)

-Eike
Just guessing since I don't know the language, but don't you need an "End" to close an If-Then-Else block?

Pam
In ti basic IIRC an "end" statement anywhere except the end of the program will cuase it to either give a syntax error or just simply stop the program there.
Hmm yes and no. It looks like I will have to rewrite the whole thing anyway. It would be great if someone came up with a solution though, so I won't repeat the mistake...
UPDATED CODE (gives me an error about the first elseif statement)

Code:
tim()
Prgm
Lbl boot
Local id
PopUp {"Horst","Johnboy","Johnnie","Johnson"},id

If id="Horst" Then
DelVar schonda
schonda=GetType(horst)
If schonda="NONE" Then
Local horst
CopyVar id,horst
SendChat horst
Goto name
Else
Dialog
Title "Gibt's schon"
Text "Zu spät, es gibt schon einen Horst!"
EndDlog
Goto boot

Elseif id="Johnboy" Then
DelVar schonda
schonda=GetType(johnboy)
If schonda="NONE" Then
Local johnboy
CopyVar id,johnboy
SendChat johnboy
Goto name
Else
Dialog
Title "Gibt's schon"
Text "Zu spät, es gibt schon einen Johnboy!"
EndDlog
Goto boot

Elseif id="Johnnie" Then
DelVar schonda
schonda=GetType(johnnie)
If schonda="NONE" Then
Local johnnie
CopyVar id,johnnie
SendChat johnnie
Goto name
Else
Dialog
Title "Gibt's schon"
Text "Zu spät, es gibt schon einen Johnnie!"
EndDlog
Goto boot


Elseif id="Johnson" Then
DelVar schonda
schonda=GetType(johnson)
If schonda="NONE" Then
Local johnson
CopyVar id,johnson
SendChat johnson
Goto name
Else
Dialog
Title "Gibt's schon"
Text "Zu spät, es gibt schon einen Johnson!"
EndDlog
Goto boot

Else
Goto boot

Lbl name
If GetType(nom)//[UNGLEICH]\\"NONE"
Disp "Name gefunden. Ändern per Menü"
Goto start
Lbl ender
Unarchiv nom
Dialog
Title "Namen eingeben"
Request "Name", nom
EndDlog
Archive nom

Lbl start
Toolbar
Title "Verlassen"
Item "Beenden", ende
Item "Minimieren", mini
Title "Einstellungen"
Item "Name", ender
Item "Verschlüsseln", rot
Title "Extras"
Item "Tafel", tafel
Item "Variabel schicken", variabel
Item "Gleichung schicken", gleichung
Item "Dateien senden", transfer
Title "Hilfe", hilfe
EndTBar
Disp string("Teilnehmer im Chat: "+horst+", "+johnboy+", "+johnnie+", "+johnson)
DelVar horst
DelVar johnboy
DelVar johnnie
DelVar johnson

Lbl scan
Loop
getKey()»key
while key=0
Disp horst
DelVar horst
Disp johnboy
DelVar johnboy
Disp johnnie
DelVar johnnie
Disp johnson
DelVar johnson
getKey()»key
EndWhile
DelVar key
EndLoop
Dialog
Title nom
Request "Text:",text
EndDlog
If id="horst" Then
horst = string(nom+": "+text)
SendChat horst
Goto scan
Elseif id="johnboy" Then
horst = string(nom+": "+text)
SendChat johnboy
Goto scan
Elseif id="johnnie" Then
horst = string(nom+": "+text)
SendChat johnnie
Goto scan
Elseif id="johnson" Then
horst = string(nom+": "+text)
SendChat johnson
Goto scan
Else
Goto scan

Lbl mini
Pause
DispHome

Lbl ende
DelVar horst,johnboy,johnnie,johnson,id,text
DispHome
Stop

EndPrgm
Your code is so much more advanced than mine. I was playing around with my calc and a friends with a link cable and I decided I was gonna fool around with the send( and get( commands. My code is as follows:

clrhome
input "-",P
send(P)

Thats my send app, heres the recieving app:

get(p)
disp p

The app works fine, but I want to be able to send and receive in one app so you don't have to launch seperate apps to do everything. Any suggestions?
UPDATED!!!
Well, that is what the program above is supposed to do. Here is an updated version (I am posting this here for the guys at the IRC chan as well):

[code]
()
Prgm
Lbl boot
Local id
PopUp {"Horst","Johnboy","Johnnie","Johnson"},id

If id="1" Then
DelVar schonda
schonda=getType(horst)
If schonda="NONE" Then
Local horst
CopyVar id,horst
SendChat horst
Goto name
Else
Dialog
Title "Gibt's schon"
Text "Zu spät, es gibt schon einen Horst!"
EndDlog
Goto boot
EndIf

ElseIf id="2" Then
DelVar schonda
schonda=getType(johnboy)
If schonda="NONE" Then
Local johnboy
CopyVar id,johnboy
SendChat johnboy
Goto name
Else
Dialog
Title "Gibt's schon"
Text "Zu spät, es gibt schon einen Johnboy!"
EndDlog
Goto boot
EndIf

ElseIf id="3" Then
DelVar schonda
schonda=getType(johnnie)
If schonda="NONE" Then
Local johnnie
CopyVar id,johnnie
SendChat johnnie
Goto name
Else
Dialog
Title "Gibt's schon"
Text "Zu spät, es gibt schon einen Johnnie!"
EndDlog
Goto boot
EndIf

ElseIf id="4" Then
DelVar schonda
schonda=getType(johnson)
If schonda="NONE" Then
Local johnson
CopyVar id,johnson
SendChat johnson
Goto name
Else
Dialog
Title "Gibt's schon"
Text "Zu spät, es gibt schon einen Johnson!"
EndDlog
Goto boot
EndIf
EndIf

Lbl name
If getType(nom)
I noticed that whenever I try to send a text message through thelink cable, the get app jsut displays it all as numbers. Any idea on how to make it stay as text?
What calculator are you programming this for? This looks TOTALLY different than the TI-BASIC I program on my TI-83+, and AFAIK the different calculator models have slightly different versions.
TI89. Sorry for the late answer ^_^
So, yeah. Its 89 basic. And it still doesnt work. I will update it later today. Probably. Cäsar, what calc are you using? Post your source, maybe I can do something for you.
thats because your a baka
Sorry, I just noticed the replies in this thread. I'm programming in ti-83+ basic. Heres my code:

clrhome
input "-",a
send a

prgm get

get a
disp a

prgm send

The top part of the code is the "send" portion, the bottom is the "get" portion. Its not very efficient at all. I am actually using "p" for my variable because no calc apps write over it. You can't input messages with spaces, and any text comes out as numbers.