home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / autocad / sdikit.arj / SDIKIT.DOC < prev    next >
Encoding:
Text File  |  1991-07-18  |  57.7 KB  |  1,565 lines

  1.  
  2.                     SDI'S SPEED-KITS VOLUME I VERSION 1.5
  3.                      
  4.                           by Software Designs, Inc.
  5.  
  6.  
  7. **************************************************************************
  8. *                                                                        *      
  9. *                                                                        *
  10. *             WELCOME TO THE WORLD OF SDI'S SPEED-KITS!!!                *
  11. *                                                                        *
  12. *  THE FLAGSHIP IN A COMING FLEET OF ULTIMATE LISP PROGRAMMING TOOLS!    *
  13. *                                                                        *
  14. *                                                                        *
  15. *  This package is a demo of the first of many utility routines to       *
  16. *  take you into a new realm of LISP programming for AutoCAD Version 11. *
  17. *  Brace yourself as you experience windows (yes, Virginia, WINDOWS!)    *
  18. *  as a LISP tool with a few flicks of the wrist.  Written in 'C',       *
  19. *  SDI'S SPEED-KIT allows very fast screen writes seamlessly integrated  *
  20. *  into LISP with no hassle!!!  No more clumsy text entry!!!!!!!!!!!!    *
  21. *  Fasten your seatbelt before you see the ease in which low-level       *
  22. *  functions can be used in conjunction with LISP as well as numerous,   *
  23. *  neat drafting utilities to increase your production while             *
  24. *  decreasing your frustration level to nil/NULL!                        *
  25. *                                                                        *
  26. *              Get out of the old and into the NEW!!!!!                  * 
  27. *                                                                        *      
  28. **************************************************************************
  29.  
  30.   Now that we've got your attention, let's get down to business:
  31.      
  32.      SDI'S SPEED KIT I is the first of many packages to be introduced
  33.      over the next several months.  This demonstration will give
  34.      you a taste of the windowing functions that comprise 
  35.      SDI'S SPEED KIT I.  These routines are written in 'C'
  36.      to provide extremely fast text windows extremely easily.  
  37.      All functions are intuitive and therefore very easy to implement.
  38.      When you register, you'll receive a library containing the
  39.      functions listed and explained at the end of this document as
  40.      well as a bunch of other useful window functions.
  41.  
  42.         SDI'S future SPEED-KITS will allow direct, low-level access
  43.      to file functions as well as a number of sorting and data
  44.      manipulation routines.  Our designers have programmed in LISP
  45.      for many years and subsequently have had "Gee, I wish that
  46.      could be done EASILY in LISP" pop into our heads VERY frequently.  
  47.      Actually, we were really saying "I could do it in C in a second; 
  48.      therefore, I wish there was a C/LISP hybrid..."  That's the goal of 
  49.      SDI'S various SPEED-KITS.
  50.  
  51.         Also in the future SPEED-KITS will be user tools to greatly
  52.      increase drafting and programming productivity.  These will
  53.      encompass database manipulation to novel techniques in
  54.      eliminating keystrokes and regen's.  Even if you're not
  55.      a draftsman, they'll be instantly useful (we use them everyday
  56.      and we're programming 95% of the time!)  
  57.  
  58.      More to come in the future...                               
  59.    
  60.  
  61.  
  62. ***************************************************************************
  63.  
  64.  
  65.   Here's all you need to do to run the demo:
  66.  
  67.      1) Copy the files SDIKIT.EXP and DEMO.LSP into a sub-directory.
  68.      2) Run AutoCAD and load the file DEMO.LSP by typing (load "demo")
  69.            at the command prompt. 
  70.      3) Type 'demo'
  71.  
  72.   That's all there is to it!
  73.  
  74.   When you're done with the demo, be sure to read the documentation at
  75.      the end of this file...
  76.  
  77. ****************************************************************************
  78.  
  79.   Now for the (important) miscellaneous stuff...
  80.  
  81.      1) This product is a fully functioning SHAREWARE Version.
  82.            You are free to copy it as much as you want and we encourage
  83.            you to distribute it to colleagues, friends, local BBSs, etc.
  84.            as long as ALL of the files on this disk comprising 
  85.            SDI'S SPEED-KITS I are included.  The Registered Version of 
  86.            this software contains over 30 functions (much more 
  87.            than this shareware version) so it will be worth the money to
  88.            register directly with us.  Although $35 a copy is probably 
  89.            outrageously low for the amount of hours involved in developing
  90.            these kits, we've purposely kept the price as low as possible 
  91.            to attract as many clients as possible.  That's the ballgame 
  92.            in a nutshell - nothing more, nothing less...   
  93.            (P.S. - Please register.)    
  94.  
  95.      2) If you find an error in this software, PLEASE contact us as soon 
  96.            as possible so that we may fix the problem quickly. We can
  97.            be found on Compuserve under 76517,2466 or on BIX under
  98.            Sleonardis.  Most errors will be repaired within a few days. 
  99.            We've beta-tested the software extensively, but...  
  100.  
  101.            Well, you know...
  102.  
  103.  
  104.      3) What you get when you register:
  105.            You will receive the latest registered version 
  106.            of the SDI'S SPEED-KITS VOL. I library, including:
  107.               a) an internal window text editor to use in your LISP
  108.                  applications,
  109.               b) the ability to include help in your functions (via some
  110.                  function key),
  111.               c) audio access,
  112.               d) comprehensive documentation and support (see below for
  113.                  the partial documentation),
  114.               e) much more.
  115.  
  116.            As mentioned, the cost for registration is only $35.00.
  117.  
  118.  
  119.  
  120.          *****************************************
  121.          *        Software Designs, Inc.         *
  122.          *                                       *
  123.          * To receive a registered version       *
  124.          * SDI'S SPEED-KITS VOLUME I, please     *
  125.          * send a check or money order for       *
  126.          * $35.00 to:                            *
  127.          *                                       *
  128.          *        Software Designs, Inc.         *
  129.          *        858 Austerlitz Rd.             *
  130.          *        Paris, Ky. 40361-9055          *
  131.          *                                       *
  132.          * For more information on this or other *
  133.          * products call:                        *
  134.          *                                       *
  135.          *        (606)268-8908                  *
  136.          *    or  (606)987-6129                  *
  137.          *****************************************
  138.  
  139.   What's coming:
  140.      AC utilities ... many programs for DWG'S to come!
  141.      Engineering products (All areas)
  142.      VGA Graphics, Animations and walk-throughs!
  143.      Conversion between other CAD systems!
  144.      Lots more SPEED-KITS!
  145.  
  146.   Software Designs, Inc. is a Registered AutoCAD Developer.
  147.  
  148.   AutoCAD is a registered trademark of Autodesk, Inc.
  149.  
  150.  
  151.  
  152.  
  153.   Thanks for taking the time to investigate SDI'S products.  Be sure
  154.   to look for our other products, AC11TO10 and PURGE, as well as
  155.   future SPEED-KITS....
  156.  
  157.  
  158.  
  159.  
  160. ***************************************************************************
  161.  
  162.  
  163.   Revision History:
  164.   -----------------
  165.  
  166.      Version 1.0 - Initial release
  167.  
  168.      Version 1.2 - Fixed minor bugs and added functions 
  169.  
  170.      Version 1.5 - 
  171.         1.) When using the function '(message..)' the graphics
  172.             screen became mangled. This was repaired.
  173.  
  174.         2.) When using the function '(menu) prior to any other function,
  175.             the computer 'locked up'. This was repaired.
  176.  
  177.         3.) Monochrome cards were incorrectly handled. This was repaired.
  178.  
  179.         4.) 'SAVE_VIDEO' and 'RESTORE_VIDEO' now require an integer
  180.             from 0 to 3 to be passed into each function.  This will
  181.             allow you to save and restore up to four screens.  You
  182.             must be in text mode to use these functions.
  183.  
  184.         5.) TEXTMENU' now requires a list of strings passed into it
  185.             instead of single strings in V1.2.                                                        
  186.  
  187.  
  188.  
  189.  
  190.  
  191. *****************************************************************************
  192. *****************************************************************************
  193. *****************************************************************************
  194.  
  195.  
  196.  
  197.             SDI'S SPEED-KITS VOLUME I MANUAL (SHAREWARE VERSION)
  198.  
  199.  
  200.  
  201.   The functions do not return error codes; rather, they print out an error
  202.   message on the screen describing the type of problem you have and set
  203.   the AutoCAD system variable ERRNO to that error.
  204.  
  205.   **************************************************************************
  206.   *                                                                        *
  207.   *  Many functions require text screen coordinate information passed      *
  208.   *  in the form of row and column. The upper left corner of the screen    *
  209.   *  is the coordinate 1,1. Reference to columns is shown with an 'x' and  *
  210.   *  'y' for rows.                                                         *
  211.   *                                                                        *
  212.   **************************************************************************
  213.  
  214.  
  215.   --------------------------------------------------------------------------
  216.   WINDOW - This function is used to draw windows on the text screen. The 
  217.      color of the window's components are set with the function 'SETCOLORS' 
  218.      (see below). The speed at which the window opens is set with the 
  219.      function 'SETSPEED' (also below).
  220.  
  221.      Use this function with 'DISPLAY' and the cursor routines to make your 
  222.      LISP software very professional-looking.
  223.  
  224.      Usage:  (window x1 y1 x2 y2 height border_type)
  225.         Where     x1 (columns) is left side, 
  226.                   y1 (rows) is the top,  
  227.                   x2 is the right side and 
  228.                   y2 is the bottom. 
  229.         Height values of 0, 1 or 2 cast shadows with the light source 
  230.            appearing from the upper left corner. 
  231.         Border_type  is 0, 1 or 2 depending on whether plain, single-line
  232.            or double-line borders (respectively) are desired.
  233.  
  234.      Returns: Nothing of use.
  235.  
  236.      Example:
  237.         (window 5 5 75 20 1 1) 
  238.  
  239.         Draws a window from the 5th column to the 75th column and from 
  240.         row 5 to row 20. The height for the window is 1 and the
  241.         border is of the double-line type.
  242.  
  243.  
  244.  
  245.  
  246.   --------------------------------------------------------------------------
  247.   DISPLAY - This is a high-speed text display function. The current colors 
  248.      take effect on the string displayed (see 'SETCOLORS' below). Currently, 
  249.      there is no text formatting in this function.
  250.  
  251.      Usage:  (display x y string)
  252.         Where    x is the column and 
  253.                  y is the row. 
  254.  
  255.         The string will be displayed at that coordinate.
  256.  
  257.  
  258.      Returns: Nothing of use.
  259.  
  260.  
  261.      Example:
  262.         (display 5 6 "THIS IS A STRING") 
  263.  
  264.         Will print out the message "THIS IS A STRING" at the 5th column 
  265.         and 6th row.
  266.  
  267.  
  268.  
  269.  
  270.   --------------------------------------------------------------------------
  271.   TEXTMENU - This function is used to allow the user to select one of a
  272.      number of options (23 maximum). A window is automatically created and 
  273.      centered on the screen displaying the options that were passed. You may 
  274.      specify a default option to cause the highlight bar to fall on a 
  275.      specific line.
  276.  
  277.      Usage: 
  278.        (textmenu TITLE_OR_INSTRUCTIONS default (list string string string...))
  279.  
  280.         The first parameter to this function will be centered at the top of
  281.         the window (generally used as a label).  The default is a number 
  282.         assigned for the initial highlight bar to appear on (ie. the 1st 
  283.         string, the 2nd string ,the 3rd string...). The last parameter is the 
  284.         list of strings to be displayed.
  285.  
  286.      Returns: An integer corresponding to the option chosen, or one of
  287.         the following scan codes:
  288.  
  289.         If the Escape key was hit -   283
  290.         If F10        key was hit - 17408
  291.         If the CANCEL key was hit - 11779
  292.  
  293.      Example:
  294.         (setq number 
  295.            (textmenu "Please Select an Automobile" 3
  296.               (list
  297.                  "Toyota"
  298.                  "Chevrolet"
  299.                  "Ford"
  300.               )
  301.            )
  302.         )
  303.         (cond
  304.            ((= number 1)
  305.               (....They've selected "Toyota" )
  306.            )
  307.            ((= number 2)
  308.               (....They've selected "Chevrolet" )
  309.            )
  310.            ((= number 3)
  311.               (....They've selected "Ford" )
  312.            )
  313.            ((= number 283)
  314.               (....They've hit the ESCAPE key )
  315.            )
  316.            ((= number 17408)
  317.               (....They've hit the F10    key )
  318.            )
  319.            ((= number 11779)
  320.               (....They've hit the ESCAPE key )
  321.            )
  322.            (t nil)
  323.         )
  324.  
  325.  
  326.      A window is automatically created and centered with the current
  327.      colors in affect at the current SPEED. Here the default choice
  328.      is "Ford" since it is the 3rd option in the list.
  329.      Textmenu will return the number associated with the item or one
  330.      of three keys: ESCAPE, CANCEL or F10.
  331.  
  332.  
  333.  
  334.  
  335.  
  336.   --------------------------------------------------------------------------
  337.   SETSPEED - This function takes one argument as an integer for the time 
  338.      delay while opening windows. Typically around 200. If passed a value 
  339.      of 99, the function will NOT set the value but simply returns the 
  340.      current value. Negative numbers are not allowed.  The size of the 
  341.      number will be directly proportional to the speed that the window 
  342.      will open; simply, larger numbers will produce slower-opening windows.  
  343.      Typically set to somewhere around 200.
  344.  
  345.      Usage: (setspeed integer)
  346.  
  347.      Returns: The current value set.
  348.  
  349.      Example:
  350.         (setq oldspeed (setspeed 99)) ;Gets the current value.
  351.         (setspeed 300)                ;Set the speed to 300.
  352.         (window 5 5 10 10 1 2)        ;Window opens slowly.
  353.         (setspeed speed)              ;Put the old speed back in
  354.  
  355.  
  356.  
  357.  
  358.   --------------------------------------------------------------------------
  359.   MESSAGE - Opens a window centered on the screen and displays the message 
  360.      passed using the current colors in effect. The function takes two
  361.      arguments as (message "the message" flag). The last argument is
  362.      a numeric value of 0 or 1. If the value is 0 the function will stop,
  363.      wait for the user to hit a key, close the message window and return
  364.      the scan code for that key.  If the flag is nonzero the function will 
  365.      wait for a key stroke and return that key stroke to lisp as an integer.
  366.  
  367.      Usage: (message string flag)
  368.  
  369.      Returns: The key stroke entered or nil if no flag set.
  370.  
  371.      Example:
  372.       (message "Print this message in the center of the screen and wait" 1)
  373.  
  374.       This will wait for a key stroke and return it to LISP.
  375.  
  376.  
  377.       (message "Print this message in the center of the screen, don't wait" 1)
  378.  
  379.       This will open a window, center the message within it and return
  380.       to the LISP routine that called it.
  381.  
  382.  
  383.  
  384.  
  385.   --------------------------------------------------------------------------
  386.   NOCURSOR - Simply turns the cursor off.
  387.  
  388.      Usage: (nocursor)
  389.  
  390.      Returns: Nothing of use.
  391.  
  392.      Example:
  393.         (nocursor)  
  394.  
  395.         Just turned the cursor off.
  396.  
  397.  
  398.  
  399.  
  400.   --------------------------------------------------------------------------
  401.   ONCURSOR - Simply turns the cursor on.
  402.  
  403.      Usage: (oncursor)
  404.  
  405.      Returns: Nothing of use.
  406.  
  407.      Example:
  408.         (oncursor) 
  409.  
  410.         Just turned the cursor on.
  411.  
  412.  
  413.  
  414.  
  415.   --------------------------------------------------------------------------
  416.   GETCURS - This will return the current cursor position as (x y) column 
  417.      and row.
  418.  
  419.      Usage: (getcurs)
  420.  
  421.      Returns: The current cursor position as a list.
  422.  
  423.      Example: 
  424.         (setq place (getcurs))
  425.         
  426.         Place might now have the value (5 6) for the 5 column and 6th row.
  427.  
  428.  
  429.  
  430.  
  431.   --------------------------------------------------------------------------
  432.   SETCURS - This function takes two arguments as column and row and places
  433.      the cursor at that position.
  434.  
  435.      Usage: (setcurs)
  436.  
  437.      Returns: Nothing of use.
  438.  
  439.      Example: 
  440.         (setcurs 5 6)
  441.         
  442.         This sets the cursor to the 5th column and 6th row.
  443.  
  444.  
  445.  
  446.  
  447.  
  448.   --------------------------------------------------------------------------
  449.   CLS - Clears the screen with the current background color in affect.
  450.  
  451.      Usage: (cls)
  452.  
  453.      Returns: Nothing of use.
  454.  
  455.      Example: 
  456.         (cls)
  457.  
  458.         It's handy to define (defun c:cls() (cls) (prin1)).
  459.  
  460.  
  461.  
  462.  
  463.   --------------------------------------------------------------------------
  464.   SETCOLORS - This is the routine to set the colors for all of the video 
  465.      functions in this package.  There are 6 parameters to pass to the 
  466.      function within the range of 0-15. This is the order in which they 
  467.      are defined:
  468.  
  469.             1)  FORWARD TEXT COLOR
  470.             2)  BACKGROUND COLOR
  471.             3)  BORDER BACKGROUND COLOR
  472.             4)  BORDER TEXT COLOR
  473.             5)  HIGHLIGHTED TEXT COLOR
  474.             6)  HIGHLIGHTED BACKGROUND COLOR
  475.  
  476.      The range for all colors is 0 - 15. When a window is created on
  477.      the screen it will have a border color of BORDER BACKGROUND COLOR
  478.      and border lines of BORDER TEXT COLOR. The center of the window
  479.      will be of color BACKGROUND COLOR. Any text displayed in the
  480.      window will be of color FORWARD TEXT COLOR. For any function with
  481.      slide bars (such as textmenu) the highlighted bar will be of color
  482.      HIGHLIGHT BACKGROUND COLOR and the text within the bar will be of
  483.      color HIGHLIGHT TEXT COLOR.
  484.  
  485.      NOTE: If the background color is set to number greater than 7
  486.         then blinking text appears.
  487.  
  488.  
  489.      Usage: (setcolors first second third fourth fifth sixth)
  490.  
  491.      Returns: Nothing of use.
  492.  
  493.      Example:
  494.         (setcolors
  495.            _WHITE                    ;FORWARD TEXT COLOR
  496.            _BLUE ;<<--- FOR CLS      ;BACKGROUND COLOR
  497.            _RED                      ;BORDER BACKGROUND COLOR
  498.            _WHITE                    ;BORDER TEXT COLOR
  499.            _BLACK                    ;HIGHLIGHTED TEXT COLOR
  500.            _CYAN                     ;HIGHLIGHTED BACKGROUND COLOR
  501.         )
  502.  
  503.         Where the global variables are set as:
  504.            (setq 
  505.               _BLACK 0
  506.               _BLUE 1
  507.               _GREEN 2
  508.               _CYAN 3
  509.               _RED 4
  510.               _MAGENTA 5
  511.               _BROWN 6
  512.               _LIGHTGRAY 7
  513.               _DARKGRAY 8
  514.               _LIGHTBLUE 9
  515.               _LIGHTGREEN 10
  516.               _LIGHTCYAN 11
  517.               _LIGHTRED 12
  518.               _LIGHTMAGENTA 13
  519.               _YELLOW 14
  520.               _WHITE 15
  521.            )
  522.  
  523.  
  524.  
  525.  
  526.   --------------------------------------------------------------------------
  527.   SAVE_VIDEO - Saves the screen into one of four banks (0,1,2 or 3) which
  528.      can be restored with the RESTORE_VIDEO function. The function
  529.      is neseccary for flipping screens into the graphics mode and
  530.      returning by (textscr). This is the only way to retrieve the
  531.      screen.
  532.  
  533.      Usage: (save_video)
  534.  
  535.      Returns: Nothing of use.
  536.  
  537.      Example:
  538.         (save_video 0)        ;Saves the text screen in bank 0.
  539.         (command "zoom" "e")  ;Causes screen to flip to graphics
  540.         (textscr)             ;Be sure to move back to textmode.
  541.         (restore_video 0)     ;Restores it to previous state.
  542.  
  543.         You'll receive an error if you try to save the screen while
  544.         in the graphics mode (use 'TEXT_SCR').
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.   --------------------------------------------------------------------------
  552.   RESTORE_VIDEO - Restores the video screen to the screen saved in the
  553.      the designated bank.  See 'SAVE_SCRREEN'.
  554.  
  555.      Usage: (restore_video bank)
  556.  
  557.      Returns: Nothing of use.
  558.  
  559.      Example: 
  560.         (save_video)
  561.         (graphscr 2)
  562.         (command "line" deltax deltay "")
  563.         (textscr)  ;Must call prior to restoring!
  564.         (restore_video)
  565.  
  566.         As with 'SAVE_SCREEN', you must be in text mode to perform this!...
  567.            (again, use 'TEXT_SCR')
  568.  
  569.  
  570.  
  571. *****************************************************************************
  572. *****************************************************************************
  573. *****************************************************************************
  574.  
  575.  
  576.                      REGISTERED PORTION ONLY
  577.  
  578.  
  579.  
  580. DEBUGGING AND DEVELOPMENT INFORMATION -
  581.  
  582.  
  583.   When writing your applications you should work with the debugger on. 
  584.   The debugger is normally off. The debug function will cause messages
  585.   to appear on the screen when an error has occured. The message will be
  586.   displayed in a window and a keystroke will be required before returning.
  587.   If the error occurs while in graphics mode, the text is displayed as
  588.   standard text at the command line and a keystroke will be required before 
  589.   returning. 
  590.   
  591.   Enabling DEBUG mode opens a tracing file in the current directory. Each
  592.   time an SDI routine is called, the file is appended with the name of 
  593.   function called. This helps to trace larger LISP programs to determine
  594.   where the error occured.
  595.   
  596.   With DEBUG off, no messages are displayed and no trace file is opened.
  597.  
  598.  
  599.   VARIABLES -
  600.   ------------
  601.   There are a number of variables in the system which affect
  602.   some of the functions. These are listed below.  Variables which accept 
  603.   a single numeric value have a special 99 code used exclusively for the
  604.   retrieval of a variable's value. 
  605.                         
  606.  
  607.  
  608.   FUNCTIONS -
  609.   ------------
  610.  
  611.   SETSTART - This function sets a value signifying where the initial slide
  612.      bar will appear in the function 'SELECT'. 
  613.  
  614.  
  615.      Usage: (setstart position)
  616.  
  617.      Returns: The current value of START.
  618.  
  619.      Example:
  620.         (setq oldstart (setstart 99)) ;Get the old value..do not set it!
  621.         (setstart 3)                  ;Set the third parameter to be default
  622.         (window x1 y1 x2 y2 1 2)      ;Pop a window for 'SELECT'
  623.         (setq answer
  624.            (select 
  625.               (LIST       
  626.               "LINE"
  627.               "POLYLINE"  
  628.               "CIRCLE"
  629.               "TEXT"      
  630.               "3DFACE"
  631.               )
  632.            )
  633.         )
  634.         (setstart oldstart) ; Puts the variable back to original state.
  635.                   __________
  636.                  |          |
  637.                  |LINE      |
  638.                  |POLYLINE  |
  639.                  |CIRCLE    | <<---highlight bar appears on CIRCLE
  640.                  |TEXT      |
  641.                  |3DFACE    |
  642.                  |__________|
  643.  
  644.  
  645.  
  646.   --------------------------------------------------------------------------
  647.   SETDENYS - This is a list of keys maintained in the system for use by
  648.      the functions 'EDIT' and 'TEXTMENU'. The initial value of the list upon
  649.      entry is (0 ESCAPE CANCEL F10). This list of keys will not be processed
  650.      by the function ('EDIT' or 'TEXTMENU') but rather cause the function to
  651.      return that key.  Please excuse the spelling on this one - 'SETDENIES'
  652.      didn't seem quite right...
  653.  
  654.      Usage: (setdenys (list-of-keys))
  655.  
  656.      Returns: Nothing.
  657.  
  658.      Example:
  659.         (setq
  660.            _F1            15104
  661.            _F2            15360
  662.            _F3            15616
  663.            _CANCEL        11779
  664.         )
  665.         (window 12 10 64 16 1 2)
  666.         (title 0 " F1 - Help    F2 - Print    F3 - Quit ");
  667.         (setdenys (list F1 F2 F3 CANCEL))
  668.         (setq ret (edit lst) i 0)
  669.         (nocursor)
  670.         (setq key (car ret))
  671.         (cond 
  672.            ((= key _F1)
  673.               .... They entered the F1 key in the editor.
  674.            )
  675.            ((= key _F2)
  676.               .... They entered the F2 key in the editor.
  677.            )
  678.            ((= key _F3)
  679.               .... They entered the F2 key in the editor.
  680.            )
  681.            ((= key _CANCEL)
  682.               .... They entered the F3 key in the editor.
  683.            )
  684.         )
  685.  
  686.  
  687.  
  688.   --------------------------------------------------------------------------
  689.   SETSCROLL - This variable is used in the 'SCROLL' function only.
  690.      The scroll function will operate in 3 modes:
  691.            0   -  Scrolls text left/right and up/down.
  692.            1   -  Causes LEFT and RIGHT keys to be 'denied' from processing
  693.                   and forces 'SCROLL' to return them. Scroll up/down only.
  694.            2   -  Causes 'SCROLL' to lock into up/down only. Does not
  695.                   return on LEFT and RIGHT keys. Uses a scroll bar for
  696.                   position only (disable scroll bar by masking the colors).
  697.  
  698.      See 'SCROLL' for more information. Use the magic 99 code to retrieve
  699.      the value without setting it.
  700.  
  701.      Usage: (setscroll scroll-bit)
  702.  
  703.      Returns: The current SCROLL bit value. 
  704.  
  705.      Example: 
  706.            (setq oldbit (setscroll 99))      ;Save the SCROLL bit value
  707.            (window  x1 y1 x2 y2  1 2)        ;Pop a window
  708.            (title 0 " USE <-> AND UP/DN ")   ;Title top of window
  709.            (title 1 " Escape always exits ") ;Title bottom of window
  710.            (setscroll 2)                     ;Set the scroll bit for 
  711.                                              ;UP/DOWN only!
  712.            (setq answer
  713.               (scroll 
  714.                  (list
  715.                  "This  is an example of the scroll"
  716.                  "routine for use in  AutoLISP.  To"
  717.                  "bad we didn't  have this kind  of"
  718.                  "stuff in Version 9 and 10, right?"
  719.                  "  "
  720.                  "I suppose one use of the function"
  721.                  "could be for help."
  722.                  " "
  723.                  "Another use might be for reading"
  724.                  "up text files or something to be"
  725.                  "displayed with certain menus in"
  726.                  "action. Each menu having it's own"
  727.                  "text file related to it"
  728.                  )
  729.               )
  730.            )
  731.            (setscroll oldbit)
  732.  
  733.  
  734.  
  735.   --------------------------------------------------------------------------
  736.   SET_NUMERIC - This variable is used in the editor only. It causes the 
  737.      editor to accept only numeric keystrokes (0,1,2,3... E e + -). This is
  738.      primarily used for numeric field entry only. The values for NUMERIC
  739.      are 0 and 1 only, representing ON and OFF, respectively. Uses the 99
  740.      code value for returning only.
  741.  
  742.      Usage: (setnumeric on-off-flag)
  743.  
  744.      Returns: The current NUMERIC value.
  745.  
  746.      Example:
  747.         (cls)                            ;Clear the screen
  748.         (setspeed 50)                    ;Set the window open speed to 50
  749.         (window 10 12 65 14 1 1)         ;Pop a window
  750.         (title 1 " Cancel to exit ")     ;Label the window bottom
  751.         (title 0 " This is a numeric entry test! ")  ;Label the top
  752.         (setnumeric 1)                        ;Set the editor to numeric only
  753.         (relative 1)                          ;Make printing relative to window
  754.         (display 1 1 "Enter a number: ")      ;print the instructions
  755.         (setupbox 28 13 63 13)                  ;Set up an edit box...
  756.                                                 ;  not a window!
  757.         (setdenys (list _CANCEL _SPACE _ENTER)) ;Set up the return keys
  758.         (cleanup)                               ;Forces the editor to accept 
  759.                                                 ;  the box not window..!
  760.         (setq lst (list ""))                    ;No default value
  761.         (while (/= key _CANCEL)                 ;Test until they CANCEL
  762.            (setq ret(EDIT lst))                 ;Get return list from editor
  763.            (setq value  (cdr ret))              ;Strip out the value
  764.            (setq  key (car ret))                ;Was it CANCEL/ENTER/SPACE?
  765.            (display 28 13 (rtos (nth 0 value )  ;Evaluate the
  766.               (getvar "LUNITS") (getvar "LUPREC")) ;value
  767.            )
  768.         )
  769.         (setnumeric 0)             ;Set the editor to text mode
  770.  
  771.  
  772.  
  773.  
  774.   --------------------------------------------------------------------------
  775.   RELATIVE - When 'RELATIVE' is on 'DISPLAY's coordinates are adjusted to the
  776.      last window. Use the 99 code to retrieve the value without setting.
  777.      Value is 1=ON 0=OFF.
  778.  
  779.  
  780.      Usage: (relative on-off-flag)
  781.  
  782.  
  783.      Returns: The current value of RELATIVE.
  784.  
  785.      Example:
  786.         Using 'RELATIVE' set to 'ON':
  787.          (window 10 12 65 14 1 1)         ;Pop a window
  788.          (relative 1)                     ;Make printing relative to window
  789.          (display 1 1 "Enter a number: ") ;print the instructions
  790.                     _____________________
  791.                    |                     |
  792.                    | Enter a number:     |
  793.                    |_____________________|
  794.  
  795.  
  796.  
  797.  
  798.         Using 'RELATIVE' set to 'OFF':
  799.          (window 10 12 65 14 1 1)         ;Pop a window
  800.          (relative 0)                     ;Make printing relative to screen
  801.          (display 1 1 "Hello world ")     ;print the instructions
  802.    _____________________________________________________________
  803.   |                                                             |        
  804.   |Hello world                                                  |
  805.   |                    ___________________                      |
  806.   |                   |                   |                     |
  807.   |                   |                   |                     |
  808.   |                   |                   |                     |
  809.   |                   |___________________|                     |
  810.   |                                                             |
  811.   |                                                             |
  812.   |                                                             |
  813.   |                                                             |
  814.   |                                                             |
  815.   |                                                             |
  816.   |                                                             |
  817.   |                                                             |
  818.   |_____________________________________________________________|
  819.  
  820.  
  821.  
  822.   --------------------------------------------------------------------------
  823.   SETSIDES - This function is for use with 'SELECT' only. It is a single
  824.      key deny for the LEFT and RIGHT keys. The values are 0 = OFF and
  825.      1 = ON. When ON, the 'SELECT' function will return LEFT or RIGHT
  826.      if either key is struck. If OFF, the 'SELECT' function will do nothing
  827.      if these keys are struck. Use the magic 99 code to retrieve the
  828.      current value without setting it. Default value is 1.
  829.  
  830.      Usage: (setsides on-off-flag)
  831.       
  832.      Returns: The current value of SIDES.
  833.  
  834.      Example:
  835.          (window  x1 y1 x2 y2 1 2)     ;Pop a window
  836.          (title 0 " Scroll Up/Down ")  ;Label the top
  837.          (setsides 0)                  ;Disable LEFT/RIGHT keys
  838.          (while (< answer 6)
  839.             (setq answer 
  840.               (SELECT
  841.                (list
  842.                "LINE" "CIRCLE" "TEXT" "DIMENSION" "ATTRIBUTE DEFINITION"
  843.                )
  844.          ))
  845.          (cond
  846.             ((= answer 0)
  847.                (message "CHOOSE LINE!" 0)
  848.             )
  849.             ((= answer 1)
  850.                (message "CHOOSE CIRCLE!" 0)
  851.             )
  852.             .
  853.             .
  854.             .
  855.  
  856.  
  857.  
  858.  
  859.   --------------------------------------------------------------------------
  860.   SETUPBOX - This is an imaginary window for use with the editor. The 
  861.      editor will react to the last window in the system before an imaginary
  862.      box. Therefore in order to make the box work you must call 'CLEANUP'
  863.      to release the window from control. 'SETUPBOX' accepts the four corners
  864.      for an imaginary window as left column, top row, right column and
  865.      bottom row.
  866.  
  867.      Usage: (setupbox x1 y1 x2 y2)
  868.  
  869.      Returns: Nothing.
  870.  
  871.      Example:
  872.          (window 5 5 75 20 1 2)    ;Pop a window
  873.          (setupbox 14 10 63 16)    ;Create a box within the window to work in
  874.          (cleanup)                 ;Release the window from control to edit
  875.          (setq lst (list           ;Lines of text to be edited.
  876.                      "This just a few lines of text to be edited upon.  "
  877.                      "Note: You don't have to use a window to use the   "
  878.                      "editor! The lines of text returned to you are the "
  879.                      "exact lines of text that appear with the box      "
  880.                      "defined if no window was used! If a window was    "
  881.                      "used, then there is no need to set up the box.    "
  882.                      "   F10 ESCAPE OR CANCEL will allow you to exit.   "
  883.          ))
  884.          (setdenys editlist)       ;Set up the editor's keys
  885.          (setq ret (edit lst)       ;Edit the list within the SETUPBOX region
  886.            strings (cdr ret)        ;Get the edited strings
  887.            ret (car ret)           ;How did they exit?
  888.          )
  889.          (cls)                     ;Clear the whole screen
  890.          .
  891.          .
  892.          .
  893.  
  894.  
  895.  
  896.  
  897.   --------------------------------------------------------------------------
  898.   CLEANUP - This function takes no arguments. It simply removes
  899.      control of the last window from all functions. For example, if 
  900.      'RELATIVE' printing was on and 'WINDOW' was called once, 'DISPLAY' would
  901.      print text relative to that last window (even if it is no longer on
  902.      screen), but if 'CLEANUP' were called between the 'WINDOW' and 'DISPLAY',
  903.      DISPLAY text would be relative to the entire screen only (Whew!). This 
  904.      function is primarily used with 'EDIT' to cause the 'SETUPBOX's imaginary 
  905.      box to take control rather than the last window.
  906.  
  907.      Usage: (cleanup)
  908.  
  909.      Returns: Nothing.
  910.  
  911.      Example: See SETUPBOX above.
  912.  
  913.  
  914.  
  915.  
  916.   --------------------------------------------------------------------------
  917.   EDITBOX - This is the text and field editor for the kit. The function
  918.      accepts only a list of strings to be edited and displays them in the 
  919.      current window (or setupbox if 'CLEANUP' was called) waiting to be 
  920.      edited. The only exit from the routine is in the last DENIAL list setup. 
  921.      NOTE: As a safeguard from being trapped in the editor, the key ALT-F1
  922.            will always allow you to exit if DEBUG is ON.
  923.  
  924.      The editor is a simple boundary editor which currently does not support
  925.      new lines, wrapping or scrolling.
  926.  
  927.      The following keys are predefined:
  928.         INSERT: Toggles INSERT/OVERSTRIKE mode.
  929.         HOME:   Places the cursor at the beginning of the line.
  930.         END:    Places the cursor at the end of the line.
  931.         DELETE: Deletes the character at the cursor position and pulls the
  932.                 string left by 1 char.
  933.         PGUP:   Places the cursor at the top-most part of the box.
  934.         PGDN:   Places the cursor at the bottom-most part of the box.
  935.         BKSPCE: Erases the character to the left of the cursor and moves
  936.                 the cursor to the left.
  937.         RIGHT/LEFT: Moves the cursor left and right without erasing text.
  938.         TAB:    Move the cursor 5 spaces to the right...No tab charactor
  939.                 is inserted.
  940.  
  941.      Note: Most editors will insert a new line of text if the ENTER key
  942.            is struck while in INSERT mode. This editor never creates new
  943.            lines.
  944.  
  945.      Usage: (edit (list-of-strings))
  946.  
  947.  
  948.      Returns: A list of (scan code of exiting key '(list of edited strings)).
  949.  
  950.      Example:
  951.         (setq 
  952.            _F10           17408
  953.            _ESCKEY        283
  954.            _ENTER         7181
  955.            _CANCEL        11779
  956.          )
  957.          (setdenys '(ESCAPE CANCEL F10))   ;Set up the editors keys
  958.          (window 5 5 75 20 1 2)            ;Pop a window
  959.          (title 0 " F10 Save ESC - Quit ") ;Label the top
  960.          (setupbox 14 10 63 16)    ;Create a box within the window to work in
  961.          (cleanup)                 ;Release the window from control to edit
  962.          (setq lst (list           ;Lines of text to be edited.
  963.                      "This just a few lines of text to be edited upon.  "
  964.                      "Note: You don't have to use a window to use the   "
  965.                      "editor! The lines of text returned to you are the "
  966.                      "exact lines of text that appear in with the box   "
  967.                      "defined if no window was used! If a window was    "
  968.                      "used, then there is no need to set up the box.    "
  969.                      "   F10 ESCAPE OR CANCEL will allow you to exit.   "
  970.          ))
  971.          (setq ret(edit lst) ;Edit the list within the SETUPBOX region
  972.            strings(cdr ret)        ;Get the edited strings
  973.            ret (car ret)           ;How did they exit?
  974.          )
  975.          (CLS)               ;Clear the whole screen
  976.          .
  977.          .
  978.          .
  979.  
  980.  
  981.   SPECIAL NOTE ON EDIT: This editor is sure to change. We are currently
  982.      working on a full-blown editor which allows scrolling, wrapping,
  983.      line insertion and, especially, full control from LISP!
  984.  
  985.  
  986.  
  987.  
  988.   --------------------------------------------------------------------------
  989.   FILLBACK - This function takes one numeric argument, 1 or 0. If passed
  990.      1, the last window (or full screen if 'CLEANUP' or no window was called)
  991.      will be filled with the extended character ascii 176 and a border of
  992.      double lines. If the value is 0, no border is drawn. 
  993.  
  994.      Usage: (fillback border-flag)
  995.  
  996.      Returns: Nothing.
  997.  
  998.      Example:
  999.          (setvar "CMDECHO" 0)      ;Kill the comments
  1000.          (cleanup)                 ;Make sure we have a full screen
  1001.          (save_video 2)            ;Save it before we change it
  1002.          (nocursor)                ;Kill the cursor
  1003.          (setspeed 0)              ;Set the speed to FAST
  1004.          (fillback 1)              ;Fill the screen with background
  1005.          (window 5 20 75 22 1 2)   ;Pop a window
  1006.          (center 
  1007.            " USE LEFT AND RIGHT KEYS   F10 EXITS THE PROGRAM ") ;Show help
  1008.          (window 1 1 80 3 1 2) ;Pop a window
  1009.          (settop " EDIT " " SELECT " " SCROLL BIT " " READ ") ;Set bar
  1010.          .
  1011.          .
  1012.          .
  1013.  
  1014.  
  1015.  
  1016.   --------------------------------------------------------------------------
  1017.   SETTOP - This function takes strings to be displayed as arguments which
  1018.      will be used by the menuing system. Up to 6 menu pull-down strings 
  1019.      are allowed.  The function will equally space the strings across the 
  1020.      top of screen.  This function should be called only once in a menuing 
  1021.      system. This function is intrinsically linked with the function 
  1022.      'DO_TOP_BAR' and must be set up prior to the 'DO_TOP_BAR' call.
  1023.  
  1024.      Usage: (settop label-string label-string ...)
  1025.  
  1026.      Returns: Nothing of interest.
  1027.  
  1028.      Example:
  1029.         (defun c:MENUPULL(/ lst num exitkey)
  1030.         (screenblue1)        ;A predefined function for color setting.
  1031.         (setvar "CMDECHO" 0) ;Kill the comments.
  1032.         (cleanup)      ;Make sure no active window for FILLBACK
  1033.         (save_video 2)  ;Save the video in bank number 2 for restoring
  1034.         (nocursor)     ;Kill the cursor
  1035.         (setscroll 1)  ;Set the scroller up to return LEFT/RIGHT keys
  1036.         (setspeed 0)   ;Set the speed to FAST!
  1037.         (fillback 1)   ;Fill the whole screen with background
  1038.         (window 5 20 75 22 1 2);Pop the help window
  1039.         (center " USE LEFT AND RIGHT KEYS   F10 EXITS THE PROGRAM ");
  1040.         (window 1 1 80 3 1 2);Pop the pull down window
  1041.         (settop " FILES " " DRAW " " CONVERT " " SETUP ") ;Prints
  1042.                  ;the top strings and sets up the internal bar slider
  1043.         (save_video 0)  ;Make a snapshot for interleaf to operate with
  1044.         (setq lst (list '(one) '(two) '(four) '(three) ) ;Four corresponding
  1045.                                                      ;functions for top
  1046.           exitkey _F10          ;Only way to exit the menuing system
  1047.         )
  1048.         (interlea lst exitkey)  ;Set the wheels in motion!
  1049.         (oncursor)              ;Turn the cursor back on
  1050.         (restore_video 2)       ;Give it to them like they left it!
  1051.         (prin1)                 ;Be quiet...
  1052.         )
  1053.  ____________________________________________________________________________
  1054. |                                                                            |
  1055. |  ________________________________________________________________________  |
  1056. | |                                                                        | |
  1057. | |     FILES             DRAW            CONVERT             SETUP        | |
  1058. | |________________________________________________________________________| |
  1059. |             The second window opened ^^                                    |
  1060. |                                                                            |
  1061. |                                                                            |
  1062. |                                                                            |
  1063. |                                                                            |
  1064. |                                                                            |
  1065. |                                                                            |
  1066. |                                                                            |
  1067. |                                                                            |
  1068. |                                                                            |
  1069. |                                                                            |
  1070. |                                                                            |
  1071. |   __________________________________________________________________       |
  1072. |  |                                                                  |      |
  1073. |  |        USE LEFT AND RIGHT KEYS    F10 EXITS THE PROGRAM          |      |
  1074. |  |__________________________________________________________________|      |
  1075. |                        The first window opened ^^                          |
  1076. |                                                                            |
  1077. |                                                                            |
  1078. |                                                                            |
  1079. |____________________________________________________________________________|
  1080.                   Whole screen ^^                                         
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.   --------------------------------------------------------------------------
  1087.   DOTOP - This function is used within the function interleaf to drive
  1088.      the menuing system. Once 'SETTOP' is called (see example above), a call
  1089.      to 'DOTOP' will highlight the first option on the top 'MENU BAR' and
  1090.      wait for a key stroke. If the keystroke is a LEFT or RIGHT key, the
  1091.      function will unhighlight the current option and highlight the 
  1092.      next chosen option. The function does full wrap around. If the 
  1093.      function is replied to by an <ENTER> keystroke, it returns an integer 
  1094.      corresponding to the strings passed into 'SETTOP' (0 is the first string, 
  1095.      1 is the second etc.)  This function accepts one argument as an integer 
  1096.      which represents a keystroke. This allows a function (in LISP) to pass 
  1097.      a RIGHTKEY into 'DOTOP'. 'DOTOP' will process that key as if it were entered 
  1098.      with the function itself. This is what allows the menuing system to move 
  1099.      from one pull-down to the next with popped windows! 
  1100.  
  1101.  
  1102.      Usage: (dotop key-pushed)
  1103.  
  1104.      Returns: An integer corresponding to a string on top (function).
  1105.  
  1106.      Example:
  1107.         (defun interleaf(funclist exitkey / flag key r j iloop numfuncs)
  1108.         (setq flag 'T key -1 r 0 j 0 iloop 'T  ;Force one entry
  1109.           numfuncs (length funclist)  ;Count how many functions are in system
  1110.         )
  1111.         (while iloop
  1112.           (setq r 0 j 0)
  1113.           (while flag
  1114.              (if (= key r)
  1115.                 (progn
  1116.                    (setq j (eval (nth r funclist) )) ;Each function returns
  1117.                 )                                    ;a key stroke.
  1118.                 (setq r (1+ r))   ;Otherwise not this function
  1119.              )
  1120.              (if (and (< r numfuncs)(= j 0))  ;Jump back to DOTOP?
  1121.                 (setq flag 't)
  1122.                 (setq flag nil)
  1123.              )
  1124.           )
  1125.           (setq flag 't)
  1126.           (if (or (= key exitkey)(/= 0 (getvar "ERRNO")))  ;Check status!
  1127.              (setq iloop nil)
  1128.              (progn
  1129.                 (restore_video 0)     ;Gives the illusion of self maintainance
  1130.                 (setq key (dotop j)) ;Get the next function or exit key!
  1131.              )
  1132.           )
  1133.         )
  1134.         (princ)
  1135.         )
  1136.  
  1137.      Note: Due to the complexity of the menuing system it is advised that
  1138.            you simply use the interleaf function as supplied until you
  1139.            feel comfortable with it's operation. Use the existing menuing
  1140.            system as a template for creating your own system!
  1141.  
  1142.  
  1143.   --------------------------------------------------------------------------
  1144.   KEYCHECK - This is a low-level keyboard checking routine. This function
  1145.      will read the keyboard buffer and return its results as a scan code.
  1146.      (use 'CASTCHAR' to convert to a character if needed). The function 
  1147.      takes one argument, 1 or 0. If passed a 0, the function will wait
  1148.      until a key is struck and return the scan code value for that key.
  1149.      If passed a 1, the function will simply test to see if a key has been
  1150.      struck and return the scan code value for that key or 0 if no key 
  1151.      was struck.
  1152.  
  1153.      Note: This function is sheltered from AutoCAD's flip screen, orthmode,
  1154.            snap etc. The function will return the value of those keys rather
  1155.            than process them.
  1156.  
  1157.  
  1158.      Usage: (keycheck wait-flag)
  1159.  
  1160.  
  1161.      Returns: The integer code for the key struck or 0 if 1 was passed and 
  1162.               no key was struck.
  1163.  
  1164.      Example: 
  1165.         (while (= (keycheck 1) 0) ;While no key is touched
  1166.            (dobeep 5000 500)      ;Sound the speeker at 5000Hz for 500 ms
  1167.         )
  1168.  
  1169.         This will cause the speaker to sound until any key is struck.
  1170.  
  1171.  
  1172.  
  1173.         (display X Y "ENTER Yes or No: ")
  1174.         (setq flat 't)
  1175.         (while flag)
  1176.            (setq a (keycheck 0))    ;Wait for a key stroke
  1177.            (if(or(= (castchar A) "Y")(= (castchar A) "y")  ;Test it
  1178.                  (= (castchar A) "N")(= (castchar A) "n")
  1179.               )
  1180.               (setq flag nil)
  1181.               (dobeep 5000 3000)   ;Sound alarm
  1182.            )
  1183.         )
  1184.  
  1185.         This will wait until Y or N is given before continuing.
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.   --------------------------------------------------------------------------
  1192.   CLSWINDOW - This simply clears the last window (whether there or not).
  1193.      The function takes two parameters and assumes the current color set.
  1194.  
  1195.      Usage: (clswindow)
  1196.  
  1197.      Returns: Nothing.
  1198.  
  1199.      Example:
  1200.         (window 5 5 75 20 1 1)   ;Pop a window
  1201.         (fillback 1)             ;Fill the window with background
  1202.         (keycheck 0)             ;Wait for a keystroke!
  1203.         (clswindow)              ;Clear the window back out again.
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.   --------------------------------------------------------------------------
  1210.   SCROLL - This function accepts a list of strings as one argument.
  1211.      The list of strings is processed into the last window (or upper left
  1212.      of whole screen if 'CLEANUP' or no window was called) and allows the
  1213.      text in that window to be scrolled. <ESCAPE> will exit the scroller.
  1214.  
  1215.  
  1216.      Usage: (scroll (list-of-strings))
  1217.  
  1218.      Returns: A key stroke to be processed.
  1219.  
  1220.      Example: 
  1221.         (setq oldbit (setscroll 99))       ;Save the SCROLL bit value
  1222.         (window  x1 y1 x2 y2  1 2)         ;Pop a window
  1223.         (title 0 " USE <-> AND UP/DN ")    ;Title top of window
  1224.         (title 1 " Escape always exits ")  ;Title bottom of window
  1225.         (setscroll 0 )            ;Set the scroll bit for UP/DOWN and
  1226.         (setq answer              ;LEFT/RIGHT scrolling
  1227.            (scroll 
  1228.               (list
  1229.               "This is an example of the scroll"
  1230.               "routine for use in AutoLISP. Too"
  1231.               "bad we didn't have this kind  of"
  1232.               "stuff in Version 9 and 10 huh!  "
  1233.               " "
  1234.               "I suppose one use of the function"
  1235.               "could be for help."
  1236.               " "
  1237.               "Another use might be for reading"
  1238.               "up text files or something to be"
  1239.               "displayed with certain menus in"
  1240.               "action. Each menu having it's own"
  1241.               "text file related to it"
  1242.               )
  1243.            )
  1244.         )
  1245.         (setscroll oldbit)
  1246.        
  1247.   --------------------------------------------------------------------------
  1248.   SELECT - The select function is somewhat like the 'TEXTMENU' function 
  1249.      (above).  The function takes one argument as a list of strings. The 
  1250.      strings are displayed in the last window (or Upper left corner if 
  1251.      'CLEANUP' or no window was called). A scroll bar is set at the START 
  1252.      position in the strings (see 'SETSTART' above) initially. The function 
  1253.      allows the user to scroll in the list strings with the UP/DOWN  
  1254.      (HOME/END) keys.  When the user hits the <ENTER> key an integer 
  1255.      corresponding to the member in the list of strings is returned. This 
  1256.      function will deny (return) a LEFT or RIGHTKEY if SETSIDES is ON 
  1257.      and a LEFT or RIGHTKEY is struck.
  1258.  
  1259.  
  1260.      Usage: (select (list-of-strings))
  1261.  
  1262.      Returns: An integer corresponding to the member of the list or LEFTKEY/
  1263.            RIGHTKEY code if SETSIDES is OFF.
  1264.  
  1265.      Example:
  1266.         (setq oldstart (setstart 99)) ;Get the old value..do not set it!
  1267.         (setstart 3)                  ;Set the third parameter to be default.
  1268.         (window  x1 y1 x2 y2 1 2)     ;Pop a window for SELECT.
  1269.         (setq answer
  1270.            (select 
  1271.               (LIST       
  1272.               "LINE"
  1273.               "POLYLINE"  
  1274.               "CIRCLE"
  1275.               "TEXT"      
  1276.               "3DFACE"
  1277.               )
  1278.            )
  1279.         )
  1280.         (setstart oldstart)  ;Puts the variable back to original state.
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.   --------------------------------------------------------------------------
  1287.   TITLE - This function takes two arguments: a TOP/BOTTOM flag and 
  1288.      a string. The flag is 0 for the TOP of the window and 1 for the BOTTOM 
  1289.      of the window.  The string will be centered on the border of the 
  1290.      window at the top or bottom.
  1291.  
  1292.      Usage: (title top/bottom-flag display-string)
  1293.  
  1294.      Returns: Nothing.
  1295.  
  1296.      Example:
  1297.         (window 5 5 20 20 1 2)
  1298.         (title 0 " Choose an Item ");
  1299.         (title 1 " Escape to Quit ");
  1300.  
  1301.               RESULTS ARE:
  1302.  
  1303.         |---- Choose an Item -----|
  1304.         |                         |
  1305.         |                         |
  1306.         |                         |
  1307.         |                         |
  1308.         |                         |
  1309.         |                         |
  1310.         |---- Escape to Quit -----|
  1311.  
  1312.  
  1313.  
  1314.  
  1315.   --------------------------------------------------------------------------
  1316.   CENTER_TEXT - Centers text horizontally in a window at the current
  1317.      cursor position (only y is dependent). 
  1318.  
  1319.      Usage: (center message-string-to-center)
  1320.  
  1321.      Returns: Nothing.
  1322.  
  1323.      Example:
  1324.         (window 5 5 25 7 1 2)   ;Cursor is automatically in window @ 1 1
  1325.         (center " Hit Enter to Edit ")
  1326.  
  1327.                   RESULTS ARE:
  1328.                ___________________
  1329.               |                   |
  1330.               | Hit Enter to Edit |
  1331.               |___________________|
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.   --------------------------------------------------------------------------
  1338.   GETMODE - Gets the current graphics mode as a list in the form of
  1339.      (ACGRAPHMODE DOS_MODE). If ACGRAPHMODE is 1, the screen is in graphics 
  1340.      mode. If ACGRAPHMODE is 0 then the screen is on the text side. The 
  1341.      DOS_MODE is the actual video mode as follows:
  1342.  
  1343.         0 B/W         40X25 CGA,EGA
  1344.         1 16 Colors   40X25 CGA,EGA
  1345.         2 B/W         80X25 CGA,EGA
  1346.         3 16 Colors   80X25 CGA,EGA
  1347.         7 Monochrome 
  1348.  
  1349.      Usage: (getmode)
  1350.  
  1351.      Returns: A list of ACGRAPHICS MODE and DOS_MODE.
  1352.  
  1353.      Example:
  1354.         (defun screenblue1()
  1355.         (textscr)                    ;Put in textmode.
  1356.         (if (/= (cadr (getmode)) 7)  ;If not monochome
  1357.         (SETCOLORS                   ;Then set the colors
  1358.              (list
  1359.                    _WHITE            ;forward text color
  1360.                    _BLUE             ;background color
  1361.                    _RED              ;border background color
  1362.                    _WHITE            ;border text color
  1363.                    _BLACK            ;highlighted text color
  1364.                    _CYAN             ;highlighted background color
  1365.              )
  1366.         ))
  1367.         (princ)
  1368.         )
  1369.  
  1370.         This was to avoid causing invisible and blinking text!
  1371.  
  1372.  
  1373.  
  1374.  
  1375.   --------------------------------------------------------------------------
  1376.   CASTCHAR - Takes an integer argument as a scan code and converts it
  1377.      to a character string.
  1378.  
  1379.  
  1380.      Usage: (castchar scan-code)
  1381.  
  1382.      Returns: A string representation of the scan code.
  1383.  
  1384.      Example: 
  1385.        (setq a (KEYCHECK 0))     ;Wait for a key stroke
  1386.        (setq converted (CASTCHAR A))
  1387.        (if (or (= converted  "Y") ;Is it a Y
  1388.           (= converted  "y")    ;or y
  1389.           (= converted  "N")    ; ...
  1390.           (= converted  "n")    ;
  1391.           )
  1392.           (setq flag nil)
  1393.           (dobeep 5000 3000)    ;Sound alarm
  1394.        )
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.   --------------------------------------------------------------------------
  1401.   GETCOLORS - Returns the current color set as a list of integers.
  1402.  
  1403.      Usage: (getcolors)
  1404.  
  1405.      Returns: A list of integers.
  1406.  
  1407.      Example:
  1408.         (setq oldcolors (getcolors))  ;save old color set
  1409.         (setcolors                    ;Then set the new colors
  1410.              (list
  1411.                    _WHITE        ;forward text color
  1412.                    _BLUE         ;background color
  1413.                    _RED          ;border background color
  1414.                    _WHITE        ;border text color
  1415.                    _BLACK        ;highlighted text color
  1416.                    _CYAN         ;highlighted background color
  1417.              )
  1418.         ))
  1419.  
  1420.         .
  1421.         .Some code here
  1422.         .
  1423.  
  1424.         (setcolors oldcolors)    ;Then reset the colors
  1425.  
  1426.  
  1427.  
  1428.  
  1429.   --------------------------------------------------------------------------
  1430.   DOBEEP - This function sounds the speaker. It takes two arguments:
  1431.      a frequency (hertz) and a duration (ms). Both values must be positive
  1432.      and nonzero.
  1433.  
  1434.      Usage: (dobeep frequency-hertz duration-milliseconds)
  1435.  
  1436.      Returns: Nothing.
  1437.  
  1438.      Example: 
  1439.         (dobeep 500 1000)   ;500 hz for 1000 milliseconds (1 second).
  1440.  
  1441.  
  1442.  
  1443.  
  1444. ***************************************************************************
  1445.  
  1446. This is the summary of all of the functions in the registered version:
  1447.  
  1448.   Usage : (WINDOW x1 y1 x2 y2 height border_type)
  1449.   Types : (WINDOW int int int int int int)
  1450.  
  1451.   Usage : (DISPLAY x y string)
  1452.   Tupes : (DISPLAY int int string)
  1453.  
  1454.   Usage : (TEXTMENU title_or_instructions default (list of strings))
  1455.   Types : (TEXTMENU string int (list strings ...))
  1456.  
  1457.   Usage : (SETSPEED value-of-speed)
  1458.   Types : (SETSPEED int)
  1459.  
  1460.   Usage : (MESSAGE string-to-display wait-flag)
  1461.   Types : (MESSAEG string int)
  1462.  
  1463.   Usage : (NOCURSOR)
  1464.   Types : (NOCURSOR)
  1465.  
  1466.   Usage : (ONCURSOR)
  1467.   Types : (ONCURSOR)
  1468.  
  1469.   Usage : (GETCURS)
  1470.   Types : (GETCURS)
  1471.  
  1472.   Usage : (SETCURS (list x y))
  1473.   Types : (SETCURS (list int int))
  1474.  
  1475.   Usage : (CLS)
  1476.   Types : (CLS)
  1477.  
  1478.   Usage : (SETCOLORS (list-of-colors))
  1479.   Types : (SETCOLORS (list int int int int int int))
  1480.  
  1481.   Usage : (SAVE_VIDEO bank-number)
  1482.   Types : (SAVE_VIDEO int)
  1483.  
  1484.   Usage : (RESTORE_VIDEO bank-number)
  1485.   Types : (RESTORE_VIDEO int)
  1486.  
  1487.   Usage : (SETSTART position)
  1488.   Types : (SETSTART int)
  1489.  
  1490.   Usage : (SETDENYS (list-of-keys))
  1491.   Types : (SETDENYS (list int int int ...))
  1492.  
  1493.   Usage : (SETSCROLL scroll-bit)
  1494.   Types : (SETSCROLL int)
  1495.  
  1496.   Usage : (SETNUMERIC on-off-flag)
  1497.   Types : (SETNUMERIC int)
  1498.  
  1499.   Usage : (RELATIVE on-off-flag)
  1500.   Types : (RELATIVE int)
  1501.  
  1502.   Usage : (SETSIDES on-off-flag)
  1503.   Types : (SETSIDES int)
  1504.  
  1505.   Usage : (SETUPBOX x1 y1 x2 y2)
  1506.   Types : (SETUPBOX int int int int)
  1507.  
  1508.   Usage : (CLEANUP)
  1509.   Types : (CLEANUP)
  1510.  
  1511.   Usage : (EDIT (list-of-strings))
  1512.   Types : (EDIT (list string string string ...))
  1513.  
  1514.   Usage : (FILLBACK border-flag)
  1515.   Types : (FILLBACK int)
  1516.  
  1517.   Usage : (SETTOP label-string label-string ...)
  1518.   Types : (SETTOP string string string ...)
  1519.  
  1520.   Usage : (DOTOP key-pushed)
  1521.   Types : (DOTOP int)
  1522.  
  1523.   Usage : (KEYCHECK wait-flag)
  1524.   Types : (KEYCHECK int)
  1525.  
  1526.   Usage : (CLSWINDOW)
  1527.   Types : (CLSWINDOW)
  1528.  
  1529.   Usage : (SCROLL (list-of-strings))
  1530.   Types : (SCROLL (list string string ...))
  1531.  
  1532.   Usage : (SELECT (list-of-strings))
  1533.   Types : (SELECT (list string string ...))
  1534.  
  1535.   Usage : (TITLE top/bottom-flag display-string)
  1536.   Types : (TITLE int string)
  1537.  
  1538.   Usage : (CENTER message-string-to-center)
  1539.   Types : (CENTER string)
  1540.  
  1541.   Usage : (GETMODE)
  1542.   Types : (GETMODE)
  1543.  
  1544.   Usage : (CASTCHAR scan-code)
  1545.   Types : (CASTCHAR int)
  1546.  
  1547.   Usage : (GETCOLORS)
  1548.   Types : (GETCOLORS)
  1549.  
  1550.   Usage : (DOBEEP frequency-hertz duration-milliseconds)
  1551.   Types : (DOBEEP int int)
  1552.  
  1553.  
  1554.  
  1555.   And finally...
  1556.   (Lawyer's stuff - sorry...)
  1557.  
  1558.   SOFTWARE DESIGNS, INC.  MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AND 
  1559.   SPECIFICALLY DISCLAIMS ANY  IMPLIED WARRANTIES OF MERCHANTABILITY OR
  1560.   FITNESS FOR ANY PARTICULAR PURPOSE.  WE FURTHER RESERVE THE RIGHT TO
  1561.   MAKE CHANGES TO THE SPECIFICATIONS OF THE PRODUCT WITHOUT OBLIGATION
  1562.   TO NOTIFY ANY PERSON OR ORGANIZATION OF SUCH CHANGES.
  1563.  
  1564.  
  1565.