home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / basic / library / qb_pds / window / pwez70 / tips.doc < prev    next >
Encoding:
Text File  |  1994-02-01  |  7.0 KB  |  180 lines

  1.  
  2.  
  3.  
  4.  
  5.                              TIPS AND SUGGESTIONS
  6.  
  7.          NOTE: Argument designations are those used in the
  8.          documentation - WIND_REZ.DOC.
  9.  
  10.  
  11.          1. Pulldown and scroll windows require a dummy array to hold
  12.             the info-line data when the info-line is not used.  All
  13.             modules and calls to SCRLWIND and PULLDOWN may use the
  14.             same dummy array.
  15.  
  16.             Place this in the main module:
  17.  
  18.             COMMON SHARED /DUMMYDATA/ DUMMY$()
  19.             DIM DUMMY$(0)
  20.  
  21.             Place this in any other module using routines PULLDOWN or
  22.             SCRLWIND not using the info-line.
  23.  
  24.             COMMON SHARED /DUMMYDATA/ DUMMY$()
  25.  
  26.             Use DUMMY$() to represent the info-line ( when it is not
  27.             used ) in calls to SCRLWIND and PULLDOWN.
  28.  
  29.  
  30.          2. QuickBASIC 4+ can be very unpredictable when using ON
  31.             ERROR GO TO ..  in a sub program or function unless the
  32.             sub program or routine is STATIC.
  33.  
  34.             The following is OK.
  35.  
  36.             SUB TEST ( A%, B% ) STATIC
  37.  
  38.               ON ERROR GOTO LABEL     ' LABEL MUST BE AT MODULE LEVEL
  39.  
  40.             END SUB
  41.  
  42.             The following can cause a STRING SPACE CORRUPT error, a
  43.             crash, or the program may bind.  It may work fine in the
  44.             QB environment, but may cause problems in the executable
  45.             program.
  46.  
  47.             SUB TEST ( A%, B% )       ' No STATIC
  48.  
  49.               ON ERROR GOTO LABEL     ' LABEL MUST BE AT MODULE LEVEL
  50.  
  51.             END SUB
  52.  
  53.             If the ON ERROR and LABEL are both in the main module the
  54.             problem does not occur.
  55.  
  56.  
  57.          3. It is important to know if an active PULLDOWN or INPUT
  58.             window exits.  If either unknowingly exists the following
  59.             will occur on entry to the routines.
  60.  
  61.             - Routine INPTWIND will place a field without a window in
  62.               the location it would occupy based on the coordinates of
  63.               the active input window.  The coordinates in the call to
  64.               INPTWIND are ignored.
  65.  
  66.             - Routine PULLDOWN is re-entered in the active pulldown
  67.               window at same location it was at when it was exited. If
  68.               the active input window is not intact it is not re-
  69.               displayed.  The entries in the active pulldown window
  70.               are re-printed without the window.
  71.  
  72.  
  73.          4. Routine MULTINPT is ALWAYS exited when the cursor leaves a
  74.             "FIXED CHOICE" field.  Use argument RKEY% to determine if
  75.             the SPACE BAR or MOUSE exited MULTINPT.  Remember, even if
  76.             the SPACE BAR or MOUSE is not pressed a FIXED CHOICE field
  77.             will be exited any time the cursor leaves it, or an exit
  78.             key is pressed.
  79.  
  80.             If field 5 ( FROMFLD% = 5 on exit ) is a FIXED CHOICE
  81.             field, on exit from routine MULTINPT the following will
  82.             determine why field 5 caused the exit.
  83.  
  84.             'RKEY% represents the exit key.
  85.  
  86.             IF FROMFLD% = 5 THEN        ' Exit was on field 5.
  87.  
  88.                 SELECT CASE RKEY%
  89.  
  90.                    CASE 32
  91.  
  92.                     ' SPACE BAR caused the exit
  93.  
  94.                    CASE 100
  95.  
  96.                      ' LEFT MOUSE BUTTON release with mouse cursor
  97.                      ' in field 5
  98.  
  99.                    CASE 200
  100.  
  101.                      ' LEFT MOUSE BUTTON pressed with cursor out of
  102.                      ' field 5 and not in any other field.  This can
  103.                      ' only occur if routine SETINPT specified exit
  104.                      ' with LEFT MOUSE BUTTON pressed out of a field.
  105.  
  106.                    CASE 300
  107.  
  108.                      ' LEFT MOUSE BUTTON moved active field to another
  109.                      ' field but the LEFT MOUSE BUTTON was released
  110.                      ' with the mouse cursor out of the new active
  111.                      ' field.  This can not occur if routine SETINPT
  112.                      ' specified exit if LEFT MOUSE BUTTON pressed out
  113.                      ' of a field.
  114.  
  115.                    CASE ELSE
  116.  
  117.                      ' Cursor leaving field 5 or an exit key ( F1, F2,
  118.                      ' etc. ) caused the exit.  If exit was not by the
  119.                      ' SPACE BAR or MOUSE the program will ALWAYS proceed
  120.                      ' here as a FIXED CHOICE field is ALWAYS an auto-exit
  121.                      ' field and MULTINPT is ALWAYS exited.  It may be
  122.                      ' appropriate to do nothing and simply re-enter
  123.                      ' MULTINPT in this case.
  124.  
  125.                 END SELECT
  126.  
  127.             END IF
  128.  
  129.  
  130.          5. If several small windows are placed entirely within a
  131.             larger window it may not be necessary to restore the
  132.             display area under each window.  If the display area under
  133.             the larger window is to be restored it may only be
  134.             necessary to delete the smaller windows via routine
  135.             DELWIND and restore the display area under the larger
  136.             window with routine RSTRWIND.  This is faster and more
  137.             memory efficient than restoring all of the windows.
  138.  
  139.          6.  If partial windows remain on the screen the most likely
  140.              cause is windows were restored out of order.  The top
  141.              window must be restored first if it is not entirely
  142.              inside the bottom window.
  143.  
  144.  
  145.          7.  If a title for a virtual scroll window is defined in the
  146.              call to MAKEWIND for the scroll window, the title will
  147.              not scroll left and right.  The title for virtual scroll
  148.              windows must be set by the argument for the top line in
  149.              routine SCRLWIND. ( TL$ )
  150.  
  151.          8.  The argument for the key character color in virtual
  152.              scroll windows must equal  -1  or an error 24 will be
  153.              reported.  ( STRING WON'T FIT )
  154.  
  155.          9.  If all fields in a call to MULTINPT are not updated on
  156.              entry the cause is argument FROMFLD% does not equal
  157.              zero.  FROMFLD% sets single field update if not zero.
  158.  
  159.          10. It may appear the input routines are not working if the
  160.              text is the same color as the fields.
  161.  
  162.          11. Functions MUST be declared in all modules using them.
  163.  
  164.          12. If routine B4SCRL is used to set up a call to SCRLWIND
  165.              use it immediately before the call to SCRLWIND.  Do not
  166.              allow anything to change the program flow between the
  167.              calls to B4SCRL and SCRLWIND.  Doing so may result in a
  168.              different scroll window assuming the options specified by
  169.              the call to B4SCRL.
  170.  
  171.          13. If routine B4INPT is used to set up a call to INPTWIND
  172.              use it immediately before the call to INPTWIND.  Do not
  173.              allow anything to change the program flow between the
  174.              calls to B4INPT and INPTWIND.  Doing so may result in a
  175.              different input window assuming the options specified by
  176.              the call to B4INPT.
  177.  
  178.  
  179.  
  180.