home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / xactus.zip / macros / usestl.xc$ / xsmp32 / os2 / uk / usestl.xcd
Text File  |  1994-09-29  |  2KB  |  42 lines

  1. /*************************************************************************
  2.  * Xact macro
  3.  *
  4.  *************************************************************************/
  5.  
  6. Parse Arg window
  7.  
  8.     Say "This macro opens a table document and removes any existing, " ||,
  9.         "column definitions. Then, it defines 3 columns, uses "||,
  10.         "a stylesheet on the table and closes the table window."
  11.  
  12.     tHandle = XR_OpenTab("TABLES\N10G8.XTF")           /* Open the table */
  13.  
  14.     Call delDefinitions tHandle                        /* Remove all column definitions */
  15.  
  16.     If XR_Select(tHandle, 1, 10, 1, 5) = 0 Then Do     /* Select columns 1 - 5 */
  17.         Call XR_SetColTyp tHandle, "DEVL", 1           /* Column 1 = Deviation */
  18.         Call XR_SetColTyp tHandle, "XL", 2             /* Column 2 = X, lower axis */
  19.         Call XR_SetColTyp tHandle, "YL", 4             /* Column 5 = Y, left axis */
  20.     End
  21.  
  22.     /* use the stylesheet and don't rescale */
  23.     gHandle = XR_UseStyleSheet(tHandle, "STSHEET\LINE.STL", 0)
  24.     Call XR_CloseWindow tHandle
  25. Return
  26.  
  27. /*************************************************************************
  28.  * delDefinitions
  29.  *
  30.  * Removes all column definitions of the specified table.
  31.  *************************************************************************/
  32.  
  33. delDefinitions: procedure
  34.     Parse Arg tHandle
  35.  
  36.     Call XR_Select tHandle, "All", "SELECT"        /* select all   */
  37.     Call XR_SetColTyp tHandle, "NONE"              /* remove definitions in selection */
  38.     Call XR_Select tHandle, "All", "DESELECT"      /* deselect all */
  39.  
  40. Return
  41.  
  42.