Ti BASIC User defined fucntion use in a program

  • Context: Calculators 
  • Thread starter Thread starter Saladsamurai
  • Start date Start date
  • Tags Tags
    Program
Click For Summary
SUMMARY

The discussion centers on the challenges of using user-defined functions in Ti BASIC on the TI-89 Titanium calculator. The user attempts to create a simple function, newdisp(stuff), which returns its argument, but encounters issues when trying to call this function within a program. Despite following typical programming conventions for function placement, the user is unable to display the expected output of '100' on the home screen. The problem highlights limitations in Ti BASIC's handling of user-defined functions.

PREREQUISITES
  • Understanding of Ti BASIC programming language
  • Familiarity with TI-89 Titanium calculator functionality
  • Knowledge of function definition and invocation in programming
  • Experience with TI GraphLink software for code transfer
NEXT STEPS
  • Research Ti BASIC function scope and limitations
  • Explore alternative programming structures in Ti BASIC
  • Learn about debugging techniques for TI-89 Titanium programs
  • Investigate community forums for Ti BASIC programming tips and tricks
USEFUL FOR

This discussion is beneficial for TI-89 Titanium users, educators teaching programming concepts, and developers looking to optimize their use of Ti BASIC for mathematical functions.

Saladsamurai
Messages
3,009
Reaction score
7
I am trying to figure out why Ti BASIC is the worst language ever. Every other language, if you want to use a user defined function within a user defined program, you simply write the function above (or below) the sub routine and then you can call it to your hearts delight...why is Ti BASIC failing me here? (I am using Ti89 Titanium.)


All I want to do is a simple test here. Here is a user defined function that simply take an argument and then returns that argument (and this works if I type it directly into my calculator)

Code:
Func
newdisp(stuff)
Return Stuff
EndFunc

Now I want to do a simple test program that calls newdisp and uses it

Code:
()
Prgm
newdisp(100)
EndPrgm

So it should just display '100' on the home screen. I would think that the structure of the program would be something like


Code:
Func
newdisp(stuff)
Return Stuff
EndFunc

()
Prgm
newdisp(100)
EndPrgm


or maybe

Code:
()
Prgm
newdisp(100)
EndPrgm

Func
newdisp(stuff)
Return Stuff
EndFunc

But if this worked I would not be here...the above to codes I am writing in Ti GraphLink and then sending to my calculator.

Any thoughts?
 
Computer science news on Phys.org
Any ideas on this one?
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
10K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
29K
  • · Replies 1 ·
Replies
1
Views
9K
  • · Replies 6 ·
Replies
6
Views
29K
Replies
1
Views
5K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 11 ·
Replies
11
Views
2K