home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / e / e002 / 1.ddi / MACROS.CN_ / MACROS.CN
Encoding:
Text File  |  1993-09-21  |  1.9 KB  |  75 lines

  1.  
  2. /*****************************************************************
  3.  * 
  4.  * 
  5.  The following section contains a number of user-definable macros.
  6.  * 
  7.  * 
  8.  *****************************************************************/
  9.  
  10.  
  11.  
  12. /*
  13.  * UserTool: The last tool in the left
  14.  * column of the Toolbox is user definable.
  15.  * The UserTool defined below does free hand
  16.  * drawing of a data set by double-clicking.
  17.  */
  18.  
  19.  /* An explanation message will display when the
  20.   * user click the UserTool the first time.
  21.   * Please note that if a new document is opened, the macro will stay but
  22.   * variables will not, so that we need to test the existance of this
  23.   * variable at the begining of the macro. 
  24.   * A document carries variables and data, but not macros.
  25.   */
  26.  
  27. def UserTool {
  28.     doTool 0;/* return to the PointerTool first */
  29.     CheckVar FirstTry 0;
  30.     if(FirstTry==0)
  31.     {    /* exist(name) returns 4 if name is a variable */
  32.     type -C This tool is currently defined to use the ScreenReader\
  33.  to "DRAW" data. Move the cursor to the plot and double-click to "Add" new\
  34.  data points. Click any tool to end.;FirstTry=1;
  35.      };
  36.     doc -cs DRAW;Count/=2;/* each draw is two datasets */
  37.     %B=Draw.$(Count+1);
  38.     create %B_B -c 50;
  39.     getpts -new %B_B 50
  40.     (Double-click to add new pt,click any tool to quit);
  41.     def QuitToolBox {if(count==0) (del %B_B)};
  42. }
  43.  
  44. /* Autoexec
  45.  *
  46.  * this is executed if new document is not open
  47.  * from a disk file. Otherwise the macro EndOpen
  48.  * is executed.
  49.  */
  50.  
  51. def autoexec {
  52.     window -T Wks;
  53.     /* create a new data worksheet */
  54.     queue (doc -saved);
  55.     /* turn off the ask to save flag */
  56. }
  57.  
  58.  
  59. def NotReady {
  60.     ty -b "This operation is still under development...";
  61. }
  62.  
  63.  
  64. /* if a document is specified in the command line
  65.  * it is open automatically, after that document
  66.  * is open, the following macro is executed.
  67.  *
  68.  def EndOpen { }
  69.  *
  70.  */
  71.  
  72. /* before a document is deleted from memory */
  73. /* DocEnd */
  74. def DocEnd { } /* do nothing */
  75.