home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
busi
/
smiiutil.zip
/
ASCII.PF2
next >
Wrap
Text File
|
1989-12-24
|
4KB
|
102 lines
'*****************************************************************************
' FILENAME: ASCII.PF3 - SmartII ASCII table and color bar generator
'
' Programmer: Pierce D. Nunley
' Updated: P.M. 12/20/89
'
' Notes: Written in PDL (Informix, SmartWare II, Ver. 1.01)
'
' Description: Creates ASCII table. It will save a file of the screen
' to a file in the system path with the format of
' "[screen driver name].bin". If this file has been made
' for a specific screen driver, each time the program is
' run subsequently, it will simply restore the screen which
' is almost instantaneous. There is some interesting error
' checking in the last 20 lines of the project file. The
' way the screens are saved and restored should be studied.
' It took a fair amount of banging my head against the
' computer to get this to work right. In retrospect it
' was an easy implementation, but working backwads is
' nothing like working forwards.
'
'
'****************************************************************************
' Copyright Notice
' Copyright (c) December 17, 1989 Pierce Nunley Consulting
' 3921 Bell Ave.
' Kansas City, Missouri 64111
'****************************************************************************
'VARIABLE NAME DECLARATIONS
LOCAL $scrn, $sdv_code, $sdv_name, $offset, $row, $col, $char
smartpeek $_sdv $sdv_code 'get the current screen driver name
'see if the same screen driver has been mapped before,
if file(path(syspath)|$sdv_code|".bin")
fopen $sdv_code|".bin" as 1 options syspath ro_mode
fseek 1 eof
fposition 1 into $offset
buffer $scrn size $offset
fseek 1 0
fread 1 binary 0 into $scrn
fclose 1
screen shortrestore $scrn
jump exit
end if
screen clear box 1 1 scrheight scrwidth 0 0
screen clear box 1 1 25 80 fgpleasing bgpleasing no-border
screen clear box 2 1 23 80 fgpleasing bgpleasing
screen print 1 2 14 bgpleasing format "M78" "SmartII ASCII Table - by Pierce D. Nunley"
screen print 24 4 fgpleasing bgpleasing "0=Null 32=Space 255=Blank"
$col=32
for $char = 0 to 15 'print the color bar
screen print 24 $col $char bgpleasing str($char)
$col=$col+3
end for
$char=0 'start with the "null" character
for $col = 5 to 80 step 6
for $row = 3 to 22
screen print $row ($col-len(str($char))) fgpleasing bgpleasing str($char)|"="|chr($char)
$char=$char+1
if $char = 256
screen save 1 1 scrheight scrwidth $scrn
fopen $sdv_code|".bin" as 1 options syspath
fwrite 1 binary 0 from $scrn 'using the 0 means that all will be written
fclose 1
jump exit
end if
end for
end for
'--------------------------
label exit
'--------------------------
'open (read-only mode) and read the screen driver description from the
'hardware definition file in the system path
fopen "smarthdw.def" as 1 options syspath ro_mode
for $char = 1 to 5
fread 1 into $sdv_name 'Screen driver is on line 5 of the definition file
end for
fclose 1
'the following lines check to see if the person has selected a screen driver
'that has to be activated by re-entry into SmartII. If this has been the
'case, then the definition file would have the new driver name, but Smart
'would still be displaying the old driver. This routine will tell the
'operator that this situation exists, but will not give the full text
'explanation of the current screen driver because it is no longer in the
'SmartII definition file (smarthdw.def).
if trim(left($sdv_name,8))=$sdv_code
$sdv_name="Screen Driver: "|right($sdv_name,len($sdv_name)-11)
else
beep
$sdv_name=""""|$sdv_code|""" is the current driver, """|trim(left($sdv_name,8))|""" will be active on re-entry"
end if
screen print 25 2 14 bgpleasing $sdv_name 'print the screen driver info
inchar