Use browser tools functions
ToOut01(txt) sends txt string to Out01 (on right).
ClrOut01() clear Out01.
Click Run once then the space bar will push it.
"Fix02" (in table)
giving you a page, some DIV elements and some form elements to use in your
You may use any of the functions from the Creativyst® Browser Tools library of
functions, as well as functions from a special set provided by the
Some Interactive functions are provided for convenience in writing output
to the form functions.
Note that you may just as easily write:
document.forms.Form01.Out01.value = Out01Txt;
But the ToOut...() functions are provided for convenience. They
also work with the clear functions to make the output fields
look like teletypes (though this is more useful on the textarea
than on the small fields).
Where "n" is a number from 1 to 3, writes text
to on of the output fields in Form01 labeled "Out01".
through "Out03" respectively.
Clears the respective output field on Form01.
Other functions and variables are provided to allow you to do things
This variable is bumped every time the button (Btn01) is pushed.
You may test it and reset it as you see fit. Some of you may be
test the button press. Read on.
- UserNum01 and UserString01
Two persistent strings you can store values in without losing
them every time your script ends. You'll understand why
these are needed next.
Normally your script is evaluated once and returns. Because
of this, you can't use the setTimeout() function since
whatever function you set it to call will be long gone
before the timer runs out. The reason for this, as stated
is that you script, along with all the functions it contains,
is evaluated once, and then goes away. LoopSecs() lets
you keep your script going so you can do things over time. It
does this by running all the code after it over and over in
a loop. It will loop through your code continously for the
number of seconds you specify.
The code before it will only be run once when you first hit
the run button. For this reason, LoopSecs() will
often be the first function called at the top of your code.
There are times though, when you'll want to run some
setup code before the code that loops. e.g.
* Loop Secs() example code
* (Cut and paste this into
* the code box to test).
Btn01Val = 0;
* Everything above the call
* is run ONCE when the 'RUN'
* button is first pushed.
/* Everything from here
* down is run continuously
* for the number of seconds
* specified in the LoopSecs(parm).
* Important: Don't put the
* word: 'LoopSecs' in a comment
* above the call, or it will
* try to run everything below
* the point where it shows up
* in the comment string.
Btn01Val = 0;
var t = new Date();
var tm = t.toGMTString();
msX = MouseX(); // from browser tools
msY = MouseY();
tm = tm.substr(17,8);
ToOut01( txt +
": " +
" msX:" +
" msY:" +