		Read Me:

Copland Pro version 4.0.1 FINAL

    Based on Apple's upcoming OS 8 user interface. Features fully operational menus, dialog boxes, and clickable items. Has a mouse setup box, and other advanced features. Is very user-friendly; stores the user's current Pic masterpiece in UserPic, then recalls it later. Remembers and resets all user-defined RANGE variables. Leaves Home Screen alone (except final message). All the screens are actual screenshots taken on my Mac and converted to black/white.
	 Copland Pro is the 4th major rewrite, and has a built-in help function (it puts help notes at the bottom of the screen), toggleable in the Options menu. 2nd clicks.  Please do not remove the About box; it can destroy the program as it is used in many places in the program. Please do not delete ANY included files, otherwise Copland will crash. 
		To make a custom Open Dialog, write two progs, OPENP3 and OPENP4.
The form should be like so:
		PROGRAM:OPEN1
: ProgToLoad
:Return

		ClDrw, edit the Open pic to add the names, StPic Open, and you're done! Two programs are included, Factor (unknown author) and Quad (by me, Dmitriy Myshkin). Factor factors numbers into primes, while Quad solves the Quadratic formula, giving results in fractional and i-form (x= 3 +/- i13
																														-----------
																																  14                    ).
Very cool. Also gives decimal approx. if exact.
Copland is freeware. Please feel free to make additions, updates and upgrades, but be careful, test it carefully, and do not destribute bogus and crashing copies. Please do not remove my name from the credits; you can add yours.



     What follows is a guide to programming on the TI-85. Sorry it looks funny (Mac format).






			(Back Cover)    

		The TI-85 is becoming one of the most widely used minicomputers today. Unfortunately, very few serious programmers exist for this medium. Learning to get the full potential out of this calculator is an important objective, and the TI programming language is also a good first step into the world of programming because of its similartity to C and BASIC. The concepts taught in this book will not become obsolete as new minicomputers appear on the horizon; many of the skills learned here can be applied to C or C++.
	The TI programming language's efficient, robust set of operators and variety of data types let you venture into all areas of programming, from games to graphics, and from operating systems to application packages.
	The explanation of the TI language is easy to read and understand. The author is paricularly knowledgable about the TI language. He has written many large application packages including CoinTray, and is the president of the software publishing firm Acsoft. He explains sample programs clearly so tha you can understand both how and why they work. For each sample program, readers are encouraged to use their imagination and experiment.
	This book is for those who want to start learning the TI language as well as for experienced TI programmers who desire more information about C's sophisticated concepts.

	Dmitriy Myshkin
	Mr. Myshkin is a student at Walker and a TI-85, C, C++, and BASIC programmer. He is currently handles network systems for several large companies, including HIB, Russian Connections, and CIS. He is the president of Acsoft, a software house under the real-estate group OI,  that specializes in TI and Macintosh programs.

	This text is designed to help you learn to write programs on the TI-85 as quickly as possible. It covers topics 
from basic code to more in-depth subjects including design and high-definition graphics.
	Why program? The TI-85 is a very versatile machine and you greatly increase the capabilities of your calculator. You can writeanything from operating systems to accounting programs, games to programs that help you solve 
real-life problems in school or college.The many other advantages will become clear as you read this text.
	This book was written with two underlying assumptions: (1) the only way to learn a language is to write programs with it, and (2) learning is made easier if you can visualize what a program statement  does. This  text  explains  in  an  easy-to-read  way  how  to program and why. Several appendixes explore certain topics in greater depth for  the interested reader. 
	This book assumes you have access to a TI-85 
calculator and should be used with the user's manual. Do not be discouraged if you have a TI-82 or TI-92, as 	especially on the TI-92, many concepts can be applied as well, with minor changes in syntax.
	Each chapter contains program examples that intro-
duce additional elements of the language. Each program is kept as simple as possible, but still conveys the topic at hand. 
	The text encourages you to experiment with each program. 		Sometimes questions are asked that can only be answered if  		you run the program. In this sense, the text  may be used as 		a self-study guide.




