Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Even though the script commands described here were implemented for workbook and worksheet, the Delete flag is general and can be used in graphs as well. For example:

Code Block
titleonly graph4 will be keptDelete all graph windows except Graph4
repeat 10 {win -t plot}; //create 10 graph windows
win -o graph4 {page -lw hex(400)}; //set graph4 protection
doc -e P {win -c}; //Use a loop to delete all graph windows in the opj, Graph4 will be kept because of the protection

...

The following script sets up a workbook with a locked data sheet, and the workbook is also protected from deletion. The OPJ can then be saved and shared with others who can view, graph, and analyze the data, but cannot edit or delete. Analysis results need to go to additional sheets, so routines such as Smooth should use settings to send output to another sheet, as the data sheet will be protected in this example from any modifications. 

Code Block
// Import a sample file

...


newbook;

...


string fname$=system.path.program$+"Samples\Curve Fitting\Gaussian.dat";

...


impasc;

...


// Set password and login - change mypwd to your desired password string

...


doc -pwa mypwd;

...


doc -pw mypwd;

...


// Protect data sheet structure, prevent editing, deleting

...


lay -lw hex(482);

...


// Protect page from deletion

...


page -lw hex(400);

...


// logout

...


doc -pwx;

...


// Now you can save the OPJ and others can view data, graph, and also analyze

...


// Analysis results can go into new sheets, not new cols in same

...

 

 

 

 

...

 sheet