home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / basic / PSCRN42.ZIP / TOORDER.BAS < prev   
Encoding:
BASIC Source File  |  1991-09-20  |  19.8 KB  |  472 lines

  1. '────────────────────────────────────────────────────────────────────────────
  2. 'TOORDER.Bas, written by P-Screen Professional            Date: 02-08-1990
  3.  
  4. 'Screen (TOORDER) is in library (P-SCREEN)                # of Fields:  28
  5. '
  6. '   Purpose:       - 1 of 2 QuickBASIC demo programs written entirely by
  7. '                    P-Screen Professional (PS Pro)
  8. '                  - Demonstrates several subroutines included in PS Pro:
  9. '                    1. rsMinput   2. rsQprint   3. FormatUsing
  10. '                    4. Exist      5. ProperName 6. rsCmpRst
  11. '
  12. '   Compatibility: QuickBASIC 4.0 or higher   -OR-  PDS 7  !!
  13. '                                                                                                                *
  14. '   To run this:   qb toorder /l ps-demo.qlb  -OR-  qbx toorder /l bc7-demo
  15. '
  16. '   Notes:         - Please read Routines.Doc for details on the subroutines
  17. '                    included with PS Pro.  These routines are in ps-demo.qlb.
  18. '                  - After PS Pro wrote this, we did some minor editing:
  19. '                    -- added this intro
  20. '                    -- "hardcoded" some variables, taking them out of a loop
  21.  
  22. 'NOTE: Run with QB 4.0+ -OR- PDS7 with these files in your Quick Library:
  23.       'LoadScrn, rsLoadBin, rsCompRest, rsMinput, rsQprint, Exists, ProperName & FormatUsing
  24. '────────────────────────────────────────────────────────────────────────────
  25.  
  26. DEFINT A-Z                                       'default = Integers
  27. CONST True = -1, False = NOT True
  28.  
  29. '----Declare subroutines.  MUST declare QB functions.
  30. DECLARE SUB rsMInput (Text$, ValidKeys$, Exit$, Format$, Length, RetCode, Hilite, Colr)
  31. DECLARE SUB rsQprint (Row, Column, Colr, Text$)
  32. DECLARE SUB rsLoadScrn (Array%(), LibName$, FileName$, Desc$, TopRow, TopCol, BotRow, BotCol, ScrnSize, ErrCode)
  33. DECLARE SUB rsCompRest (TopRow, BotRow, SEG Array)
  34. DECLARE FUNCTION FormatUsing$ (Format$, x#)      'format numbers for editing
  35. DECLARE FUNCTION Exists (FileName$)              'Exists = -1 if file DOES exist, 0 if it does NOT
  36. DECLARE FUNCTION ProperName$ (Text$)             'convert lower case text to proper
  37.  
  38. '─────────────────────────────────────────────────────────────────────────────
  39. TYPE TypeX                                       'define record elements
  40.      YourName        AS STRING * 40
  41.      YourCompany     AS STRING * 40
  42.      StreetAddress   AS STRING * 40
  43.      City            AS STRING * 24
  44.      State           AS STRING * 2
  45.      Zip             AS STRING * 12
  46.      Phone           AS STRING * 16
  47.      TodaysDate      AS STRING * 8
  48.      Quan1           AS INTEGER
  49.      Quan2           AS INTEGER
  50.      Quan3           AS INTEGER
  51.      Quan4           AS INTEGER
  52.      Quan5           AS INTEGER
  53.      Quan6           AS INTEGER
  54.      Quan7           AS INTEGER
  55.      Taxable         AS STRING * 1
  56.      T1              AS DOUBLE
  57.      T2              AS DOUBLE
  58.      T3              AS DOUBLE
  59.      T4              AS DOUBLE
  60.      T5              AS DOUBLE
  61.      T6              AS DOUBLE
  62.      T7              AS DOUBLE
  63.      NumPrograms     AS INTEGER
  64.      Postage         AS DOUBLE
  65.      SubTot          AS DOUBLE
  66.      SalesTax        AS DOUBLE
  67.      GrandTotal      AS DOUBLE
  68. END TYPE
  69.  
  70. DIM TOORDER AS TypeX
  71.  
  72. '─────────────────────────────────────────────────────────────────────────────
  73.  
  74. '--- Alpha$ and Field Types govern which keys are considered 'Valid' by rsMInput
  75.  
  76. Alpha$ = " 1234567890-+.$%QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm=!@#^&*()_[]\{}|;':,/<>?`~" + CHR$(34)
  77.  
  78. '─────────────────────────────────────────────────────────────────────────────
  79.  
  80.                               GOSUB EditTOORDER            'get to work
  81.  
  82. END
  83. '─────────────────────────────────────────────────────────────────────────────
  84. EditTOORDER:                                     'this is what you came for
  85. '─────────────────────────────────────────────────────────────────────────────
  86.  
  87. '----- Start by displaying our screen
  88.  
  89. CONST LibName$ = "P-SCREEN"
  90. ScreenName$ = "TOORDER": GOSUB DisplayScreen
  91.  
  92. '─────────────────────────────────────────────────────────────────────────────
  93. '----- Edit
  94.  
  95.    FieldNum = 1    'there are 28 fields, some may be calculated
  96.    DO              'EACH LOOP:  initialize RetCode, Exit$, & Format$
  97.  
  98.        RetCode = 32                              '32 = pad with Chr$(32)  -32 = Upper Case
  99.        Exit$ = "HP;C"                            'H = Up Cursor, P = Down Cursor, ; = F1 Help, C = F9 Calc
  100.        Format$ = ""                              'assume no mask--unformatted field
  101.        Minimum$ = ""                             'assume no minimum/maximum
  102.        Maximum$ = ""
  103.        ScreenName$ = ""                          'assume no help lib/screen
  104.        PropName = False                          'assume we don't ProperName it
  105.        ValidKeys$ = Alpha$                       'assume any character is valid
  106.  
  107.        SELECT CASE FieldNum
  108.          CASE 1
  109.              Row = 3: Column = 5: Length = 40
  110.              PropName = True                     'Later, convert to Proper Name format
  111.              Text$ = TOORDER.YourName
  112.              ScreenName$ = "InvToFld"
  113.          CASE 2
  114.              Row = 4: Column = 5: Length = 40
  115.              PropName = True                     'Later, convert to Proper Name format
  116.              Text$ = TOORDER.YourCompany
  117.              ScreenName$ = "InvToFld"
  118.          CASE 3
  119.              Row = 5: Column = 5: Length = 40
  120.              PropName = True                     'Later, convert to Proper Name format
  121.              Text$ = TOORDER.StreetAddress
  122.              ScreenName$ = "InvToFld"
  123.          CASE 4
  124.              Row = 6: Column = 5: Length = 24
  125.              PropName = True                     'Later, convert to Proper Name format
  126.              Text$ = TOORDER.City
  127.              ScreenName$ = "InvToFld"
  128.          CASE 5
  129.              Row = 6: Column = 30: Length = 2
  130.              RetCode = -32                       'turn on Upper Case
  131.              Text$ = TOORDER.State
  132.          CASE 6
  133.              Row = 6: Column = 33: Length = 12
  134.              ValidKeys$ = MID$(Alpha$, 1, 14)    '0-9 Only -- plus .$-+
  135.              Format$ = "##### - ####"
  136.              Text$ = TOORDER.Zip
  137.              ScreenName$ = "InvFormt"
  138.          CASE 7
  139.              Row = 7: Column = 12: Length = 16
  140.              ValidKeys$ = MID$(Alpha$, 1, 14)    '0-9 Only -- plus .$-+
  141.              Format$ = "(###) ### - ####"
  142.              GOSUB ConvertNumber
  143.              RSET Text$ = LTRIM$(TOORDER.Phone)
  144.              ScreenName$ = "InvFormt"
  145.          CASE 8
  146.              Row = 7: Column = 37: Length = 8
  147.              ValidKeys$ = MID$(Alpha$, 1, 14)    '0-9 Only -- plus .$-+
  148.              Format$ = "##/##/##"
  149.              Text$ = TOORDER.TodaysDate
  150.              ScreenName$ = "InvFormt"
  151.          CASE 9
  152.              Row = 10: Column = 52: Length = 2
  153.              ValidKeys$ = MID$(Alpha$, 1, 14)    '0-9 Only -- plus .$-+
  154.              GOSUB ConvertNumber
  155.              x# = TOORDER.Quan1
  156.              '---No Format/Mask found.  Using the following::
  157.              RSET Text$ = FormatUsing$(STRING$(Length, "#"), x#)
  158.              Format$ = ""                        'don't confuse rsMinput w/ a mask
  159.          CASE 10
  160.              Row = 11: Column = 52: Length = 2
  161.              ValidKeys$ = MID$(Alpha$, 1, 14)    '0-9 Only -- plus .$-+
  162.              GOSUB ConvertNumber
  163.              x# = TOORDER.Quan2
  164.              '---No Format/Mask found.  Using the following::
  165.              RSET Text$ = FormatUsing$(STRING$(Length, "#"), x#)
  166.              Format$ = ""                        'don't confuse rsMinput w/ a mask
  167.          CASE 11
  168.              Row = 12: Column = 52: Length = 2
  169.              ValidKeys$ = MID$(Alpha$, 1, 14)    '0-9 Only -- plus .$-+
  170.              GOSUB ConvertNumber
  171.              x# = TOORDER.Quan3
  172.              '---No Format/Mask found.  Using the following::
  173.              RSET Text$ = FormatUsing$(STRING$(Length, "#"), x#)
  174.              Format$ = ""                        'don't confuse rsMinput w/ a mask
  175.          CASE 12
  176.              Row = 13: Column = 52: Length = 2
  177.              ValidKeys$ = MID$(Alpha$, 1, 14)    '0-9 Only -- plus .$-+
  178.              GOSUB ConvertNumber
  179.              x# = TOORDER.Quan4
  180.              '---No Format/Mask found.  Using the following::
  181.              RSET Text$ = FormatUsing$(STRING$(Length, "#"), x#)
  182.              Format$ = ""                        'don't confuse rsMinput w/ a mask
  183.          CASE 13
  184.              Row = 14: Column = 52: Length = 2
  185.              ValidKeys$ = MID$(Alpha$, 1, 14)    '0-9 Only -- plus .$-+
  186.              GOSUB ConvertNumber
  187.              x# = TOORDER.Quan5
  188.              '---No Format/Mask found.  Using the following::
  189.              RSET Text$ = FormatUsing$(STRING$(Length, "#"), x#)
  190.              Format$ = ""                        'don't confuse rsMinput w/ a mask
  191.          CASE 14
  192.              Row = 15: Column = 52: Length = 2
  193.              ValidKeys$ = MID$(Alpha$, 1, 14)    '0-9 Only -- plus .$-+
  194.              GOSUB ConvertNumber
  195.              x# = TOORDER.Quan6
  196.              '---No Format/Mask found.  Using the following::
  197.              RSET Text$ = FormatUsing$(STRING$(Length, "#"), x#)
  198.              Format$ = ""                        'don't confuse rsMinput w/ a mask
  199.          CASE 15
  200.              Row = 16: Column = 52: Length = 2
  201.              ValidKeys$ = MID$(Alpha$, 1, 14)    '0-9 Only -- plus .$-+
  202.              GOSUB ConvertNumber
  203.              x# = TOORDER.Quan7
  204.              '---No Format/Mask found.  Using the following::
  205.              RSET Text$ = FormatUsing$(STRING$(Length, "#"), x#)
  206.              Format$ = ""                        'don't confuse rsMinput w/ a mask
  207.          CASE 16
  208.              Row = 20: Column = 43: Length = 1
  209.              RetCode = -32                       'turn on Upper Case
  210.              Text$ = TOORDER.Taxable
  211.              Minimum$ = "N"
  212.              Maximum$ = "Y"
  213.              ScreenName$ = "InvTxBle"
  214.        END SELECT
  215.  
  216.        LOCATE Row, Column
  217.  
  218.        '---get color at this row/column; rsMinput takes 2 colors (Hilite, Colr to Restore)
  219.  
  220.        GOSUB GetColor
  221.  
  222.        '---use rsMinput or your own editing routine
  223.  
  224.        CALL rsMInput(Text$, ValidKeys$, Exit$, Format$, Length, RetCode, Hilite, Colr)
  225.  
  226.        '---If PropName is 'True,' reformat & reprint our text
  227.        IF PropName THEN Text$ = ProperName$(Text$): CALL rsQprint(Row, Column, Colr, Text$)
  228.  
  229.  
  230.        IF RetCode = -27 THEN EXIT DO             'Esc pressed, exit
  231.  
  232.        GOSUB Validate                            'validate against range you specified
  233.  
  234.        IF Invalid AND RetCode% <> 3 THEN
  235.            BEEP
  236.        ELSE
  237.            SELECT CASE RetCode                   'RetCode = position in Exit$
  238.                                                  '1 = Up Cursor, 2 = Down Cursor, 3 = F1 Help, 4 = F9 Calc
  239.              CASE 1                              'UP cursor
  240.                  FieldNum = FieldNum - 1: IF FieldNum < 1 THEN FieldNum = 16
  241.              CASE 3                              'F1 Help
  242.                  GOSUB DisplayScreen             'display help screen.  Beep = Error
  243.              CASE 4                              'F9 Calc
  244.                  GOSUB DoCalcs                   'calculate your formulas, print results
  245.              CASE ELSE                           'move forward on <cr> or DOWN cursor
  246.                  FieldNum = FieldNum + 1
  247.                  IF FieldNum > 16 THEN GOSUB DoCalcs: FieldNum = 1
  248.            END SELECT
  249.        END IF
  250.  
  251.    LOOP UNTIL RetCode = -27                      'exit on Esc
  252.  
  253. RETURN
  254.  
  255. '─────────────────────────────────────────────────────────────────────────────
  256. GetColor:                                        'get colors at this Row, Column
  257. '─────────────────────────────────────────────────────────────────────────────
  258.    IF Row < 1 OR Column < 1 THEN                 'avoid Illegal Function Call
  259.       BEEP: Colr = 7: Hilite = 112: RETURN
  260.    END IF
  261.  
  262.    Colr = SCREEN(Row, Column, -1)               'get color at this Row/Column
  263.  
  264.    Fore = (Colr MOD 16): Back = (((Colr - Fore) / 16) MOD 128)
  265.    Hilite = (Fore AND 7) * 16 + Back + (Back AND 16) * 7
  266.                                                 'reverse color for editing
  267.  
  268. RETURN
  269.  
  270. '─────────────────────────────────────────────────────────────────────────────
  271. DisplayScreen:                            'Display MAIN and HELP Screens
  272. '─────────────────────────────────────────────────────────────────────────────
  273.    IF LibName$ = "" OR ScreenName$ = "" THEN BEEP: RETURN
  274.  
  275.    IF Exists(LibName$ + ".PSL") AND RTRIM$(ScreenName$) > "" THEN
  276.        REDIM Array%(1)                           'initialize INTEGER screen array
  277.        CALL rsLoadScrn(Array%(), LibName$, ScreenName$, Desc$, TopRow, TopCol, BotRow, BotCol, x, ErrCode)
  278.    ELSE ErrCode = -1
  279.    END IF
  280.  
  281.    IF ErrCode < 1 THEN BEEP: RETURN              'must have been an error
  282.  
  283.    CALL CompRestPLUS(TopRow, TopCol, BotRow, BotCol, SEG Array%(1)): ERASE Array
  284.  
  285. RETURN
  286.  
  287. '─────────────────────────────────────────────────────────────────────────────
  288. Validate:                                        'Validate input against ranges you specified
  289. '─────────────────────────────────────────────────────────────────────────────
  290.  
  291.    Text$ = RTRIM$(Text$)
  292.  
  293.    Invalid = 0                                   'assume it's valid
  294.  
  295.    IF LEN(Minimum$) AND LEN(Maximum$) THEN
  296.        SELECT CASE FieldNum
  297.  
  298.            CASE 1, 2, 3, 4, 5, 16                'it's a Text field
  299.  
  300.              IF Text$ < Minimum$ OR Text$ > Maximum$ THEN Invalid = True
  301.  
  302.  
  303.            CASE ELSE                             'it's a Numeric field
  304.  
  305.            '--- VAL produces 'Type Mismatch' error if 1st character is %, etc. -- Print Using error
  306.              FOR x = 1 TO LEN(Text$)     'if not numeric, change to space
  307.                y = ASC(MID$(Text$, x, 1)): IF y < 42 OR y > 57 THEN MID$(Text$, x, 1) = CHR$(32)
  308.              NEXT
  309.  
  310.              x# = VAL(Text$)
  311.              IF x# < VAL(Minimum$) OR x# > VAL(Maximum$) THEN Invalid = True
  312.        END SELECT
  313.    END IF
  314.  
  315.    IF Invalid THEN RETURN                        'If it's invalid, don't assign
  316.  
  317.    SELECT CASE FieldNum
  318.        CASE 1: TOORDER.YourName = Text$
  319.        CASE 2: TOORDER.YourCompany = Text$
  320.        CASE 3: TOORDER.StreetAddress = Text$
  321.        CASE 4: TOORDER.City = Text$
  322.        CASE 5: TOORDER.State = Text$
  323.        CASE 6: TOORDER.Zip = Text$
  324.        CASE 7: TOORDER.Phone = Text$
  325.        CASE 8: TOORDER.TodaysDate = Text$
  326.        CASE 9: TOORDER.Quan1 = VAL(Text$)
  327.        CASE 10: TOORDER.Quan2 = VAL(Text$)
  328.        CASE 11: TOORDER.Quan3 = VAL(Text$)
  329.        CASE 12: TOORDER.Quan4 = VAL(Text$)
  330.        CASE 13: TOORDER.Quan5 = VAL(Text$)
  331.        CASE 14: TOORDER.Quan6 = VAL(Text$)
  332.        CASE 15: TOORDER.Quan7 = VAL(Text$)
  333.        CASE 16: TOORDER.Taxable = Text$
  334.    END SELECT
  335.  
  336. RETURN
  337.  
  338. '─────────────────────────────────────────────────────────────────────────────
  339. ConvertNumber:     'set length of Text$ equal to # of valid positions in mask; inc. '.'
  340. '─────────────────────────────────────────────────────────────────────────────
  341.    IF LEN(Format$) < 1 THEN Text$ = SPACE$(Length): RETURN
  342.  
  343.    NumberSpaces = 0
  344.    FOR x = 1 TO LEN(Format$)
  345.        IF INSTR("#·.", MID$(Format$, x, 1)) THEN NumberSpaces = NumberSpaces + 1
  346.    NEXT
  347.    Text$ = SPACE$(NumberSpaces)
  348.  
  349. RETURN
  350.  
  351. '─────────────────────────────────────────────────────────────────────────────
  352. DoCalcs:           'Do calculations.  Delete this if none.
  353. '─────────────────────────────────────────────────────────────────────────────
  354.  
  355. '---Calculate: TOORDER.T1
  356.    TOORDER.T1 = TOORDER.Quan1 * 49
  357.    Row = 10: Column = 68: Length = 11
  358.    x# = TOORDER.T1                               'FormatUsing needs DOUBLE Prec.
  359.    Temp$ = SPACE$(Length)
  360.    RSET Temp$ = FormatUsing$("$######,.##", x#)  'RSet to allign decimals, etc.
  361.  
  362.    GOSUB PrintResults
  363.  
  364. '---Calculate: TOORDER.T2
  365.    TOORDER.T2 = TOORDER.Quan2 * 29
  366.    Row = 11: Column = 68: Length = 11
  367.    x# = TOORDER.T2                               'FormatUsing needs DOUBLE Prec.
  368.    Temp$ = SPACE$(Length)
  369.    RSET Temp$ = FormatUsing$("$######,.##", x#)  'RSet to allign decimals, etc.
  370.  
  371.    GOSUB PrintResults
  372.  
  373. '---Calculate: TOORDER.T3
  374.    TOORDER.T3 = TOORDER.Quan3 * 79
  375.    Row = 12: Column = 68: Length = 11
  376.    x# = TOORDER.T3                               'FormatUsing needs DOUBLE Prec.
  377.    Temp$ = SPACE$(Length)
  378.    RSET Temp$ = FormatUsing$("$######,.##", x#)  'RSet to allign decimals, etc.
  379.  
  380.    GOSUB PrintResults
  381.  
  382. '---Calculate: TOORDER.T4
  383.    TOORDER.T4 = TOORDER.Quan4 * 49
  384.    Row = 13: Column = 68: Length = 11
  385.    x# = TOORDER.T4                               'FormatUsing needs DOUBLE Prec.
  386.    Temp$ = SPACE$(Length)
  387.    RSET Temp$ = FormatUsing$("$######,.##", x#)  'RSet to allign decimals, etc.
  388.  
  389.    GOSUB PrintResults
  390.  
  391. '---Calculate: TOORDER.T5
  392.    TOORDER.T5 = TOORDER.Quan5 * 49
  393.    Row = 14: Column = 68: Length = 11
  394.    x# = TOORDER.T5                               'FormatUsing needs DOUBLE Prec.
  395.    Temp$ = SPACE$(Length)
  396.    RSET Temp$ = FormatUsing$("$######,.##", x#)  'RSet to allign decimals, etc.
  397.  
  398.    GOSUB PrintResults
  399.  
  400. '---Calculate: TOORDER.T6
  401.    TOORDER.T6 = TOORDER.Quan6 * 39
  402.    Row = 15: Column = 68: Length = 11
  403.    x# = TOORDER.T6                               'FormatUsing needs DOUBLE Prec.
  404.    Temp$ = SPACE$(Length)
  405.    RSET Temp$ = FormatUsing$("$######,.##", x#)  'RSet to allign decimals, etc.
  406.  
  407.    GOSUB PrintResults
  408.  
  409. '---Calculate: TOORDER.T7
  410.    TOORDER.T7 = TOORDER.Quan7 * 29
  411.    Row = 16: Column = 68: Length = 11
  412.    x# = TOORDER.T7                               'FormatUsing needs DOUBLE Prec.
  413.    Temp$ = SPACE$(Length)
  414.    RSET Temp$ = FormatUsing$("$######,.##", x#)  'RSet to allign decimals, etc.
  415.  
  416.    GOSUB PrintResults
  417.  
  418. '---Calculate: TOORDER.NumPrograms
  419.    TOORDER.NumPrograms = TOORDER.Quan1 + TOORDER.Quan2 + TOORDER.Quan3 + TOORDER.Quan4 + TOORDER.Quan5 + TOORDER.Quan6 + TOORDER.Quan7
  420.    Row = 18: Column = 50: Length = 4
  421.    x# = TOORDER.NumPrograms                      'FormatUsing needs DOUBLE Prec.
  422.    Temp$ = SPACE$(Length)
  423.    RSET Temp$ = FormatUsing$("####", x#)         'RSet to allign decimals, etc.
  424.  
  425.    GOSUB PrintResults
  426.  
  427. '---Calculate: TOORDER.Postage
  428.    TOORDER.Postage = TOORDER.NumPrograms * 3
  429.    Row = 18: Column = 66: Length = 13
  430.    x# = TOORDER.Postage                          'FormatUsing needs DOUBLE Prec.
  431.    Temp$ = SPACE$(Length)
  432.    RSET Temp$ = FormatUsing$("$########,.##", x#)'RSet to allign decimals, etc.
  433.  
  434.    GOSUB PrintResults
  435.  
  436. '---Calculate: TOORDER.SubTot
  437.    TOORDER.SubTot = TOORDER.T1 + TOORDER.T2 + TOORDER.T3 + TOORDER.T4 + TOORDER.T5 + TOORDER.T6 + TOORDER.T7 + TOORDER.Postage
  438.    Row = 19: Column = 66: Length = 13
  439.    x# = TOORDER.SubTot                           'FormatUsing needs DOUBLE Prec.
  440.    Temp$ = SPACE$(Length)
  441.    RSET Temp$ = FormatUsing$("$########,.##", x#)'RSet to allign decimals, etc.
  442.  
  443.    GOSUB PrintResults
  444.  
  445. '---Calculate: TOORDER.SalesTax
  446.    TOORDER.SalesTax = (TOORDER.SubTot * .065) * INSTR("Y", TOORDER.Taxable)
  447.    Row = 20: Column = 66: Length = 13
  448.    x# = TOORDER.SalesTax                         'FormatUsing needs DOUBLE Prec.
  449.    Temp$ = SPACE$(Length)
  450.    RSET Temp$ = FormatUsing$("$########,.##", x#)'RSet to allign decimals, etc.
  451.  
  452.    GOSUB PrintResults
  453.  
  454. '---Calculate: TOORDER.GrandTotal
  455.    TOORDER.GrandTotal = TOORDER.SubTot + TOORDER.SalesTax
  456.    Row = 21: Column = 66: Length = 13
  457.    x# = TOORDER.GrandTotal                       'FormatUsing needs DOUBLE Prec.
  458.    Temp$ = SPACE$(Length)
  459.    RSET Temp$ = FormatUsing$("$########,.##", x#)'RSet to allign decimals, etc.
  460.  
  461.    GOSUB PrintResults
  462.  
  463. RETURN
  464. '─────────────────────────────────────────────────────────────────────────────
  465. PrintResults:       'get color and print calculated results
  466.                     'a separate routine eliminates one CALL per calculation
  467. '─────────────────────────────────────────────────────────────────────────────
  468.    GOSUB GetColor: CALL rsQprint(Row, Column, Colr, Temp$)
  469.  
  470. RETURN
  471.  
  472.