Re: TIB:New programer


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

Re: TIB:New programer




>I'm fairly new to Basic programming and fist I'd like to ask is there a 
>big enough difference between the different calculators to specify witch 
>one your using?  I'd also like to know is there some way to store a 
>variable inside a program?
On the TI-92 you could, in theory, write a program which makes a 
duplicate of itself to run and thereby overwrites itself (Requires two 
programs so it can return the string for the define in the main program 
and then append data to save. Two programs because otherwise the program 
can overwrite itself.) An external variable would be easier and a list 
could hold all (Except for picts) data you needed.
>  So that you can save a bit of information to 
>use the next time the program is run without creating an external 
>variable?  Also is there some way to center text on the program screen 
>for the 92? You can do it manually with the output command but if it 
>ever changes you have to go and re-do it.

If you want to use the graph screen, not the IO screen then:

For the center of the screen use:

Pxltext str,col,119-dim(str)*3

Between two points use:

Pxltext str,col,int((x2-x1)/2)-dim(str)*3

To clip between two points use:

centrtxt(s,y,x,z)
Prgm
Local d
int((z-x)/2)->d
dim(s)*3->z
Pxltext when(z>d,left(s,dim(s)-int((z-d+2)/3)),s),y,d+x-z
EndPrgm

The clipping program uses the plus two for so it while round up when 
needed, if you don't need the extra pixel accuracy delete the +2 and save 
an extra 4 bytes bringing the size down from 96 bytes to 92 bytes. The x 
variable the row on the left (smallest) and the z variable is the row on 
the right (largest), if you want to mix and match do a test to flip them 
else tinker around (No, an abs won't do it) If characters are clipped the 
string will not be recentered in the allotted space, the string will 
start at x. If you need that ability added, just ask.

The standard font on the TI-92 is 6 wide and 8 tall. The screen is 103 
tall and 239 wide (At least usable). Pixels start at 0 and go to 102 and 
238.

For timings on TI-BASIC routines check out 
<www.iserv.net/~mikev/92optimize.html>. I'll have TI-92+ timing data out 
soon (day or two), preliminary results are the 92+ is about 26% faster in 
loops. This seems to bode well for BASIC games =)

Hope this helps,

- ---
I pledge allegiance to the Mac of Apple Computer Incorporated, and to the
developers for which it stands, one platform, under Guy, indestructible,
with creativity and multimedia for all.