Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Abort Print Job
Message
De
14/06/1996 18:07:51
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Titre:
Divers
Thread ID:
00002314
Message ID:
00002328
Vues:
35
>Keith
>
>Your reply is missing from both messages!
>
>Tom
>
>
>>>Suppose I have a process where I am printing
>>>labels via LABEL FORM xxx NEXT 1000000. As each
>>>label is printed the record is marked as having
>>>been printed. I am uncomfortable with leaving
>>the
>>>success of this entire proces to fate. I need
>>>some reliable means of allowing the user to
>press
>>>a key and exit from this process while insuring
>>>that the records that have been printed are
>>>properly marked.
>>>
>>>If the user simply turns off the printer, some
>of
>>>the records that have been marked will not
>>>actually have been printed because they were
>lost
>>>in the print buffer.
>>>
>>>I have function which returns the empty string
>>>attached to one of the lines of my label which
>>>marks each record. I could also use this to
>>>capture a keypress by the user. The most
>natural
>>>key is the ESC key but I have some difficulty
>>with
>>>that key CRASHING the system.
>>>
>>>I normally deal with the ESC key in my systems
>in
>>>this manner: ON KEY LABEL ESC *
>>> set escape off
>>>
>>>Any rock-solid tried & true methods anyone would
>>>like to share ?

Can't help with buffer loss when printer is turned off, but the following code gives a way of escape that is helpful in keeping the user from panicking and switching off the printer:

PRIVATE m.lnStep,m.llAbort
FOR m.lnStep=1 TO 100000
LABEL FORM xxx NEXT 1
REPLACE printed WITH .T.
SKIP IIF(EOF(),0,1)
=INKEY(.001)
IF LASTKEY()=27
SET LIBRARY TO SYS(2004)+"foxtools.fll" ADDITIVE
m.llAbort=MsgBox("Abort printing?",;
"Escape key pressed....",548)
RELEASE LIBRARY SYS(2004)+"foxtools.fll"
IF m.llAbort
m.lnStep=100000
ENDIF
ENDIF
ENDFOR

Hope this can help!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform