Plugin Developpement Guidelines for Graph32.
1). Major guidelines for the plugin

	a). Unique Plugin Identifier (UPI)
	You will need a Unique Plugin Identifier for each plugin you develop for Graph32. The UPI is a two digits number that will be used by Graph32 to identify your plugin's .opo and .rsc file and also it's folder. The UPI should also be present into all the globals you will declare as well as into all procedures name. It is used in order not to get any problems with the plugins globals interfering with Graph32's globals.
	You can get a UPI for your plugin by mailing me a short description of your plugin at npiguet@hotmail.com
	b). General procedure and variable names
	It is important to use the naming convention described below for all your variables. Local variables can be named as you wish, but it is better to use the same naming convention as for global variable. All of you gobals should be named as follows: 
VariableNameXX%	for an integer
VariableNameXX&	for a long integer
VariableNameXX	for a floting point number
VariableNameXX$	for a string
	In all of those cases, XX should be you UPI. Example: the matrix calculator plugin has the UPI 01 thus a valid name for one of it's globals would be matrix01&. Your procedures should follow the same naming convention as your global variables. This is very important, it makes sure that you global variables name and procedures name does not interfere with Graph32's or other plugin's variables name or procedures name.
	c). Required procedures
	Graph32 will call 4 different procedure which must be defined in you plugin, those procedures are:
	menuXX:
	initXX:(proc$,number%)
	clearXX:
	returnNameXX$:
where XX is your plugin's UPI. menuXX: is used when the user wishes to use your plugin, it should contain a menu where all the options of your plugins are defined and they should be acessed so.
init01XX:(proc$,number%) is used to make sure that your plugin's globals are kept when Graph32 is loaded but does not use your plugin. That means that all globals defined in that procedure will be kept from one plugin access to the other. Globals defined in other procedures will be lost from one plugin access to the other. The two parameters are used to link your plugin into Graph32 just as you link the toolbar module. The last line of this procedure MUST be the following :
	@(proc$):(num%)
	This links your plugin to Graph32 and makes sure that globals decared into initXX:(proc$,num%) are kept from one plugin access to the other.
	The procedure clearXX: is called when Graph32 shuts down or when the user unloads your plugin during the execution of Graph32. This procedure should close ALL threads opened by your plugin (ie: help file, files opened in another application etc..)
	The procedure returnNameXX: is used by Graph32 to get your plugin's name to display it at various places (like in the File->Plugin menu card). It is called only once, when Graph32 loads your plugin.
	d). Naming and placing plugin files
	All of your plugin's files should be installed into the following folder:
	!:\par 	and should be named XX.opo and XX.rsc where XX is your plugin's UPI. ! is the disk on which Graph32 is installed. All other files (help file etc...) must be placed in the same directory but can be named as you wish since it is not Graph32 which will load them. As your plugin should be installed on the same disk as Graph32 you can use diskLetter$ which is a global variable defined in Graph32 and containing the disk letter on which it is installed.
	Note: In order for Graph32 not to use more than the 8 allowed modules, your plugin should use no other module than itself, that means you should never use the OPL load keyword. Plugins can only be developped in OPL.
	e). Using ressources
	Your plugin may use ressources in order to easily produce international versions of you plugin. The ressource file must be installed to !:.rsc where XX is your plugins UPI and ! is the disk on which Graph32 is installed. Graph32 will take care of loading your ressource file whenever needed, which means you must not load any ressource file. This is also done to make sure that your ressource does not get mixed up with Graph32's ressource which would result in strings appearing at the wrong place.
	f). Creating and using files.
	When you write your plugin you might wish  to create a file to save some data in it. That file must be created into your plugins folder. It would be useless to create it anywhere else since the user will not be able to open it by tapping on it. You can open your file whenever you want, but you should never use the OPL setdoc keyword. When using databases, you should make sure not to use handles a,b,y and z since they are used by Graph32.
2). Interacting with Graph32
	
	a). Using Graph32 advanced functions support
	When you developp an OPL application, you can only use the basic trigonometrical functions sin,cos,tan,asin,acos,atan. Graph32 also supports the Co-tangent cot,acot as well as hyperbolic and inverse hyperbolic function sinh,cosh,tanh,coth,asinh,acosh,atanh,acoth  as your plugin works into Graph32 you can also use this functionality. A string like "acosh(x)" is not directly understandable by the OPL eval(string$) keyword. What you should do is use the parsedString$ = parseFunction$:(baseString$) procedure defined into Graph32 to turn baseString$ into a string that eval can understand. Thus eval("cosh(x)") will return an error but eval(parseFunction$:("cosh(x)")) will work, where "cosh(x)" is a string entered by the user.
	b). Modifying Graph32's globals and calling Graph32's procedures
	In order to enable greater interaction with Graph32 and for you to bring new functionality to it, you can modify Graph32's global variables and/or call procedures in Graph32. A detailed list of variables that you can modify and of procedures you can call is available in chapter 3. Modifiying a variable in Graph32 please make sure to read the comment about it in the 3rd chapter in order to reduce the bug probability. procedures you can call are also defined and explained.
