Calculators Ti BASIC User defined fucntion use in a program

  • Thread starter Thread starter Saladsamurai
  • Start date Start date
  • Tags Tags
    Program
AI Thread Summary
Ti BASIC on the TI-89 Titanium has limitations regarding the use of user-defined functions within user-defined programs. Unlike many programming languages, Ti BASIC does not allow for the straightforward calling of functions defined in the same script. The user-defined function 'newdisp' is correctly defined to return its argument, but attempts to call this function within a program do not yield the expected output. The structure of the program, whether the function is defined before or after the program block, does not resolve the issue. This limitation in Ti BASIC leads to frustration for users seeking to implement simple function calls in their programs.
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?
 
This week, I saw a documentary done by the French called Les sacrifiés de l'IA, which was presented by a Canadian show Enquête. If you understand French I recommend it. Very eye-opening. I found a similar documentary in English called The Human Cost of AI: Data workers in the Global South. There is also an interview with Milagros Miceli (appearing in both documentaries) on Youtube: I also found a powerpoint presentation by the economist Uma Rani (appearing in the French documentary), AI...

Similar threads

Replies
8
Views
10K
Replies
1
Views
2K
Replies
2
Views
29K
Replies
1
Views
9K
Replies
1
Views
5K
Replies
1
Views
4K
Back
Top