This chapter reviews the basics essential to the prog-
	ramming of  the TI-85. The ~ symbol in this text repre-
	sents  the arrow produced when you punch the [STO] 
	key.
		

		Variables

		Variables are places in memory in which you can store 
	a numerical value, a group of letters, symbols, lists, arrays, 
	and many other sorts of data (like x). A variable name can 
	consist of up to eight numbers and letters, but the first charac-
	ter must be a letter. to store a value or string of characters in a 
	variable, the form:
		value  ~ variablename    for a value
		or        "words  "~variablename     for words
		
		To change the value of a variable, just store a new 
	value to it and the new value will be written over the present 
	value. To recall a variable's value, simply type in the variable's
	name and push [ENTER]. 

		The Graph Screen

		The graph screen, accessed  by pushing [GRAPH], 
	allows 	you create, edit, and store pictures. The TI-85 screen 
	is 127 pixels, 	or individual picture elements that can be dark
	 (on) or light (off), wide, and 63 pixels high. To store a 
	graph or picture, press [MORE] twice amd select <StPic>. 


Graph Tools

		y(x)=    		 This allows you to insert functions to graph.
		RANGE   	 Allows you to set the ranges of the graph 					(how many units of y are at the top of the 					screen, the bottom, the distance between y=1 					and y=2, the x left and right ranges, and 						related.
		ZOOM	 As the name implies, this allows you to zoom 					in, out, and perform other zoom operations.
		TRACE	 Allows  you move along the graph of a function
				displaying the x and y values.
		GRAPH	 Graphs the current function.
		MATH	 This finds various information about the func-					tion, such as maximum and minimum.
		DRAW	 Shade - Shades the area between two funct-
				ions. Push [ENTER] to pick starting point and
				again to pick ending point.
				 Line - Draws a line. Push [ENTER] to pick 					starting point and again to pick ending point.
				 Vert - Draws a vertical line from the bottom 					to the top of the screen (If you zoom out it keeps 					going), replaces x=1 or x=2 ... Push [ENTER] to 					pick starting point.
				 Circl - Draws a circle. Push [ENTER] to pick
				center, again to select where the edge is to be
				(distance between the two is radius).
				 DrawF - Draws a function on the current 					graph. In the form:
				DrawF function
				 Pen - A freehand tool. Any pixel it crosses 					while "ON" turns dark. Push [ENTER] to turn 					ON, and again to turn OFF.


		 PtOn - Turns dark a pixel it is on. Move the 					cursor to the desired pixel, then push [ENTER] 					to turn it dark.
				 PtOff - Does oppoisite of PtOn.
				 PtChg - Similar to PtOn but changes a light 					pixel to a dark one, and vice-versa.
				 ClDrw - Clears the screen.
				 TanLn - Draws a line that is tangent to the
				function at the x value. It is in this format:
					TanLn(function, x value)
				 DrInv - Draws the graphical inverse of the 					function provided. It is in this form:
					DrInv function
		FORMT	 Contains graph  formating options, such as 					show x/y axes.
		StGDB	 Store current graph as a database - stores 					all the range preferences, the format prefer-					ences, all functions...
		RcGDB	 Recalls a graph database stored previously.
		EVAL	 Enter a real x value in the current range and
				the cursor will be positioned at that x on the 					current function and the function will be eval-
				uated at that x value.
		StPic		 Similar to StGDB but only stores the graph
				itself.
		RcPic	 Recalls a picture or graph stored previously.

Important Information
	A string  is a group of characters. The Home screen is the mode in which you can accomplish calculations. You cannot display text on the graph screen, nor graphs on the home screen, so when designing a prog choose either the more time-consuming good graphics graph path or the easier home screen path.	

A calculator is nothing if it cannot communicate with the user, hence the importance of the input/output commands. Also, remember that all commands in programs can be used on the home screen.
	
	The Outpt() function

	The Outpt() function is used whenever you want a program to print something on the screen. The general form
is:
	:Outpt(row ,column ,argument )
	
The TI-85's screen is 8 rows high and 21 columns wide.
If you wanted to print "HI" in the middle of the screen,  
	
	:Outpt(4,10,"HI")

	would be used (don't forget that when a long word is used, to center it do [11 - (number of characters/2) = column] to compensate for the length of the word). The argument is what is to be printed. If you use quotation marks, the TI-85 will print exactly whatever is in the quotation marks, and if you do not,
it will print the value  of the variable with that name. For example, say there is a variable called NAM that contains the words "Hello, world!"

	:Outpt(4,11,NAM)
Would print
		
	Hello, world!
	
On the fourth line.

Sometimes, when you want to erase a value off without clearing  other values, just Outpt a blank space or spaces (    Outpt(r,c,"  ")    ) at the location of the value.
	The Disp function writes data on the screen below
 any data already on the screen, with the first letter all the way to the left if it is displaying letters, and the last digit all the way to the right of the screen if it is displaying a value. The Disp function has the following forms:
		
	:Disp    variable		for a string or a value
	:Disp     "string " 		for a string
	:Disp			by itself displays the home screen.
	
	The DIsp function can also display several strings seperated by a comma:
	
	:Disp "The number is:","29+",NMB 
	
	If NMB=15, this function would display
		
	The number is 29+15
	
	The DispG function switches to the graph screen and displays the current graph.
	The ClLCD function is one of the most significant -- it clears the screen (the Liquid Crystal Display or LCD). ClLCD is put on a line by itself.

The PrtScrn function is not a common one -- it prints the screen to a Macintosh or PC printer connected to it with the TI-85 Graphlink. Without the link it acts like Pause. It is also put on a line by itself.
	

	Overflow considirations


	If you start to display text but there is not  enough room on the line to display all of it, it will overflow onto the next line.
	
	:Outpt(2,1,"this text will overflow after the L")

	will display:
		
				this  text  will  overfl
				ow after the L
	
By carefully counting spaces, you can get it to overflow correctly. Remember the screen is 21 characters wide, and don't forget spaces.
         
	:Outpt(1,1,"text and t
            ext and      because it flows ") proper flow - b below t

	would write:		text and text and
				because it flows
	
	Outpt(1,1,"text and t
	ext and because it flows")       improper flow - no lineup

	writes:			text and text and bec
				ause it flows
	
Getting values to the program

	Input  is used whenever you want the user of a program to give the program a numericl value to use in calculations. It generally has the form:
		:Input  variable
	Which means that it puts a question mark on the screen at the top-left corner and blinks a cursor. When the user enters a value and pushes enter, the function puts that value into the variable   you specify.
	The InpSt function is used whenever you want the user to input a string of letters and has the same form,
		:InpSt   variable
	The getKy function checks to see if the user has pushed any keys. If the user has not, it puts a 0 (zero) into variable. If the user has, then it puts a value into variable, depending on which key was pressed. The general form is:
		:getKy variable
	The following is a list of what values it returns for what keys.
      key	     returns		key                 returns

F1		11        		      UP-Arrow	25
F2		12		      R-Arrow		26
F3		13		      L-Arrow		34
F4		14		      ALPHA		31
F5		15		      x-VAR		32
2nd		21		      DEL		33
EXIT		22		      GRAPH		41
MORE	23		      STAT		42
L-Arrow	24		      PRGM		43
	      key	       returns	            key                 returns

CUSTOM		44                    				81
CLEAR		45		4		82
LOG			51		5		83
SIN			52		6		84
COS			53		subtr key	85
TAN			54		STO key	91
			55		1		92
LN			61		2		93
EE			62		3		94
(			63		addit key	95
)			64		ON key	breaks prog
 divis key		65		0		102
x			71				103
7			72		(  )		104
8			73		ENTER	105
9			74
multip key		75

Without control, your program does nothing. These elements give your program a purpose and are the building blocks of programming. 
	
	Relational Operators

	The relational operators compare two values or strings and return a result based on that.
	The = = operator should not be confused with the assignment operator =. The assignment operator sets an equality, such as y=x+1. if x changes, so does y. The equals? operator = = checks to see if two values or strings match, and returns 1 if they match or 0 if they don't match. The general form (consider that x=1 and y=3) is:
	1==1			Returns:	1
	1==x					1
	x==1					1
	x==y					0
	1==3  					0
	x==3					0
	3==3 					1
	y==3					1
	The < and > operators return 1 if true and 0 if false.
	10>5			Returns:	1
	5<3					0
	
	The  and  operators are almost identical to the < and > operators.
	1212 			Returns:	1
	1211					0
	1213					1
	The = (not equal to) operator checks to see if two values or strings do not match. It returns 0 if they do and 1 if they don't.
	12=12			Returns:	0
	12=23					1

	The If-Then-Else functions

	The If function is probably the most important function in the programming language after Outpt(). The If function makes decisions in a program based on if its argument equals anything but zero. If the argument equals anything but zero, or true, it does whatever is on the next line after If. The general form is:
	
	:If argument
	:Things to do if argument  does not equal zero
	:Unrelated stuff

ex.	:If x==3	(x==3 evaluates to either  one or zero)
	:Outpt(2,1,"Hello")	
	:DispG
	
	The Then function is used after If. The Then function increases the number of things that can be done if argument  does not equal zero from just one thing to do to many things to do. The Then function goes on a line by itself right after If and before the list of things to do.The End function signals the end of the list of things to do and follows the list. This has the form:
:If argument
	:Then
	:Things to do if argument  does not equal zero
	:Things to do if argument  does not equal zero
	:End
	:Unrelated Stuff
	
	The Else function tells the program what to do if argument  does equal zero. It must be used with Then. It is used after the list of things to do if true (not equal to zero) and has an End  following it. The form is:
	
	:If argument
	:Then
	:Commands to do if true (argument  does not equal zero)
	:Commands to do if true (argument  does not equal zero)
	:Else
	:Commands to do if false (argument  equals zero)
	:Commands to do if false (argument  equals zero)
	:End
	
	The For(), While, and Repeat

	The For() command repeats a group of commands a certain number of times. The For() command has the following form:
	
	:For(variable,starting value,max value,increment )
	:Commands to do if variable  is less than max value
	:End
	
	What this all means is the For() function creates a loop of commands, and increases variable  by increment  every time the the loop begins, until the max value  is exceeded. Initially, the value of variable  is starting value . The For() function can , like most other functions, be nested.
Nesting means that you can do this:
	:For(X,0,20,2)		Outer Loop Start
	:For(Y,1,10,1)	 Inner Loop Start
	:Stuff
	:End		   	 Inner Loop End
	:Stuff
	:End				Outer Loop End

If you do not include increment  and just write:
	
	:For(variable , starting value , max value )
	
The default (assumed) value of increment  is one. 
	The While function does a series of commands as long as condition   is true (does not equal zero). End signals the end of the list. The While function differs from For() in that it will create an infinite loop if something in the Things to do if condition  is true does not change the value of condition , whreas a For() loop would not need any help, it can create a non-infinite loop by itself. The general form is:
	
	:While condition
	:Things to do if condition  is true
	:Things to do if condition  is true
	:End

	The Repeat function does a series of commands, then checks if condition   is true (does not equal zero). It differs from While in that the Things to do again if condition  is true get done at least one time, regardless of if condition  is true or not.
Repeat will also create an infinite loop without help if condition   is true initially. The While and Repeat  functions are just For() loops that don't increment  (increase by a value every time around) condition themselves. The form for Repeat is:
	:Things to do again if condition  is true
	:Things to do again if condition  is true
	:End

The IS>() and DS<() functions

	The IS<()  (increment and skip) function increments variable  by one and skips the next command if variable  is greater than value . This function has the form:
	
	:IS>(variable ,value )
	:Command to skip if variable  exceeds value

	The DS>() (decrement and skip) function decreases variable  by one and skips the next command if variable  is less than value . This function has the form:

	:DS<(variable , value )
	:Command to skip if variable  is less than value

The Lbl and Goto functions

	The Lbl and Goto functions allow the program to go to a certain part of the program that has been Lbled.
The following is the general form:
	:Stuff
	:Lbl labelname	To here
	:Stuff
	:Stuff
	:Goto labelname	Control goes from here
	:Stuff


The Menu() function

	The Menu() function creates a menu at the bottom of the screen similar to the TI-85's built-in menus. The function has the following form:
	
	:Menu( position , "string  ", label  )
	
	The Menu() function creates a menu on the screen, and writes string  at position  (which menu tab, 1-5), and if the user pushes the corresponding F-button, goes to label .
The only five characters of string are visible on the tab, so make the strings only five characters long.  An example of a program using menus is:
	
:Lbl MIL
:Menu(1, "Calc", CLC , 4 ,  "Clear" , CLR , 5 , "Quit",QT)
:Lbl CLC                  If the user pushes [F1], the program does this:
:Outpt(2,1,"X squared is")
:Disp X
:Goto MIL
:Lbl CLR    	           If the user pushes [F4], the program does this:
:ClLCD
:Goto MIL
:Lbl QT   	             If the user pushes [F5], the program quits.
:Stop
	
	The screen looks like this when the menu command is up:

The Pause, Return, and Stop Commands

	The Pause command stops the program until the user pushes [ENTER]. This is routinely used to pause a screen of information for examination, for those of us that can't read at 4500 words per minute.
	The Return command tells a program to return to the calling program. Whenever calling another program from a program, the name of the program should be on a line byitself. An example is:
		
		"MAIN" Program
	:Outpt(3,2,"this is main program")
	:Outpt(4,2,"executing")
	:Disp "I will now call "Sub"."
	:SUB
	:Disp "Control has now returned to me!"
	:Stop
		
		"SUB" Program
	:Disp "My name is Sub"
	:Disp "and for now I have"
	:Disp "control"
	:Return
	:Disp "If no one called me"
	:Disp "I will continue"
	:Stop

	If no one called the program with the Return statement, Return does nothing and the program keeps executing. Lbl and Goto are local to each program; you cannot Goto a Lbl in another program.
	Stop is a simple command that causes the program to stop executing and write "Done" at the top right of the screen.
This command returns you to the Home screen.

 Some loose ends

	The and operator is one that has not been discussed yet, but is of great importance. The and operator checks to see that both arg1  and arg2  are equal to one (true) . If  they are, it returns 1. If either arg1  or arg2 , or if both, are not equal to one, it returns zero. The general form is:
	
	: arg1  and arg2	
	: 1 and 1		Returns:	1
	: 0 and 1 				0
	: 1 and 0				0
	: 0 and 0				0
	: 12 and 13				0
	: 1 and 17				0

	The or operator is like the and operator in that

		This chapter deals with getting maximum graphics out of minimum TI.

Introduction

	Say you're writing a primitive ping-pong game. Maybe you use Outpt(x,y,"o')   to outpt your ball and make a paddle from a bracket ]. Maybe you're writing a helicopter simulator and use characters to make up your chopper. Cute and easy as this may seem, it may not be enough for some people. For example, CoinTray  2.5, a high-quality game by Acsoft, uses the graph screen to do most operations. But in order to draw the numbers on the cards, We wrote 10 programs that look like this:
	:PtOn (X+1, Y+4)
	:PtOn(X,Y+1)...
	to write the numbers at the appropriate x and y, point-by-point. To map out all the graphics point-by-point and then type it all in is extremely time-consuming when the same job can be done with one Disp command, but it is the secret to the beautiful graphics from the Acsoft software house. 
	
	Using the Graph screen from a program

	The graph screen may be easily accessed and changed from a program. Animation can be achieved easily by drawing a group of pre-drawn pictures, recalling 
					
them sequentially, and clearing the screen after each one. This method, although the quickest and least time-consuming, can take up huge chunks of memory (1014K, + 1K for every letter of the title). A much cleaner and smaller, albeit time-consuming method is to use Line() and PtOn() , if the animation will only take up a small piece of the screen or very few pixels on (<50); in cases where more pixels are present, StPic does a better job at keeping things small. And, don't ever forget to set xMax at 127, yMax at 63, and xMin,yMin at 0.
	The Tools

	The Line() function draws a line between x1 , y1  and x2 , y2 . Line()  executes faster than PtOn()  if more than one point needs to be turned on. Line() takes up less memory than several PtOn()s. The general form for line is:
	
	:Line(x1 , y1 , x2 , y2  )

	The PtOn() function "turns on" - turns from off to on (darkens) the pixel at x , y . The PtOn() function should be used whenever only one pixel needs to be turned on in a certain area and Line() cannot reach two pixels (they are not in-line) To turn on the point at x ,y , the format is:
	
	:PtOn(x , y )

	The PtOff function is like PtOn, but it makes pixels light (off). To turn off the point at x , y , the format is:

	:PtOff(x , y )

	Since you cannot use Outpt() and the Line() , PtOn() , and PtOff() commands simultaneously, sometimes it is nessesary to write programs that print text on the 

	Start by making a grid, the size of your desired letter or number. Write Y, Y+1, Y+2... on the left side of the grid, and X, X+1, X+2 on the bottom. Then, fill in the cells (boxes) to make a pattern, or letter.

Y+4
Y+3
Y+2
Y+1
    Y
	X  X  X   
	     +   +     	
	    1   2  

	Then create a program (for example, L1) and write Line( whenever 2 or more dark spots are touching, and PtOn( whenever that line does not reach a lone square. In the first example, we would use two Line() s   (one from X+1, Y to X+1, Y+4, and one from X, Y  to X+2, Y) and one PtOn()  (X, Y+3). Just remember that for two or more consecutive spots, Line() works faster, but when only one needs to be turned on, PtOn() executes faster. Diagonal lines can also be used. Then, add a Return statement to the end of the program to bring you back to the calling program once done.Our program will look like this:

	PROGRAM :L1
	:Line(X+1,Y+1,X+1,Y+4)
	:Line(X,Y,X+2,Y)
	:PtOn(X,Y+3)
	:Return

	When you want to write the number 1 on the Graph screen from a program or the Home screen, do

:n ~X:r ~Y
	:L1

	where n  and r  are where (x & y) you want the letter's lower-left corner to appear. When designing a full-screen graphic to be saved as a Pic, make a 128 x 64 grid (you don't have to label it x +1...y+1...) or, better yet, print it out on a computer. If you have Adobe Illustrator make a rectangle out of line segments the approximate shape of the TI-85 screen, and use the Blend tool on two line segments, select 128 under steps (two vertical lines) and 64 steps (for the two horizontal lines). 
	Sketch the graphic with a pencil. Go back and fill in the squares that the lin touches and interior shapes. Then, use Pen  to construct the outer edges of the pattern following the grid and fill it in. Finally, store the image. 

This chapter is a guide to how to structure the stages involved with program design, and factors to keep in mind before writing a program.



	Above all, in order to finish a large project on time or at all, it is essential to use routines that save time, space, and execute quickly. For example when presented with the two choices below, always choose the latter, it executes much faster:

	:0~X
	:Lbl A
	:X+1~X
	:Stuff to do while in loop
	:If (X< 10)
	:Goto A
	:Stuff to do after done

	:For(X,0,10)
	:Stuff to do while in loop
	:End
	:Stuff to do after done

	Although both methods will do what is required of them, but the first is unnecisarilly complex and executes 3-4 times slower. A complex For() loop almost always takes up less space than just writing it out, but remember that you cannot use pointers; therefore you cannot replace
:0~A
	:0~B
	:0~C
	:0~D
	:0~E
	:0~F
	:0~G
	:0~H
	:0~I

	with:

	:For(M,0,7)
	:0~M
	:End

	because in TI, a variable cannot hold the name of another variable. When working with graphs, always choose procedures that execute faster, as listed in the Table of Execution.
	
	The Process

	The design process is as follows:

	1) decide what you will write.
	2) write pseudocode
	3) draw graphics
	4) work out methods to do difficult routines
	5) type it in
	6) test
	7) debug
	8) add on things you just thought of
 9) test
