[TIB] Sharing a Function (TI-89/92+)


[Prev][Next][Index][Thread]

[TIB] Sharing a Function (TI-89/92+)




Here's a little something that all of you probably use anyway:

(PLEASE NOTE: This is copied and pasted from Graph-Link.
Therefore, the --> will look weird... that unidentifiable symbol
would be it.)

This is a function that takes a string as input. The output is the
X-coordinate (Column) that the Output orPxlText commands
must use if you wish to display that string, centerred on the screen.

centrstr(gnirts)
Func
local fropp
dim(gnirts)»fropp
fropp*3»fropp
80-fropp»fropp
Return fropp
EndFunc

Function does not affect the contents of "gnirts", which should be a 
string.

USAGE

...
Lbl N1
Dialog
 Request "Enter your name",name1
EndDlog
If ok=0
 goto n1
Output 35,(centrstr(name1)),name1
Output 60,(centrstr("Is this correct?")),"Is this correct?"
...

That block of code will ask someone for his/her name, not accept
a CANCEL, center the name in a middleish area of the screen,
and center the confirmation at the bottom.

This could have its uses...

--Adam Norberg, who's been a lurker on this list for the last two 
years




References: