Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Disconnected from network, how to test printer status.
Message
De
15/12/1999 11:33:03
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Disconnected from network, how to test printer status.
Divers
Thread ID:
00304129
Message ID:
00304129
Vues:
59
We print reports with Crystal
We use FOXTOOLS GetProStrg to get the printer port and driver
which is passed to Crystal with the following code:
keyboard '{ENTER}'
lcPrinter=getprinter()
lcSection="Devices"
lcDefault=""
lcBuffer=space(200)
lnLength=len(lcBuffer)
lnLength=GetProStrg(lcSection,lcPrinter,lcDefault,@lcBuffer,lnLength)
jcResult=left(lcBuffer,lnLength)
jcPort=substr(jcResult,at(",",jcResult)+1)
jcDriver=ForceExt(left(jcResult,at(",",jcResult)-1),"DRV")
WITH THISFORM.OleCrystal
.PrinterName=lcPrinter
.PrinterPort=jcPort
.PrinterDriver=jcDriver
The problem that I encounter:
All my printers are network printers,
Usually the program is run, connected to the network, all OK.
At times, I need to run, while not conected to the network,
GetProStrg returns my network printer, which is not connected.
This causes various errors, sometimes crashing my program.

Before running this code, the user indicates if they want
to print or preview.
I preview I can assign
WITH THISFORM.OleCrystal
.PrinterName=''
.PrinterPort=''
.PrinterDriver=''
This avoids the errors, but
1) Crystal preview has a print option,
which will then not print even if there is a printer on-line
2) All subsequent printing, does not print.

Question: How can I test the port returned by GetProStrg
to see if it is online and accessable?
SYS(13) returns ON

Any help would be appreciated,
Shlomo
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform