home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / code / print / vbbook13 / source.txt next >
Text File  |  1993-04-04  |  21KB  |  592 lines

  1.                         VB BOOK 1.0 Source Code
  2.  
  3.  
  4. NOTE:  This is older code so do NOT use this code to modify VB BOOK!  It 
  5. is included here only to show people without Visual Basic what makes 
  6. VB BOOK click.  
  7.  
  8. The Global form (VBBOOK.BAS):
  9. -----------------------------
  10. Type Flags                           'Misc flag variables
  11.   CurDate As Integer
  12.   DoHeader As Integer
  13.   FileTitle As Integer
  14.   LineLen As Integer
  15.   LineWrap As Integer
  16.   PgNumber As Integer
  17. End Type
  18.  
  19. 'The VBBOOK.FRM form: (used for the first little box that goes away in 5 sec's.)
  20. '--------------------
  21. '(No code in this form.  Just displays a message for 5 secs)
  22.  
  23. 'The VBBOUT.FRM form:
  24. '--------------------
  25. '(No code in this form.  It's a blank, full-page form used to cover up the
  26. 'desktop.  There should be a better way to do this!)
  27.  
  28. 'The Main module, VBBINP.FRM: (This is where all the selections are done.)
  29. '----------------------------
  30. 'Declarations section:
  31. 'Note that Dim Shared is not really needed but VB done it during the automatic
  32. 'conversion from QuickBasic code so I left it that way.  
  33. Dim Shared ESC$, FF$, LF$, filename$, OUTFILE$, NL$
  34. Dim Shared page%, num$, tune%
  35. Dim Shared PC As Flags
  36. Dim lastchange As Integer
  37.  
  38. Const fileboxclick = 0, dirsboxclick = 1         'Used by file selection routine
  39. Const true = -1, false = 0
  40.  
  41. 'Now the Subs start:
  42. Static Sub BuildArray (ptrarray&(), pgcount%)
  43.    MaxLines% = 66                                'Maximum number of lines
  44.    Offset& = 1                                   'Start of file (seek point)
  45.    Open filename$ For Binary Access Read As #1 Len = 1   'Open file to check
  46.    TotalSize& = LOF(1)                           'Get LEN of file so we don't read too far
  47.    FileLeft& = TotalSize&                        'Setup a counter to show whats left
  48.    'FRE is not supported by VB.  Just set it to 64K
  49.    MemAvail& = 65536                             'FRE(FileName$) - 2048            'Check available string memory
  50.    If MemAvail& < 2048 Then Error 14             'Force out of memory error
  51.    SixteenK% = 16384
  52.  
  53.    If TotalSize& > SixteenK% Then                'Set a buffer size
  54.       If MemAvail& > SixteenK% Then              'If the file is larger than 16K
  55.          BufAvail& = SixteenK%                   'Set it to 16k
  56.       Else
  57.          BufAvail& = MemAvail&
  58.       End If
  59.    Else
  60.       If TotalSize& < MemAvail& Then             'Otherwise set it to file size
  61.          BufAvail& = TotalSize&
  62.       End If
  63.       BuffSize% = BufAvail&
  64.    End If
  65.  
  66.    pgcount% = 1                                  'Initialize page count
  67.    ptrarray&(pgcount%) = 1                       'First pointer is always 1
  68.    LnCount% = 0                                  'Initialize line count
  69.  
  70. GetPage:                                         'Read the file
  71.                                                  
  72.   If FileLeft& < BufAvail& Then                  'Check amount left to read
  73.      Buffer$ = Space$(FileLeft&)                 'If less than our buffer, use lessor
  74.   Else
  75.      Buffer$ = Space$(BufAvail&)                 'Otherwise use full buffer size
  76.   End If
  77.  
  78.   Get #1, Offset&, Buffer$                       'Read in a buffers worth
  79.   stptr% = 1                                     'Pointer into buffer$
  80.   LastLine% = 0                                  'remember last position
  81.  
  82. PageCheck:
  83.   TempLn% = InStr(stptr%, Buffer$, LF$)          'Position of next linefeed
  84.   temppg% = InStr(stptr%, Buffer$, FF$)          'Position of next pagefeeds
  85.  
  86.   If temppg% Then                                'If there was a page feed
  87.      If temppg% < TempLn% Or TempLn% = 0 Then    '  was it before our linefeed?
  88.         pgcount% = pgcount% + 1                  '  yes then bump page count
  89.         ptrarray&(pgcount%) = Offset& + temppg%  '  set next array element
  90.         stptr% = temppg% + 1                     '  set instr pointer
  91.         LnCount% = 0                             '  reset linecount
  92.         If stptr% < Len(Buffer$) Then GoTo PageCheck 'and loop back for more
  93.       End If
  94.   End If
  95.  
  96.   If TempLn% Then                                'Linefeed
  97.     If PC.LineWrap Then                           'If Line Wrap, check length
  98.         If TempLn% - stptr% > PC.LineLen Then     'Greater than 80?
  99.             Do                                   'check for line wrap
  100.                 LnCount% = LnCount% + 1          'increment line
  101.                 If LnCount% = MaxLines% Then
  102.                     GoTo PageBreak               '> 66 lines
  103.                 End If
  104.                 stptr% = stptr% + PC.LineLen
  105.             Loop While TempLn% - stptr% > PC.LineLen
  106.         End If
  107.     End If
  108.     LnCount% = LnCount% + 1                      'Increment page count
  109.  
  110. PageBreak:
  111.      If LnCount% = MaxLines% Then
  112.         pgcount% = pgcount% + 1
  113.             If pgcount% > 512 Then
  114.                msg$ = "Too may pages - printing only 512."
  115.                MsgBox msg$, 0, "Notice"
  116.                GoTo EndBuild
  117.             End If
  118.         ptrarray&(pgcount%) = Offset& + TempLn%  'point to next in point in file
  119.         LnCount% = 0
  120.      End If
  121.      
  122.      stptr% = TempLn% + 1                        'point ahead 1 byte for next scan
  123.      If stptr% <= Len(Buffer$) Then
  124.         GoTo PageCheck                           'keep checking
  125.      End If
  126.   End If
  127.  
  128.   Offset& = Offset& + Len(Buffer$)              'Pointer into file (tally)
  129.   stptr% = 1                                    'Reset Buffer pointer
  130.   FileLeft& = TotalSize& - Offset&              'Calculate how much is left
  131.   If Offset& < TotalSize& Then GoTo GetPage     'If more text in file, keep going
  132.  
  133. EndBuild:
  134.   ptrarray&(pgcount% + 1) = TotalSize&          'Set last pointer to end of file
  135.  
  136. Close #1                                        'Close input file
  137. End Sub                                         'End of BuildArray Sub
  138.  
  139. Static Sub DoMacro (num$)
  140.     Print #2, ESC$; "&f"; num$; "y2X";     'execute the macro
  141. End Sub
  142.  
  143. Static Sub EndMacro (num$)
  144.     Print #2, ESC$; "&f"; num$; "y1X";          'Send end of macro command
  145.     Print #2, ESC$; "&f"; num$; "y9X";          'Make it temporary (10 to be permanent)
  146. End Sub
  147.  
  148. Static Sub Header (page%)
  149.     hdr$ = Space$(PC.LineLen)                     'Create a string to print
  150.    
  151.     If PC.FileTitle Then                          'Print the filename
  152.         Mid$(hdr$, 40 - Len(filename$) \ 2) = UCase$(filename$)
  153.     End If
  154.  
  155.     If PC.PgNumber Then                           'Print the current page
  156.         PTemp$ = "Page" + Str$(page%)
  157.         If page% Mod 2 Then
  158.             Mid$(hdr$, PC.LineLen - Len(PTemp$)) = PTemp$ 'odd page, right side
  159.         Else
  160.             Mid$(hdr$, 1) = PTemp$               'even page, left side
  161.         End If
  162.     End If
  163.  
  164.     If PC.CurDate Then                            'Print the current date
  165.         If page% Mod 2 Then
  166.             Mid$(hdr$, 1) = Date$                'even page, left side
  167.         Else
  168.             Mid$(hdr$, PC.LineLen - Len(Date$)) = Date$  'odd page, right side
  169.         End If
  170.     End If
  171.     Print #2, hdr$                               'Print the Header
  172.     Print #2,                                    ' and skip a line for readability
  173.  
  174. End Sub
  175.  
  176. Static Sub LJLocate (X%, Y%)                'Laser Jet cursor locate
  177.     Temp$ = ESC$ + "&a" + LTrim$(Str$(Y%)) + "r" + LTrim$(Str$(X%)) + "C"
  178.     Print #2, Temp$;
  179. End Sub
  180.  
  181. Static Sub printlogo ()                  'Banner logo (About VB Box!)
  182.     msg$ = "                   VB Book" + NL$
  183.     msg$ = msg$ + "     Converted to Visual Basic" + NL$
  184.     msg$ = msg$ + "             by Dennis Scott." + NL$
  185.     msg$ = msg$ + NL$
  186.     msg$ = msg$ + "Send Comments/Suggestions to:" + NL$
  187.     msg$ = msg$ + "               CompuDirect" + NL$
  188.     msg$ = msg$ + "             7711 Bulter Rd" + NL$
  189.     msg$ = msg$ + "             Myrtle Beach, SC" + NL$
  190.     msg$ = msg$ + "               (803)650-7452" + NL$
  191.     MsgBox msg$, 0, "About VB Book"
  192. End Sub
  193.  
  194. Sub PrintSetup ()                               'Send codes to prepare printer
  195.     Print #2, ESC$; "E";                        'Reset laserjet (simple isn't it!)
  196.     Print #2, ESC$; "&l1o5.45C";                'Select lineprinter font"
  197.     Print #2, ESC$; "(s0p16.66H";               '  and pitch
  198.     Print #2, ESC$; "&l0L";                     'Turn off page feed at 66 lines
  199.  
  200.     If PC.LineWrap Then                          'Wrap lines > 80 chars
  201.        Print #2, ESC$; "&s0C";
  202.     End If
  203.  
  204.     Print #2, ESC$; "&l2E";                     'Top margin 2 lines
  205.  
  206.     Call StartMacro("1")                        'Left side macro
  207.          Print #2, ESC$; "9";                   'Reset left - right margins
  208.          Print #2, ESC$; "&a0l80M";             'set left margin 0, right 80
  209.     Call EndMacro("1")
  210.  
  211.     Call StartMacro("2")                        'Right side macro
  212.          Print #2, ESC$; "9";                   'Reset left - right margins
  213.          Print #2, ESC$; "&a95l175M";           'set left margin 95, right 175
  214.     Call EndMacro("2")
  215.  
  216. End Sub
  217.  
  218. Static Sub StartMacro (num$)
  219.     Print #2, ESC$; "&f"; num$; "Y";            'Macro will have an id of Num$
  220.     Print #2, ESC$; "&f0X";                     'Start the macro now
  221. End Sub
  222.  
  223. Sub Form_Click ()
  224.     'If user clicks anywhere on the form, call the about box
  225.     Call printlogo
  226. End Sub
  227.  
  228. 'This is the main code - everything is actually called from here and this
  229. 'is where most of the VB changes are located
  230. Sub go_click ()
  231.  
  232. 'VB Code for Drive, Directory, and File selections
  233. If index >= 3 Then End
  234. If lastchange = dirsboxclick Then
  235.     dir1.path = dir1.list(dir1.listindex)
  236. Else
  237.     If file1.filename <> "" Then
  238.         ChDrive drive1.drive
  239.         ChDir file1.path
  240.         filename$ = file1.filename
  241.     Else
  242.         msg$ = "Sorry!  You must first select a file."
  243.         abort% = MsgBox(msg$, 49, "No application chosen.")
  244.         If abort% = 2 Then                     'cancel button
  245.             End
  246.         End If
  247.     End If
  248. End If
  249. lastchange = fileboxclick
  250.  
  251. ReDim ptrarray&(513)                            'total number of pages (512)
  252. On Error GoTo ErrorDept                         'Error trapping
  253.  
  254. 'Ensure that we have a file name (user may have clicked DoIt without
  255. 'entering a filename)
  256.  
  257. GetName:
  258.     If Len(filename$) = 0 Then
  259.        If tune% Then Beep
  260.         msg$ = "Enter a file name to print: "
  261.         Title$ = "Filename"                             ' Set title.
  262.         Default$ = ""
  263.         NewName$ = InputBox$(msg$, Title$, Default$)    ' Get user input.
  264.         If Len(NewName$) = 0 Then                       ' Check if valid.
  265.             msg$ = "You did not input a valid Filename." + NL$
  266.             msg$ = msg$ + "Click on OK to End Program"
  267.             MsgBox msg$, 0, Title$                      ' Display message.
  268.             GoTo OutHere
  269.         End If
  270.     End If
  271.  
  272. 'Build index array for pages in FileName$
  273.    'Have not converted status display
  274.    'Print
  275.    'Print "Reading file "; filename$
  276.    Call BuildArray(ptrarray&(), page%)          'Built pointer array
  277.  
  278. 'Figure number of pages needed
  279.    If page% Mod 4 Then                          'Even multiples of 4 only
  280.       page% = page% + (4 - page% Mod 4)         '  correct for less
  281.    End If
  282.  
  283.    'Have not converted status display
  284.    'Print
  285.    'Print "You will print "; Page% \ 4; "sheets" 'Report total number of pages
  286.    'Print
  287.  
  288.    'JustCount% is set to false always due to status section not being
  289.    'converted to VB
  290.    If JustCount% Then
  291.       Print "Press any key to continue, or ESC to cancel printing"
  292.       GoSub KeyIn
  293.    End If
  294.  
  295.     Open OUTFILE$ For Output As #2              'Open printer or output file
  296.     Call PrintSetup                             'Set up printer
  297.  
  298. 'Page parsing variables
  299.    LeftSide% = page%
  300.    RightSide% = 1
  301.    FirstPass% = -1
  302.  
  303. Open filename$ For Binary As #1                 'Open the input file
  304.     'Have not converted status display
  305.     'Print "Printing Side 1 to "; outfile$;     'Track what is going on
  306.  
  307. 'Start of print routine
  308.  
  309. DoPass:
  310.    Bookmark% = (page% \ 4)                      'Flag for halfway through
  311.    If Bookmark% = 0 Then Bookmark% = 1          'Force 1 if too small
  312.  
  313. 'Read text and send to printer or file
  314. Do                                              'Print the right side of the page first
  315.     If ptrarray&(RightSide% + 1) = 0 Then       'If blank, then skip it
  316.        GoTo NextPage
  317.     End If
  318.     Call DoMacro("2")                           'Start on right side
  319.     LJLocate 95, 0                              'Home the cursor
  320.  
  321.     If PC.DoHeader Then Call Header(RightSide%) 'Header if needed
  322.     Buffer$ = Space$(ptrarray&(RightSide% + 1) - ptrarray&(RightSide%))
  323.  
  324.     Get #1, ptrarray&(RightSide%), Buffer$      'Read in a page
  325.  
  326.     If InStr(Buffer$, FF$) Then                 'If the last character is a PF
  327.        Print #2, Left$(Buffer$, InStr(Buffer$, FF$) - 1); 'print only text
  328.     Else
  329.        Print #2, Buffer$;                       'Otherwise print full line
  330.     End If
  331.  
  332. NextPage:
  333.     If ptrarray&(LeftSide% + 1) = 0 Then        'Don't print blank pages
  334.        GoTo NextPage1
  335.     End If
  336.     Call DoMacro("1")                           'Reset margins for left side
  337.     LJLocate 0, 0                               'Home the cursor
  338.     If PC.DoHeader Then Call Header(LeftSide%)   'Header if needed
  339.     Buffer$ = Space$(ptrarray&(LeftSide% + 1) - ptrarray&(LeftSide%))                'Setup buffer for input
  340.     If LeftSide% = 0 Then                       'If pointing at blank page, skip
  341.        GoTo NextPage1
  342.     End If
  343.     Get #1, ptrarray&(LeftSide%), Buffer$       'Read in a page
  344.  
  345.     If InStr(Buffer$, FF$) Then                 'if the last character is a PF
  346.        Print #2, Left$(Buffer$, InStr(Buffer$, FF$) - 1); 'print only text
  347.     Else                                        'print only text
  348.        Print #2, Buffer$;                       'otherwise print all
  349.     End If
  350.  
  351. NextPage1:
  352.     Print #2, FF$;                              'Page feed
  353.     LeftSide% = LeftSide% - 2                   'Calculate next page in series
  354.     RightSide% = RightSide% + 2
  355.     Bookmark% = Bookmark% - 1                   'Track our progress
  356.  
  357. Loop Until Bookmark% = 0                        'Print pages until halfway through
  358.  
  359. 'Pause between sides to allow for paper reinsertion
  360.     If FirstPass% Then                          'If side one, prompt and get 2nd side
  361.        msg$ = "First Pass has been Completed." + NL$
  362.        msg$ = msg$ + "Insert paper back in tray and Click OK"
  363.        If tune% Then Beep
  364.  
  365. WaitKey:                                        'Press any key to continue loop
  366.       MsgBox msg$, 0, "Waiting"
  367.       FirstPass% = 0                            'Flag for second pass
  368.       'Have not converted status display
  369.       'msg$ = "Printing Side 2 to " + outfile$
  370.       'Print msg$                                'Report on progress
  371.       GoTo DoPass
  372.     End If                                      'End of first pass
  373.  
  374.     'Printing is done now
  375.     msg$ = "Printing completed."
  376.     If tune% Then Beep
  377.     MsgBox msg$, 64, "Done"
  378.  
  379. PrtReset:
  380.     Print #2, ESC$; "E";                        'Reset laserjet
  381.  
  382. OutHere:
  383.     Close                                       'Close all files
  384.     End                                         'Thats all for now
  385.  
  386. 'Error handler.  Converted to VB errors.
  387. ErrorDept:
  388.     Beep
  389.     msg$ = "*** Error ***" + NL$
  390.     Select Case Err
  391.       Case 482
  392.          msg$ = msg$ + "Printer error."
  393.       Case 68
  394.          msg$ = msg$ + "Device is unavailable."
  395.       Case 71
  396.          msg$ = msg$ + "Insert a disk in the drive and close the door."
  397.       Case 57
  398.          msg$ = msg$ + "Device Input/Output Error (Check Printer!)."
  399.       Case 61
  400.          msg$ = msg$ + "Disk is full."
  401.       Case 64, 52
  402.         msg$ = msg$ + "That filename is illegal."
  403.       Case 76
  404.         msg$ = msg$ + "That path doesn't exist."
  405.       Case 54
  406.         msg$ = msg$ + "Can't open your file for that type of access."
  407.       Case 55
  408.         msg$ = msg$ + "This file is already open."
  409.       Case 62
  410.         msg$ = msg$ + "This file has a nonstandard end-of-file marker" + NL$
  411.         msg$ = msg$ + "or an attempt was made to read beyond the end-" + NL$
  412.         msg$ = msg$ + "of-file marker."
  413.       Case Else
  414.          msg$ = msg$ + "Error number " + Str$(Err)
  415.       End Select
  416.       GoSub AWayOut
  417.       Resume
  418.  
  419. AWayOut:
  420.    abort% = MsgBox(msg$, 17, "ERROR")
  421.  
  422. KeyIn:
  423.       If abort% = 2 Then                     'If user presses Cancel, Exit
  424.          Close
  425.          End
  426.       End If
  427. Return
  428.  
  429. 'End of main module
  430. End Sub
  431.  
  432. Sub Dir1_Change ()
  433.     file1.path = dir1.path
  434.     file1.SetFocus
  435. End Sub
  436.  
  437. Sub Dir1_Click ()
  438.     lastchange = dirsboxclick
  439. End Sub
  440.  
  441. Sub File1_Click ()
  442.     'use the following line to put filename in frame
  443.     'if using a frame:
  444.     'inname.caption = "Load " + file1.filename
  445.     lastchange = fileboxclick
  446. End Sub
  447.  
  448. Sub File1_DblClick ()
  449.     'Allow the user to double-click on an input file and start printing
  450.     Call go_click
  451. End Sub
  452.  
  453. 'CLKx Subs are the Check Boxes for selecting whether to use speaker, etc
  454. Sub clk1_Click ()
  455.       'Toggle on/off
  456.       If PC.FileTitle = 0 Then
  457.         PC.FileTitle = -1
  458.         PC.DoHeader = -1
  459.       Else
  460.         PC.FileTitle = 0
  461.         'Still have to do the Header if clk2 or clk3 buttons are checked
  462.         If (clk2.value = -1) Or (clk3.value = -1) Then
  463.             PC.DoHeader = -1
  464.         Else
  465.             PC.DoHeader = 0
  466.         End If
  467.       End If
  468. End Sub
  469.  
  470. Sub clk2_Click ()
  471.       'Toggle on/off
  472.       If PC.CurDate = 0 Then
  473.         PC.CurDate = -1
  474.         PC.DoHeader = -1
  475.       Else
  476.         PC.CurDate = 0
  477.         'Still have to do the Header if clk1 or clk3 buttons are checked
  478.         If (clk1.value = -1) Or (clk3.value = -1) Then
  479.             PC.DoHeader = -1
  480.         Else
  481.             PC.DoHeader = 0
  482.         End If
  483.       End If
  484. End Sub
  485.  
  486. Sub clk3_Click ()
  487.       'Toggle on/off
  488.       If PC.PgNumber = 0 Then
  489.         PC.PgNumber = -1
  490.         PC.DoHeader = -1
  491.       Else
  492.         PC.PgNumber = 0
  493.         'Still have to do the Header if clk1 or clk2 buttons are checked
  494.         If (clk1.value = -1) Or (clk2.value = -1) Then
  495.             PC.DoHeader = -1
  496.         Else
  497.             PC.DoHeader = 0
  498.         End If
  499.       End If
  500. End Sub
  501.  
  502. Sub clk4_Click ()
  503.     'Toggle on/off
  504.     tune% = Not tune%
  505. End Sub
  506.  
  507. Sub clk5_Click ()
  508.       'Toggle on/off
  509.       PC.LineWrap = Not PC.LineWrap
  510. End Sub
  511.  
  512. Sub Drive1_Change ()
  513.     dir1.path = drive1.drive
  514. End Sub
  515.  
  516. Sub Cancel_Click ()
  517.     'If user clicks on the Cancel button then ...
  518.     Close
  519.     End
  520. End Sub
  521.  
  522. 'This Sub is ran when the VBBINP.FRM is loaded (ie, Showed)
  523. Sub Form_Load ()
  524.     'Put the options in the output port/filename Combobox
  525.     comboutname.AddItem "LPT1"
  526.     comboutname.AddItem "LPT2"
  527.     comboutname.AddItem "COM1"
  528.     comboutname.AddItem "COM2"
  529.     comboutname.AddItem "file"
  530.     comboutname.text = comboutname.list(0)    'default to LPT1
  531.     OUTFILE$ = "LPT1"
  532.     'set default check-box values
  533.     tune% = -1
  534.     PC.FileTitle = -1
  535.     PC.DoHeader = -1
  536.     PC.CurDate = -1
  537.     PC.PgNumber = -1
  538.     PC.LineWrap = -1
  539.     'set some variables
  540.     ESC$ = Chr$(27)                      'Standard ESC code
  541.     FF$ = Chr$(12)                       'Page Feed
  542.     LF$ = Chr$(10)                       'Line Feed
  543.     NL$ = Chr$(13) + Chr$(10)            'CR and LF (New Line)
  544.     JustCount% = 0                       'Not allowing "just counting"
  545.     PC.LineLen = 80                       'Maximum length of line
  546. End Sub
  547.  
  548. 'User clicks on the Combobox
  549. Sub comboutname_Click ()
  550.     'Select where to send the output
  551.     Select Case comboutname.text
  552.     Case "LPT1"
  553.         OUTFILE$ = "LPT1"
  554.     Case "LPT2"
  555.         OUTFILE$ = "LPT2"
  556.     Case "COM1"
  557.         OUTFILE$ = "COM1"
  558.     Case "COM2"
  559.         OUTFILE$ = "COM2"
  560.     Case "file"
  561.         If file1.filename = "" Then           'If no input filename is selected
  562.             comboutname.text = "LPT1"         ' default back to LPT1
  563.             OUTFILE$ = "LPT1"
  564.             msg$ = "You must select an input filename first!"
  565.             MsgBox msg$, 32
  566.             file1.SetFocus                    'set focus to file list box
  567.             Exit Sub
  568.         End If
  569.  
  570.         'Now make up a default output filename with same 
  571.         'name and PRN as the extension
  572.         OUTFILE$ = UCase$(Left$(file1.filename, InStr(file1.filename, ".")) + "PRN")
  573.         
  574.     msg$ = "WAIT" + NL$ + "Enter filename to print to:"
  575.         OUTFILE$ = InputBox$(msg$, "Output File Name", OUTFILE$) 'Get a filename
  576.         If OUTFILE$ <> "" Then
  577.             comboutname.text = UCase$(OUTFILE$)         'put filename in combo box
  578.             go.SetFocus
  579.         Else
  580.             'Insist on a filename
  581.             comboutname.text = "LPT1"
  582.             OUTFILE$ = "LPT1"
  583.             file1.SetFocus                              'set focus to file list box
  584.         End If
  585.     End Select
  586. End Sub
  587.  
  588. Sub Picture1_Click ()
  589.     Call printlogo                          'Show the "about" box
  590. End Sub
  591.  
  592.