home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / busi / smiiutil.zip / ASCII.PF2 next >
Text File  |  1989-12-24  |  4KB  |  102 lines

  1. '*****************************************************************************
  2. '       FILENAME:   ASCII.PF3 - SmartII ASCII table and color bar generator
  3. '
  4. '     Programmer:   Pierce D. Nunley
  5. '        Updated:   P.M.  12/20/89
  6. '
  7. '          Notes:   Written in PDL (Informix, SmartWare II, Ver. 1.01)
  8. '
  9. '    Description:   Creates ASCII table.  It will save a file of the screen
  10. '                   to a file in the system path with the format of
  11. '                   "[screen driver name].bin".  If this file has been made
  12. '                   for a specific screen driver, each time the program is
  13. '                   run subsequently, it will simply restore the screen which
  14. '                   is almost instantaneous.  There is some interesting error
  15. '                   checking in the last 20 lines of the project file.  The
  16. '                   way the screens are saved and restored should be studied.
  17. '                   It took a fair amount of banging my head against the
  18. '                   computer to get this to work right.  In retrospect it
  19. '                   was an easy implementation, but working backwads is
  20. '                   nothing like working forwards.
  21. '
  22. '
  23. '****************************************************************************
  24. ' Copyright Notice
  25. ' Copyright (c) December 17, 1989    Pierce Nunley Consulting
  26. ' 3921 Bell Ave.
  27. ' Kansas City, Missouri  64111
  28. '****************************************************************************
  29. 'VARIABLE NAME DECLARATIONS
  30. LOCAL $scrn, $sdv_code, $sdv_name, $offset, $row, $col, $char
  31.  
  32. smartpeek $_sdv $sdv_code  'get the current screen driver name
  33.  
  34. 'see if the same screen driver has been mapped before,
  35. if file(path(syspath)|$sdv_code|".bin")
  36.    fopen $sdv_code|".bin" as 1 options syspath ro_mode
  37.    fseek 1 eof
  38.    fposition 1 into $offset
  39.    buffer $scrn size $offset
  40.    fseek 1 0
  41.    fread 1 binary 0 into $scrn
  42.    fclose 1
  43.    screen shortrestore $scrn
  44.    jump exit
  45. end if
  46.  
  47. screen clear box 1 1 scrheight scrwidth 0 0
  48. screen clear box 1 1 25 80 fgpleasing bgpleasing no-border
  49. screen clear box 2 1 23 80 fgpleasing bgpleasing
  50. screen print 1 2 14 bgpleasing format "M78" "SmartII ASCII Table - by Pierce D. Nunley"
  51. screen print 24 4 fgpleasing bgpleasing "0=Null 32=Space 255=Blank"
  52.  
  53. $col=32
  54. for $char = 0 to 15 'print the color bar
  55.   screen print 24 $col $char bgpleasing str($char)
  56.   $col=$col+3
  57. end for
  58.  
  59. $char=0 'start with the "null" character
  60. for $col = 5 to 80 step 6
  61.   for $row = 3 to 22
  62.     screen print $row ($col-len(str($char))) fgpleasing bgpleasing str($char)|"="|chr($char)
  63.     $char=$char+1
  64.     if $char = 256
  65.       screen save 1 1 scrheight scrwidth $scrn
  66.       fopen $sdv_code|".bin" as 1 options syspath
  67.       fwrite 1 binary 0 from $scrn 'using the 0 means that all will be written
  68.       fclose 1
  69.       jump exit
  70.     end if
  71.   end for
  72. end for
  73.  
  74. '--------------------------
  75. label exit
  76. '--------------------------
  77. 'open (read-only mode) and read the screen driver description from the
  78. 'hardware definition file in the system path
  79. fopen "smarthdw.def" as 1 options syspath ro_mode
  80. for $char = 1 to 5
  81.   fread 1 into $sdv_name 'Screen driver is on line 5 of the definition file
  82. end for
  83. fclose 1
  84.  
  85. 'the following lines check to see if the person has selected a screen driver
  86. 'that has to be activated by re-entry into SmartII.  If this has been the
  87. 'case, then the definition file would have the new driver name, but Smart
  88. 'would still be displaying the old driver.  This routine will tell the
  89. 'operator that this situation exists, but will not give the full text
  90. 'explanation of the current screen driver because it is no longer in the
  91. 'SmartII definition file (smarthdw.def).
  92. if trim(left($sdv_name,8))=$sdv_code
  93.   $sdv_name="Screen Driver: "|right($sdv_name,len($sdv_name)-11)
  94. else
  95.   beep
  96.   $sdv_name=""""|$sdv_code|""" is the current driver, """|trim(left($sdv_name,8))|""" will be active on re-entry"
  97. end if
  98. screen print 25 2 14 bgpleasing $sdv_name 'print the screen driver info
  99. inchar
  100.  
  101.  
  102.