10) debug
11) make documentation, bundle, other things needed for full program
12) release
	The saying goes: If you can dream it, you can write it. This is almost entirely true, and although on the TI you are limited by space, execution speed, and deficiencies in the TI language, it takes considerably more skill to dream up a program than to write it.
	Step two refers to writing on paper, code which uses terms from the language but is just an outline of what will happen. For instance:
	
	 RcPic Title
	 MainMenu code
	 Outpt() section
	 User Input
	 Is it an integer?
	 If() fuzzy logic section

	Step 3 preceeds step 5 because often you want to test parts of the program before it is completed, and if the Pics aren't finished it won't work.
	Step 4 is taxing: sometimes you get something you have no idea how to do. Here, write your ideas and code ON PAPER so you can see the whole thing, and not just a screen's worth. Think of ways to do this differently, and look in the CATALOG for commands that may help.
	Step 6: debugging, also known as errorchecking. Sometimes a bug is so elusive, you cannot find it. Often, it looks as though you are doing everything right. Go through the code step-by-step keeping a table of the values of all the variables involved at those points, and do the commands just as the TI would. This may help you to see where, when, and under what surcumstances you run into the problem. Try using different input vaues, only a few could trigger it.
	By the time you've done all that, you may have new ideas, so go throught the process again. Sometimes major reworking is necessary.
