For instance, the following text specifies a dynamic triangle with vertices initially positioned at (144, 130), (24, 130), and (84, 20) in the coordinate plane:
{1} Point (144,130);
{2} Point (24,130);
{3} Point (84,20);
{4} Segment (3,1) [thick];
{5} Segment (1,2) [thick];
{6} Segment (2,3) [thick];
In JSPgenerator this becomes:
a=Point(144,130,'')
b=Point(24,130,'')
third=Point(84,20,'')
Segment(third,a,'thick')
Segment(a,b,'thick')
Segment(b,third,'[thick]')
In JSP you reference by number to an element in your construction. This number is the line number of that element. When you are editing your construction you may not insert a line: all references have to be updated. In JSP generator you reference by a unique name, a variable (a variable name starts with a character, after that character are allowed: more characters, digits or underscores _). The optional format string ([thick] in this case) is moved inside the brackets. JSPgenerator allows you to leave out the square brackets but you may also use them. When you don't need a construction to be referenced by another construction it is not necessary to use a variable.
A list of construction names can be found in the file help.htm
| Some JSP constructions need a list of variable length. Such a list of variable length should be placed inside square brackets. For instance ShowButton(5,10,'Show Triangle')(1,2,3) In JSPgenerator this becomes: ShowButton(5,10,'Show Triangle',[1,2,3],'') Constructions involved are Buttons, Locus and Polygon. The name of some JSP constructions contains characters that make the name an invalid Javascript identifier. For instance: Point on object, Origin&Unit, Ratio/Points. | If the invalid character is a space character it is replaced with an underscore(_), otherwise it is simply omitted: Point_on_object, OriginUnit, RatioPoints. |
| Automatic code checking. Consider the following script:
a=Point(100,100,"[label('A')]")
goal=Point(200,200,"[label('goal')]")
MoveButton(10,10,10,"'Move'",[goal,a],'[green]')
Dependent on the possibilities of your browser this can be shortened to:a=Point(100,100,"label(A)") goal=Point(200,200,'label(goal)') MoveButton(10,10,10,'Move',[goal,a],'green')Even some "errors" are corrected: a=Point(100,100,"[label('A)") might be corrected. Try and see what your browser allows.
Saving and loading scripts to your hard disk | Recent versions of Internet Explorer (5 and better) allow Javascript to access your harddisk. In Explorer buttons will show that offer that possibility. If those buttons do not work (you get an error message) it might be helpful to change the settings in the safety tab of the internet options. Look for ActiveX elements. Change the setting to "Ask". In Netscape those buttons will not appear. |