home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / BASIC / POWBASIC / LIBRARY2 / PW200.ZIP / PW200D.TXT < prev    next >
Text File  |  1990-03-09  |  19KB  |  412 lines

  1.                                     PW200
  2.                    Copyright (c) 1990 Richard D. Fothergill
  3.                    MULTI-LEVEL WINDOWS, MENUS AND UTILITIES
  4.                           for PowerBASIC Version 2.0
  5.  
  6.                              FILES on your disk:
  7.  
  8.                 PW200d.PBU - PowerBASIC window unit file
  9.                 PD200.BAS  - Demonstration program source code
  10.                 PD200.EXE  - Compiled demonstration program
  11.                 PW200d.INC - PowerBASIC include file
  12.                 PWASMd.OBJ - Unit Object File
  13.  
  14.                                  USING PW200
  15.  
  16.          All of the variables with the exception of string variables and
  17.      long integers must either be declared globally as integers by means
  18.      of a DEFINT statement early in the program, or must have the
  19.      specific integer identifier (%) attached wherever they appear in the
  20.      program.  The BASIC compiler is picky about this so be sure to
  21.      verify that the type assignment is correct.  Make certain that all
  22.      of your variables passing parameters to PW200 subroutines are
  23.      identified as integers, and you will be able to proceed with the
  24.      compile operation as with any other program.  Include PW200d.INC in
  25.      your program with the $INCLUDE statement.
  26.          Some of the functions require a good understanding of DOS
  27.      interrupt calls.  Consult any DOS programming reference manual for a
  28.      more complete discussion.
  29.          If a mouse is detected it will be active in all routines that
  30.      use Getkey.  The left button had been assigned CHR$(13) Enter, and
  31.      the right button CHR$(27) Esc.
  32.  
  33.                             CONVERTING FROM TBW73
  34.  
  35.          If you have been using TBW73 for Borland's Turbo Basic the
  36.      process of converting your programs is relatively easy.  Any
  37.      occurences of DEF FN's must be changed by dropping the FN off.
  38.      These are now FUNCTIONS in PW200 instead of DEF FN.  This change can
  39.      be easily accomplished with a global search and replace.  As an
  40.      example, if you have CALL TEXTATTR(FNATTR(15,1)) in your program you
  41.      should change it to read CALL TEXTATTR(ATTR(15,1)).  These are the
  42.      only statements that require alteration.
  43.  
  44.                            WARRANTY AND DISCLAIMER
  45.  
  46.          The author makes no warranties, expressed or implied, as to the
  47.      quality or performance of this program.  The author will not be held
  48.      liable for any direct, indirect, incidental or consequential damages
  49.      resulting from the use of this program.  Your use of the program
  50.      constitutes your agreement to this disclaimer and your release of
  51.      the author from any form of liability or litigation.  Any brand or
  52.      product names are trademarks or registered trademarks of their
  53.      respective holders.
  54.  
  55.          This is a demonstration file for evaluation only.  Some features
  56.      are not available and the maximum windows has been limited to three.
  57.      This document file is a condensed version to give you a description
  58.      of the statements and functions available in the registered version.
  59.      You can order the registered version, which includes a printed manual,
  60.      by sending $25.00 ($30.00 for 3-1/2" disk) plus $1.50 for shipping and
  61.      handling to:
  62.                            Richard Fothergill
  63.                            141 Oak Hill Road
  64.                            Pittsfield, MA  01201
  65.  
  66.          Support for PW200 will be available to registered uses online
  67.      through:
  68.                            GEnie  - R.FOTHERGILL
  69.                            CServe - 76210,443
  70.                            the Oak Hill BBS (413) 499-7245
  71.  
  72.  
  73.      --------------------------------------------------------------------
  74.      ATTR% function
  75.      --------------------------------------------------------------------
  76.      Purpose  Calculate the color attribute given the foreground and
  77.               background colors.  Returns an integer value.
  78.  
  79.      Syntax   txtattr% = ATTR%(fg%,bg%)
  80.  
  81.      --------------------------------------------------------------------
  82.      BACK% function
  83.      --------------------------------------------------------------------
  84.      Purpose  Calculate the background color given a color attribute
  85.               value.  Returns an integer value.
  86.  
  87.      Syntax   bkgrnd% = BACK%(wattr%)
  88.  
  89.      --------------------------------------------------------------------
  90.      CALCULATOR statement
  91.      --------------------------------------------------------------------
  92.      Purpose  Presents a four function with memory calculator in a pop-up
  93.               window.
  94.  
  95.      Syntax   CALL Calculator(row,col,wattr,shdw)
  96.  
  97.      --------------------------------------------------------------------
  98.      CLEARWIN statement
  99.      --------------------------------------------------------------------
  100.      Purpose  Clears the current window inside the border.
  101.  
  102.      Syntax   CALL CLEARWIN
  103.  
  104.      --------------------------------------------------------------------
  105.      CLOSEWIN statement
  106.      --------------------------------------------------------------------
  107.      Purpose  To remove the last window opened from the screen, restore
  108.               the area under the window and restore the cursor position.
  109.  
  110.      Syntax   CALL CLOSEWIN
  111.  
  112.      --------------------------------------------------------------------
  113.      CURDIR$ function
  114.      --------------------------------------------------------------------
  115.      Purpose  Returns a string representing the DOS current directory in
  116.               the form of Drive:\Dir\
  117.  
  118.      Syntax   cdir$ = Curdir$
  119.  
  120.      --------------------------------------------------------------------
  121.      CURDISPLAY% function
  122.      --------------------------------------------------------------------
  123.      Purpose  Returns an integer value representing the type of the
  124.               active monitor.
  125.                    0 - MONO             3 - MCGA
  126.                    1 - CGA              4 - VGA
  127.                    2 - EGA
  128.  
  129.      Syntax   vidtype% = CURDISPLAY%
  130.  
  131.      --------------------------------------------------------------------
  132.      CURDRIVE$ function
  133.      --------------------------------------------------------------------
  134.      Purpose  Returns a string representing the DOS current drive in the
  135.               form of drive letter followed by a colon.
  136.  
  137.      Syntax   cd$ = Curdrive$
  138.  
  139.      --------------------------------------------------------------------
  140.      CURVIDEO% function
  141.      --------------------------------------------------------------------
  142.      Purpose  Returns an integer value representing the current video
  143.               mode.
  144.  
  145.      Syntax   vidmode% = CURVIDEO%
  146.  
  147.      --------------------------------------------------------------------
  148.      DISKFREE& function
  149.      --------------------------------------------------------------------
  150.      Purpose  Returns a long integer value representing the amount of
  151.               free disk space on the drive specified.
  152.  
  153.      Syntax   c& = Diskfree&(drive)
  154.  
  155.      --------------------------------------------------------------------
  156.      DISKSIZE& function
  157.      --------------------------------------------------------------------
  158.      Purpose  Returns a long integer value representing the size of the
  159.               disk specified.
  160.  
  161.      Syntax   c& = Disksize&(drive)
  162.  
  163.      --------------------------------------------------------------------
  164.      DOSVERSION$ function
  165.      --------------------------------------------------------------------
  166.      Purpose  Returns a string represent the version of the DOS on the
  167.               machine in the form of Major.Minor.
  168.  
  169.      Syntax   dos$ = Dosversion$
  170.  
  171.      --------------------------------------------------------------------
  172.      FALIGN$ function
  173.      --------------------------------------------------------------------
  174.      Purpose  Formats a file name string to its full width of eight for
  175.               the filename and three for the extension.  Any missing
  176.               characters are padded with spaces to form the string.
  177.  
  178.      Syntax   filname$ = falign$(filspec$)
  179.  
  180.      --------------------------------------------------------------------
  181.      FAKEWIN statement
  182.      --------------------------------------------------------------------
  183.      Purpose  Draws a box on the screen.  No screen saving performed.
  184.  
  185.      Syntax   CALL FAKEWIN(ROW,COL,ROWS,COLS,WATTR,BATTR,BRDR,SATTR,_
  186.                            SHDW,ZOOM)
  187.  
  188.      --------------------------------------------------------------------
  189.      FEXISTS% function
  190.      --------------------------------------------------------------------
  191.      Purpose  Returns an integer value(0 or 1) representing whether the
  192.               file specified exists in the path and file spec given.
  193.  
  194.      Syntax   filexists = Fexists(fspec$)
  195.  
  196.      --------------------------------------------------------------------
  197.      FEXPAND$ function
  198.      --------------------------------------------------------------------
  199.      Purpose  Expands a file specification into a fully qualified
  200.               drive:\path\filespec by adding the current drive and
  201.               directory.
  202.  
  203.      Syntax   filpath$ = Fexpand$(filespec$)
  204.  
  205.      --------------------------------------------------------------------
  206.      FINDFIRST statement
  207.      --------------------------------------------------------------------
  208.      Purpose  Searches the path specification for the first entry
  209.               matching the file specs and attributes.  Results of the
  210.               search are returned in dirinfo$ and doserror%.
  211.  
  212.      Syntax   CALL Findfirst(path$,attrib%,dirinfo$,doserror%)
  213.  
  214.      --------------------------------------------------------------------
  215.      FINDNEXT statement
  216.      --------------------------------------------------------------------
  217.      Purpose  Returns the next entry that matches the file specs and
  218.               attributes in a previous CALL to Findfirst.
  219.  
  220.      Syntax   CALL Findnext(dirinfo$,doserror)
  221.  
  222.      --------------------------------------------------------------------
  223.      FORE% function
  224.      --------------------------------------------------------------------
  225.      Purpose  Calculate the foreground color given a color attribute
  226.               value.  Returns an integer value.
  227.  
  228.      Syntax   frgrnd% = FORE%(wattr%)
  229.  
  230.      --------------------------------------------------------------------
  231.      FSPLIT statement
  232.      --------------------------------------------------------------------
  233.      Purpose  Splits a path specification in the three primary pieces.
  234.               Drive, directory and file name.
  235.  
  236.      Syntax   CALL Fsplit(path$,d$,n$,e$)
  237.  
  238.      --------------------------------------------------------------------
  239.      GETFIELD statement
  240.      --------------------------------------------------------------------
  241.      Purpose  Provide a formatted data input field.
  242.  
  243.      Syntax   CALL GETFIELD(ROW,COL,ANS$,DTYPE$,SIZE,DEC,LSTKEY,_
  244.                             INATTR,OUTATTR)
  245.  
  246.      --------------------------------------------------------------------
  247.      GETKEY statement
  248.      --------------------------------------------------------------------
  249.      Purpose  Get a key stroke from the keyboard.  Returns CH1$ = to
  250.               ASCII code if it is a printable character and CH2$ =
  251.               CHR$(0).  If an extended key is pressed returns CH1$ =
  252.               CHR$(0) and CH2$ = extended key code.
  253.  
  254.      Syntax   CALL GETKEY(CH1$,CH2$)
  255.  
  256.      --------------------------------------------------------------------
  257.      GETREC statement
  258.      --------------------------------------------------------------------
  259.      Purpose  Presents multiple fields for edited data input based on
  260.               information provided in the descriptor array.  Allows
  261.               movement from field to field and action to be taken can be
  262.               determined by the last key pressed.
  263.  
  264.      Syntax   CALL Getrec(Info$(),Datarr$(),Trecs,Lstkey,Doedit,_
  265.                           Inattr,Outattr)
  266.  
  267.      --------------------------------------------------------------------
  268.      MAKEFMENU$ function
  269.      --------------------------------------------------------------------
  270.      Purpose  Presents a pop-up menu of a directory of files matching the
  271.               specification and attribute given from which a selection
  272.               can be made.  Returns the file selected or a null string if
  273.               Esc is pressed.
  274.  
  275.      Syntax   pikfil$ = Makefmenu$(fspec$,row,col,rows,wattr,battr,_
  276.                                    sattr,shdw,zoom,hlattr)
  277.  
  278.      --------------------------------------------------------------------
  279.      MAKEHMENU statement
  280.      --------------------------------------------------------------------
  281.      Purpose  Presents a horizontal menu within a previously open window.
  282.               Returns an integer value which indicates the selection
  283.               made.
  284.  
  285.      Syntax   CALL MAKEHMENU(ITEM$(),SUBITEM$,ITEMCOUNT,CURNTPOS,_
  286.                              STARTPOS,HLATTR,FLATTR,FLON,MENUSPACES,_
  287.                              BARLOC)
  288.  
  289.      --------------------------------------------------------------------
  290.      MAKELMENU statement
  291.      --------------------------------------------------------------------
  292.      Purpose  Presents a vertical list within a previously open window.
  293.               Returns an integer value which indicates the selection
  294.               made.  The list can be longer than the window with the
  295.               direction keys controlling movement.
  296.  
  297.      Syntax   CALL MAKELMENU(RECARR$(),RECS,PICKREC,STARTPOS,HLATTR)
  298.  
  299.      --------------------------------------------------------------------
  300.      MAKEVMENU statement
  301.      --------------------------------------------------------------------
  302.      Purpose  Presents a vertical menu within a previously open window.
  303.               Returns an integer value which indicates the selection
  304.               made.
  305.  
  306.      Syntax   CALL MAKEVMENU(ITEM$(),LIVEITEM$,ITEMCOUNT,CURNTPOS,_
  307.                              STARTPOS,HLATTR,FLATTR,NOATTR,BARTYPE,FLON)
  308.  
  309.      --------------------------------------------------------------------
  310.      MAXMEM& function
  311.      --------------------------------------------------------------------
  312.      Purpose  Returns a long integer representing the total conventional
  313.               memory in the machine.
  314.  
  315.      Syntax   maxbytes& = Maxmem&
  316.  
  317.      --------------------------------------------------------------------
  318.      OPENWIN statement
  319.      --------------------------------------------------------------------
  320.      Purpose  Open a text window on the screen with automatic screen
  321.               saving.
  322.  
  323.      Syntax   CALL OPENWIN(ROW,COL,ROWS,COLS,WATTR,BATTR,BRDR,SATTR,_
  324.                            SHDW,ZOOM)
  325.  
  326.      --------------------------------------------------------------------
  327.      PRINTCWIN statement
  328.      --------------------------------------------------------------------
  329.      Purpose  Display text centered in the window on the ROW specified
  330.               using the current attributes and window coordinates.
  331.  
  332.      Syntax   CALL PRINTCWIN(ROW,STRDAT$)
  333.  
  334.      --------------------------------------------------------------------
  335.      PRINTWIN statement
  336.      --------------------------------------------------------------------
  337.      Purpose  Display text in the current window using the current
  338.               attributes and window coordinates.
  339.  
  340.      Syntax   CALL PRINTWIN(ROW,COL,STRDAT$)
  341.  
  342.      --------------------------------------------------------------------
  343.      PRTEST% function
  344.      --------------------------------------------------------------------
  345.      Purpose  Returns either a 0 - not ready or 1 - ready indicating the
  346.               status of the printer port specified (either 1 or 2).
  347.  
  348.      Syntax   prtok = Prtest(1)
  349.  
  350.      --------------------------------------------------------------------
  351.      SCOLOR statement
  352.      --------------------------------------------------------------------
  353.      Purpose  To change the color attributes of a specified area of the
  354.               screen.
  355.  
  356.      Syntax   CALL SCOLOR(ROW,COL,ROWS,COLS,ATTR)
  357.  
  358.      --------------------------------------------------------------------
  359.      SCROLLWIN statement
  360.      --------------------------------------------------------------------
  361.      Purpose  Scroll the current window either up or down one line.
  362.  
  363.      Syntax   CALL SCROLLWIN(DIR$)
  364.  
  365.      --------------------------------------------------------------------
  366.      SFILL statement
  367.      --------------------------------------------------------------------
  368.      Purpose  Fills a specified area of the screen with a specified
  369.               character and color attribute.
  370.  
  371.      Syntax   CALL SFILL(ROW,COL,ROWS,COLS,CHAR,ATTR)
  372.  
  373.      --------------------------------------------------------------------
  374.      SPRINT statement
  375.      --------------------------------------------------------------------
  376.      Purpose  Displays string data at a specified location with a
  377.               specified color attribute.
  378.  
  379.      Syntax   CALL SPRINT(ROW,COL,STRDAT$,ATTR)
  380.  
  381.      --------------------------------------------------------------------
  382.      SPRINTC statement
  383.      --------------------------------------------------------------------
  384.      Purpose  Displays string data centered within specified columns and
  385.               on a specified row with a specified color attribute.
  386.  
  387.      Syntax   CALL SPRINTC(ROW,COLL,COLR,STRDAT$,ATTR)
  388.  
  389.      --------------------------------------------------------------------
  390.      TEXTATTR statement
  391.      --------------------------------------------------------------------
  392.      Purpose  Sets the text foreground and background based on a given
  393.               attribute value.
  394.  
  395.      Syntax   CALL TEXTATTR(ATTR)
  396.  
  397.      --------------------------------------------------------------------
  398.      TITLEWIN statement
  399.      --------------------------------------------------------------------
  400.      Purpose  To print a title in the border of a window using the color
  401.               attribute specified at a specified location.
  402.  
  403.      Syntax   CALL TITLEWIN(LOC,ATTR,STRDAT$)
  404.  
  405.      --------------------------------------------------------------------
  406.      WINDOWXY statement
  407.      --------------------------------------------------------------------
  408.      Purpose  Position the cursor within the current window.
  409.  
  410.      Syntax   CALL WINDOWXY(ROW,COL)
  411.  
  412.