home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 14 / CDACTUAL.iso / cdactual / demobin / share / program / Basic / VBDGRID.ZIP / VBDGRID.DOC next >
Encoding:
Text File  |  1993-04-25  |  8.0 KB  |  229 lines

  1.  
  2.  
  3. April 25, 1993
  4.  
  5.  
  6. VBDGrid - (C) Copyright 1993 Robert R. Smith, All Rights Reserved
  7.  
  8. Program and documentation written by:
  9.  
  10. Robert R. Smith
  11. 3812 Red Bud Drive
  12. Imperial, MO  63052-1161
  13. CIS 72447,2643
  14.  
  15. A Spreadsheet like data entry and editing facility for Visual Basic for Dos.
  16.  
  17. This function will provide a flexible data entry library for editing 
  18. columnized information.  The uses of this routine will range from roster and 
  19. statisitcs entry to budgeting information as in a spreadsheet.  This function 
  20. will in many ways supplement the missing Grid function available in the VB 
  21. for Windows version.
  22.  
  23. Features:
  24.     - Rows and columns for editing data are limited only by VBDOS array 
  25.       limitations.
  26.     - Automatic vertical and horizontal scrolling when next row or column 
  27.       is accessed.
  28.     - Definable exit controls to provide hooks for features such as 
  29.       next/previous records.
  30.     - Tabs can be locked in for directional preferance.
  31.     - Data in elements can be justified Left, Right or Center.
  32.     - Scrolling can be accomplished by normal cursor keys, PageUp, 
  33.       PageDown, End and Home.
  34.  
  35. Subroutines and Functions:
  36.     - Grid() provides the spreadsheet approach front end for scrolling 
  37.       through the data array to enable editing while providing a user 
  38.       defined array of exit commands.
  39.     - DefineCol() provides a shortcut method for defining each column.
  40.       Each column should be separately defined.
  41.     - EditWord() provides a full text editor for editing each array 
  42.       element and any other data that may be sent to it.
  43.     - PrintCell() is a routine called by the Grid() function to blank out 
  44.       the previous displayed element and to highlight the current element 
  45.       in it's justified and formatted manner.
  46.     - PrintColHead() is a routine to print the column headings and screen 
  47.       title.
  48.     - PrintCurrScn() is a routine to print the entire screens elements 
  49.       when the whole page is subject to a position change.
  50.     - PrintRowHead() is a routine to print the row headings.  These 
  51.       headings may not be changed and will always be displayed on the 
  52.       screen.
  53.  
  54. Structures:
  55.     - ColDefinition defines the editing parameters of each column.
  56.     - RowDefinition defines the editing parameters of each row.
  57.     - CmdDefinition defines the exit commands to be used.
  58.     - ColorInit defines the color scemes to be used.
  59.  
  60.  
  61.  
  62.  
  63.       
  64.                 (Page 1)
  65.  
  66.  
  67.  
  68.  
  69.  
  70. Parameter Definitions:
  71.  
  72. ReturnCode=Grid(Title AS STRING,            Screen Title while editor is active
  73.         RowDef() AS RowDefinition,  Array 1 to UBOUND of RowDefinitions
  74.         RowLength,                  Length of row heading column
  75.         ColDef() AS ColDefinition,  Array 1 to UBOUND of ColDefinitions
  76.         CmdDef() AS CmdDefinition,  Array 1 to UBOUND of CmdDefinitions
  77.         DataArray() AS STRING,      2 dimensional array of ascii data
  78.         ColorDef AS ColorInit,      Color scheme to be used in editor
  79.         ColTotals() AS DOUBLE,      Array 1 to UBOUND of ColDefinitions
  80.         SaveRow()AS INTEGER,        Active Row in Grid
  81.         SaveCol()AS INTEGER         Active Column in Grid
  82.            )
  83.  
  84. CALL DefineCol (ColDef AS ColDefinition,    Column Definition record
  85.         CharType AS STRING,         [N]umeric, [A]lphabetic or [D]ate
  86.         Justification AS STRING,    [L]eft, [R]ight or [C]enter
  87.         Total AS STRING,            [Y]es or [N]o for column total
  88.         Protect AS STRING,          [Y]es or [N]o for edit protection
  89.         Length,                     Width of column
  90.         Description AS STRING,      Column help text
  91.         Heading AS STRING,          Column heading
  92.         Format AS STRING            Any valid Format$ in VBDOS for 
  93.                         output
  94.            )
  95.           
  96. CALL EditWord  (Row%,                       Element current row
  97.         Col%,                       Element current column
  98.         Valid$,                     Valid characters for input
  99.         FieldLen%,                  Maximum length of element
  100.         WorkString$,                Working string to edit
  101.         GetChar$,                   Character passed into editor
  102.         FillChar$,                  Fill Character for padding element
  103.         PassClick%                  Setinal integer for passing input 
  104.                         one time to test for exit command
  105.            )
  106.  
  107. CALL PrintCell (Row%,                       Starting row for printed string.
  108.         Col%,                       Starting column for printed string
  109.         Length%,                    Length of printed string.
  110.         WorkString$,                String to be printed.
  111.         Justification$              Justification character as defined 
  112.                         in column definition.
  113.            )
  114.  
  115. CALL PrintColHead(TopCol%,                  First column on active screen.
  116.           ColDef() AS ANY,          Column definition as defined.
  117.           RowLength%,               Width of column.
  118.           MaxCol%,                  Maximum columns in data array as
  119.                         previously calculated.
  120.           ColorDef AS ANY,          Color scheme to be used in editor
  121.           MaxRowHead%,              Maximum rows in row definitions
  122.           Title AS String,          Screen heading
  123.           Arrows AS STRING          Tab direction arrows for display 
  124.                         at top of screen.
  125.          )
  126.  
  127.  
  128.  
  129.                 (Page 2)
  130.  
  131.  
  132.  
  133.  
  134.  
  135. Parameter Definitions (continued):
  136.  
  137.  
  138. CALL PrintCurrScn(TopRow%,                  Top row for active screen
  139.           TopCol%,                  Leftmost column of active screen
  140.           ColDef() AS ANY,          Column definitions
  141.           RowLength%,               Row heading column width
  142.           MaxCol%,                  Maximum columns in data array as                                                                
  143.                         previously calculated
  144.           MaxRow%,                  Maximum rows in data array as                                                                   
  145.                         previously calculated
  146.           DataArray() AS STRING,    2 dimensional array of ascii data
  147.           ColorDef AS ANY,          Color scheme to be used in editor
  148.           MaxRowHead%,              Maximum rows in row definitions
  149.           ColTotals() AS DOUBLE     column totals as previously 
  150.                         calculated
  151.          )
  152.  
  153. CALL PrintRowHead(TopRow%,                  Top row for active screen
  154.           RowDef() AS ANY,          Row definitions
  155.           RowLength%,               Row heading column width
  156.           ColorDef() AS ANY,        Column definitions
  157.           MaxRowHead%               Maximum rows in row definitions
  158.          )
  159.  
  160.  
  161. Type Structure Definitions:
  162.  
  163. TYPE ColDefinition
  164.     CharType        AS STRING * 1     [D]ate,  [N]umeric or [A]lphanumeric
  165.     Justification   AS STRING * 1     [R]ight, [L]eft or [C]enter justified
  166.     Total           AS STRING * 1     [Y]es or [N]o - Total for column
  167.     Protect         AS STRING * 1     [Y]es or [N]o - Protection against 
  168.                       editing
  169.     Length          AS INTEGER        Length of column
  170.     Description     AS STRING * 78    Description text for help line
  171.     Heading         AS STRING * 20    Description text for column heading
  172.     Format          AS STRING * 20    VBDOS Format$
  173. END TYPE
  174.  
  175. TYPE RowDefinition
  176.     Heading         AS STRING * 40    Description text for row heading
  177.     Total           AS STRING * 1     Not Available at this time
  178. END TYPE
  179.  
  180. TYPE CmdDefinition
  181.     Extended        AS STRING * 1     [Y]es or [N]o - Is key ascii 
  182.                       extended?
  183.     KeyCode         AS INTEGER        Ascii decimal code
  184.     Description     AS STRING * 20    Description for help line
  185. END TYPE
  186.  
  187. TYPE ColorInit
  188.     fc              AS INTEGER        Foreground color for data
  189.     bc              AS INTEGER        Background color for data
  190.     hfc             AS INTEGER        Highlited foreground color for titles
  191.     hbc             AS INTEGER        Highlited background color for titles
  192. END TYPE
  193.  
  194.                 (Page 3)
  195.  
  196.              
  197.  
  198.  
  199.  
  200.              
  201.              REGISTRATION FOR VBDGRID.LIB
  202.  
  203.  
  204.           NAME:_____________________________________________
  205.  
  206.         STREET:_____________________________________________
  207.  
  208.           CITY:________________ STATE:__ ZIP CODE __________
  209.  
  210.  
  211.  
  212.             SUGGESTED REGISTRATION FEES OUTLINE:
  213.  
  214.             Personal Use: ---------------   FREE
  215.  
  216.             Light User: ----------------- $ 5.00
  217.  
  218.             Moderate User: -------------- $10.00
  219.  
  220.             Heavy User: ----------------- $15.00
  221.  
  222.  
  223.             Please send registration form to:
  224.  
  225.             Robert R. Smith
  226.             3812 Red Bud
  227.             Imperial, MO  63052-1161
  228.  
  229.