DrawScript Problems and Examples

DrawScript is an extension of BASIC, that is with extra commands, and with the output going to the vector graphics Draw application. So you can write a DrawScript program to draw patterns, diagrams and graphs, for example. For the application with sample programs go to DrawScript Home Page.

There is a file type fault in that saving a new DrawScript file saves it with file type &000, whereas it should be &b9b. One way round this is to change &000 to &b9b in the save box. A better, permananet solution is to change "DrawScript" to "DrwScrpt" in the line "Set File$Type_B9B DrawScript" in each of the files !Boot, !Run and !RunM inside the !DrawScript directory. The problem comes down to the fact that file type names in RISC OS must not exceed 8 characters. A more detailed discussion of the problem can be found in posts on Riscository, DrawScript File Type Problem Discussion.

An example of a graph produced by a DrawScript program is a family of Cassini curves together with the orthogonal family of curves. A brief document (a pdf) about these Cassini curves, includes the graph.

Text output problem

It is possible for a DrawScript program to output text as well as Draw files; but, whereas a program can output to many Draw windows, it appears that it can output to only one text window. A simple DrawScript program illustrates this.
The intention of the program is to draw 3 rectangles, then double all the co-ordinates of the corners of the rectangles and then draw the new double-sized rectangles in a new (second) Draw window. It is also intended that it prints out both the original rectangle data and then the new double-size data in text windows.
Running it from a task window, it correctly produces the two Draw windows and prints out the new double-size data, but not the original data. The same is true if it is run by double-clicking on the program icon.
The Drawscript program and the data file for its input can be downloaded here for the program and here for the data. The program should be given file type &b9b and the data file type &ffd.
For a discussion of the problem see a thread on the RISC OS OPEN forum.