Hints

	Keep track of your variables. make a table with each one's uses. Use the same variable names for loops and other operations more than once - it keeps large amouts of variables from piling up. Create a CUSTOM menu to keep your often-used commands that are not directly accessible from the Program screen. To do this, push [2nd], [CUSTOM], <Custom> menu option, and use the arrow to select a term. Hit an F-button or [MORE] to save that term in that slot.

	Miscellaneous Commands

	These you may need for various common operations.

	rand - returns a random number between 0 and 1. If you want it between n  and p , do:  
	n  + (rand * p  -n )

	round() - rounds arg   to n   decimal places, zero for whole numbers. Is in the form:
	round(arg , n )

	int - strips the fractional decimal value off arg .  0.920 becomes 0, 19.3 becomes 19, 34.8 becomes 38. Form:
	int arg

	fpart - returns the fractional decimal part of arg . 0.24 becomes .24, 34.2 becomes .2. It follows the form:
	fpart arg 


Ready-Made Program Bits


Script to extract the last digit of a number

		:X/10~Z
		:10 * fpart Z~LASTDIG

	Script to extract the first digit of a number

		:X~Z
		:Lbl A
		:If (Z>9)
		:Then
		:int (Z/10) ~Z
		:Goto A
		:End

	Script to have a scrolling list of data

