home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 24 / CD_ASCQ_24_0995.iso / vrac / homonlib.zip / SETVIEW.BAS < prev    next >
BASIC Source File  |  1995-04-13  |  2KB  |  52 lines

  1. DEFINT A-Z
  2.  
  3. ' $INCLUDE: 'PARM.INC'
  4.  
  5. DECLARE SUB SetView (top, bot, parm())
  6.  
  7. SUB SetView (top, bot, parm()) STATIC
  8. '****************************************************************************
  9. 'Used to set the current text viewport (VIEW PRINT) and update the changes in
  10. ' the parm() array.
  11. '
  12. 'To change the current viewport settings, pass the appropriate values in the
  13. ' top and/or bot arguments.  Setting both values to zero will have the effect
  14. ' of releasing the active VIEW PRINT setting and restoring the viewport to
  15. ' the entire screen.
  16. '
  17. 'To reset the the viewport to the values currently stored in parm() without
  18. ' changing either value, pass negative numbers for both arguments.
  19. '
  20. 'Examples:  SetView  0,  0, parm()  -->  Sets viewport to the entire screen.
  21. '           SetView  4, 24, parm()  -->  Sets viewport to rows 4 through 24.
  22. '           SetView  6,  0, parm()  -->  Updates the top row of the viewport
  23. '                                         to 6, leaving the current value for
  24. '                                         the bottom row unchanged.
  25. '           SetView -1, -1, parm()  -->  Resets the viewport to the values
  26. '                                         currently stored in parm() without
  27. '                                         changing either value.
  28. '
  29. '****************************************************************************
  30.  
  31. z = 0                                   'For optimization.
  32.  
  33. IF top > z THEN                         'Set new top value.
  34.      parm(VPTOP) = top
  35. END IF
  36. IF bot > z THEN                         'Set new bottom value.
  37.      parm(VPBOT) = bot
  38. END IF
  39. IF top = z AND bot = z THEN             'Reset viewport to entire screen if
  40.      parm(VPTOP) = z                    'both arguments are zero.
  41.      parm(VPBOT) = z
  42. END IF
  43.  
  44. IF parm(VPTOP) = z OR parm(VPBOT) = z THEN
  45.      VIEW PRINT
  46. ELSE
  47.      VIEW PRINT parm(VPTOP) TO parm(VPBOT)
  48. END IF
  49.  
  50. END SUB
  51.  
  52.