Help me handle Printing Errors ! 
Author Message
 Help me handle Printing Errors !

I am a programmer in clipper 5.01 and I am trying to do some Printing
error handling in my application through making modification to the
already existing error handling routine in clipper.

The file  name that should be modified is errorsys.prg

Any Ideas of the necessary changes so that the software doesn't jump out
of the program when the printer isn't online ?

Please send your EXPERTISE to me ASAP !



Sun, 07 Sep 1997 14:51:35 GMT  
 Help me handle Printing Errors !

Quote:

>I am a programmer in clipper 5.01 and I am trying to do some Printing
>error handling in my application through making modification to the
>already existing error handling routine in clipper.

>The file  name that should be modified is errorsys.prg

>Any Ideas of the necessary changes so that the software doesn't jump out
i
>of the program when the printer isn't online ?

>Please send your EXPERTISE to me ASAP !

  // around line 70 (ie. just after:
  //    if ( e:genCode == EG_APPENDLOCK .and. e:canDefault )
  if ( e:gencode == EG_PRINT )
     return PrintError()

  end

static Function PrintError()
  local key, altFile, oldColor := set( _SET_COLOR, "w+/r" ), erSysScrn
  local lOverRide := NO, lDevice := set( _SET_DEVICE ) == "PRINTER"
  local lConsole := set( _SET_CONSOLE, ON )

  SAVE SCREEN TO erSysScrn
  if lDevice
    set( _SET_DEVICE, "SCREEN" )

  else
    set( _SET_PRINTER, OFF )

  endif

  #xtranslate Center( <r>, <m>[, <c> ] ) => CenterAt( <r>, NIL, <m>[, <c> ] )

  // display warning:
  Center( 10, "THE PRINTER IS NOT RESPONDING" )
  Center( 12, "With your help, the system will attempt diagnosis!" )
  Center( 13, "Is the light labelled ON LINE or READY lit ?" )

    Center( 10, "Check the cables to ensure they are connected" )
    Center( 11, "properly to both the printer and computer." )
    Center( 13, "Are they tight and connected properly ?" )

      Center( 10, "The system will now attempt to access the" )
      Center( 11, "printer again. if an error occurs again," )
      Center( 12, "have the ADP staff examine the problem." )
      Center( 14, "Press any key to continue printing... ", "i+" )

    elseif !lOverRide
      Center( 10, "Connect the cables properly. if you are not" )
      Center( 11, "sure about how they are connected, contact" )
      Center( 12, "the ADP staff for assistance." )
      Center( 14, "When the cables are reconnected," )
      Center( 15, "press any key to continue printing... ", "i+" )

    endif

  elseif !lOverRide
    Center( 10, "Make sure the power to the printer is on. if the" )
    Center( 11, "ON LINE or READY light is still off, press the" )
    Center( 12, "ON LINE button." )
    Center( 13, "Is the ON LINE or READY light on now ? ", "i+" )

      Center( 10, "The system will now attempt to access the" )
      Center( 11, "printer. if an error occurs again," )
      Center( 12, "have the ADP staff examine the problem." )
      Center( 14, "Press any key to continue printing... ", "i+" )

    elseif  !lOverRide
      Center( 9, "Check to make sure that paper is loaded into" )
      Center( 10, "the printer properly and is not jammed. When" )
      Center( 11, "the paper is ready, press the ON LINE button" )
      Center( 12, "if the light is not on." )
      Center( 14, "Is the paper loaded and clear and the light on ?" )

        Center( 10, "The system will now attempt to access the" )
        Center( 11, "printer. if an error occurs again," )
        Center( 12, "have the ADP staff examine the problem." )
        Center( 14, "Press any key to continue printing... ", "i+" )

      elseif !lOverRide
        Center( 10, "The system will attempt to access the printer" )
        Center( 11, "anyway, if an error occurs again contact the" )
        Center( 12, "ADP staff for assistance." )
        Center( 14, "Press any key to continue printing... ", "i+" )

      endif

    endif

  endif

  if lOverRide
    altfile := dtoj( date() )+left( time(), 2 )+substr( time(), 4, 2 ) + ".RPT"
    set( _SET_PRINTFILE, altfile, YES )

    Center( 10, "Due to printer error the system is " )
    Center( 11, "saving this report to disk " )
    Center( 12, "Filename: "+set( _SET_DEFAULT )+"\"+CURDIR()+"\"+altfile+" ", "i+" )
    Center( 14, "Press any key to continue... ", "i+" )

  endif

  inkey( TIMEOUT )
  restore screen from erSysScrn

  if lDevice
    set( _SET_DEVICE, "PRINTER" )

  else
    set( _SET_PRINTER, ON )

  endif

  set( _SET_COLOR, oldColor )
  set( _SET_CONSOLE, lConsole )

return OK

// lOverRide must be passed by reference
static Function YesNoSave( erSysLin, lOverRide )
  local oMenu, key, nNum

  CREATE MENU oMenu TIME TIMEOUT



  nNum := readmenu( oMenu )
  if nNum < 1
    nNum := 2

  endif
  lOverRide := ( nNum == 3 )

return nNum == 1

// end of cut
The one area this does not address, is if the destination file fills up the
target drive, multiple errors will occur...

        Allen White



Mon, 08 Sep 1997 22:38:05 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Help me handle printing errors !

2. Error Term/0 Print error - - - - - - Who can Help.

3. Help with Error handling

4. Error handling in FiveWin HELP!

5. Error handling, please help!

6. Help: Runtime error handling using Microsoft Fortran 5.x

7. help w/ error handling

8. Help with error handling

9. C5PE Compile Error: err.$$$(1) #6: Error: cif$filewrite The handle is invalid

10. error handling using CALL on error name ErrorRtn

11. Help ! Error in Print to file for C4

12. ERROR TERM/0 Print error (COM1)

 

 
Powered by phpBB® Forum Software