constants object explained

This is the list of the constants that you can use in your script. It is important that the symbolic name of a constant is used instead of the raw value since this is the only vay to avoid spelling errors and allow for future flexibility.

constants.JSE_done

This value is quite often returned by a BlueJscript function when the function has performed its duty correctly.

constants.JSE_failed

This is the value returned if a BlueJscript function fails to perform its duty.

constants.getLoadUrl ( )

Returns the url that loaded the currently running script.

constants.getParentUrl ( )

This is probably the most used of the constants. It returns the parent of the javascript url being executed. If you put BlueJscript code together with a set of web pages you can use this constant to retrieve the pages in a location independent way. Example.

htmlBase=constants.getParentUrl();
print ('htmlBase=',htmlBase,'\n');

html.setSize(300,300);                   // If you want a bigger window

html.load (htmlBase+"/creating0.html");  // Lets load the first slide of the tutorial