(GA-GO are what you want to display. This example is for a list of 15 elements)
	
		:Lbl LIST
		:17~GT
		:Lbl H
		:If (GT>16)
		:Outpt(GT-15,1,GA)
		:If (GT>15)
		:Outpt(GT-14,1,GB)
		:If (GT>14)
		:Outpt(GT-13,1,GC)
			. . .
		:If (GT>10)
		:Outpt(GT-9,1,GG)
		:If (GT>9) and (GT<17)
		:Outpt(GT-8,1,GH)
		:If (GT>8) and (GT<16)
		:Outpt(GT-7,1,GJ)
			. . . 
		:If (GT>2) and (GT<10)
		:Oupt(GT-1,1,GO)
		:Lbl G
		:getky~GK
		:If (GK= =34)
		:Then
		:If (GT>9)
		:GT-1~GT
		:End
		:If (GK= = 25)
		:Then
		:If (GT<18)
		:GT+1~GT
		:End
		:If (GK= = 105)
		:Goto EXIT
		:If (GK = 0)
		:Then
		:Goto H
		:Else
		:Goto G
		:End
		:Lbl EXIT


Execution Times


times are in thousandths of a second.

For Loop					  5.50
PtOn 						18.89
PtOff 						16.55
10 PtOns					25.63
10 PtOffs					25.62
Line (1,1 to 1,1)				28.89
Line (1,1 to 127,63)			52.67
Chain of PtOns 
	from 1,1 to 127,63	     3255.01
Circl
	radius 1			     4137.16
	radius 30		 	     4504.17
If						12.68
If-Then-End				13.42
ClDrw					    .73


	
	