3). Graph32's variables and procedures
	a). Global variables
	You should be able to do whatever you want with Graph32 with the variables described after. If you need to know about other variables the please mail me at npiguet@hotmail.com and ask me for it's name.
		i). Cartesian functions variables
y$(7,126)  :  Contains the string entered by the user.
coul%(7)  :  Contains the ID of the color of the function with the corresponding index in the same order as in the function definition dialog.
curwid%(7)  :  Contains the width of the function with the following number.
num%  :  Contains the number of cartesian function that have been defined.
	Variables coul%(x) and curwid%(x) should never be 0 when it is associated with a used cartesian function (ie when x<=num%).

		ii). Polar functions variables
polar$(7,126)  :  Contains the string entered by the user.
polcol%(7)  :  Contains information on the color of the function as for cartesian functions.
polwid%(7)  :  Contains information on the thinkness of the function.
polnum%  :  Contains the number of defined polar functions.
	Variables polcol%(x) and polwid%(x) should never be 0 when it is associated with a defined polar function (ie x<= polnum%)

		iii). Parametrical functions variables
parax$(6,126),paray$(6,126)  :  Contains the string entered by the user for both x and y functions.
parcol%(6)  :  Contains the color of the parametrical function.
parwid%(6)  :  Contains the thickness of the parametrical function.
parnum%  :  The number of defined parametrical functions.
	Variables parcol%(x) and parwid%(x) should never be 0 when it is associated with a defined polar function (ie x<= parnum%)

		iv). Inductive functions variables
induc$(7,126)  :  Contains the inductive functions defined by the user.
indcol%(7)  :  Contains the color of the associated inductive function.
indwid%(7)  :  Contains the thickness of the associated function.
indnum%  :  Contains the number of inductive functions defined.
indsta$(7,255), indsta(7)  :  Contains both the string and the value of the starting point for the 1st iteration of the inductive function.
	Variables indcol%(x) and indwid%(x) should never be 0 when it is associated with a defined inductive function (ie x<= indnum%). Additionally indsta$(x) and indsta(x) should always represent the same value (ie eval(indsta$(x)) = indsta(x))

		v). 3D surface variables
func3D$(125)  :  Contains the 3 dimensional function entered by the user.
coul3D%  :  Contains the color of the border of each polygon of the 3 dimensional function.
coulint3D%  :  Contains the color of the surface of each polygon
type3D%  :  Defines the type of the 3 dimensional function (ie which variable is fixed (z=f(x;y),y=f(x;z) ...)
surftype3D%  :  Defines the shading of the 3D surface
orientation&, inclinaison&  :  are the user defined orientation and tilt angles for the 3D surface
LightAngle&(2)  :  are the user defined orientation (1) and tilt (2) angles for the 3D surfaces light source
3DAxesOrtho%  :  is set to 1 if the axes of the 3D sufaces should have the same number of units per pixel or to 2 if they should be streched to form a cube.
	As for all other functions coul3D%, coulint3D%, type3D% and surftype3D% must all be non-zero before plotting the surface.

		vi). Other variables
diskLetter$(1)  :  Contains the disk letter on which Graph32 is installed
k1,k1$(50) - k6,k6$(50)  :  Contains the user defined constants and the associated strings
red%(x),green%(x),blue%(x)  :  defines the components of the colors associated to x where 1=black, 2=dark gray, 3=light gray, 4= red, 5=dark red, 6=green, 7= dark green, 8=blue, 9=dark blue, 10=cyan, 11=dark cyan, 12=magenta, 13=dark magenta, 14=yellow, 15=dark yellow
mainvisible%  :  indicates which windows is active. $4800 is 2D window is on or $2800 if 3D window is on
	Variables k× and k×$ must always be equivalent, ie k× = eval(k×$).
	b). Procedure names and explanation
axes:  is used to plot all 2D functions as well as the axes.
procn: displays and gives access to the Add/Edit/Delete function dialog box that is displayed when you tap the equations button of the toolbar.
makeChoiceSting$:(carA%, polA%,parA%, indA%) returns a string that can be used in a dChoice, to chose a function between those defined. The parameters repectively tells wether the cartesian, polar, parametric and inductive functions should be included (1) or not (0).
pronc: is used to switch between 2D and 3D view of a function. you should check variable mainvisible% before using it to find out which window is currently is use.
prona: is used to ask the user what 3D function he wants to plot, including determining light sources, surface type and color and axes etc...
determinAxes3D: determins scale and angles of the axis used to plot the 3D surface.
determinLight3D: determins the light source vector according to what the user selected.
Graph3D: plots the 3D suface with the options defined by the user. You should call determinAxes3D: and determinLight3D: before using it to make sure that the axes and the light source are correctly positionned.