Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking for diskettes
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00008888
Message ID:
00009050
Vues:
34
>Ken, thank you for your response. I appreciate your time. I have been working with the code you gave me below. I have it working except I still have to respond to what I believe are foxpro errors. Such as 'Input/output operation error'. I set an ON ERROR * to snub foxpro which worked. What I was wondering was have I misread the SetErrorMode(1) part? It seems to work the same way with a 1 or a 2. Has fox already intercepted the system error?
>
> Again thanks I am farther along then I have been. <s>
>
>BTW What API book are you using?
>
>-----------------------
>>I'm not sure if this will help any, but there is an API call that will
>>supress the "Disk is not in Drive" error message...
>>
>>Example:
>>
>>DECLARE SetErrorMode IN "kernel32.dll" INTEGER test
>>DECLARE INTEGER GetLastError IN "Kernel32.dll"
>>DECLARE INTEGER FormatMessage IN "kernel32.dll" INTEGER flags, INTEGER
>>notused, INTEGER error, INTEGER locale, STRING @buffer, INTEGER bufsize,
>>INTEGER notused
>>
>>= SetLastError(0)
>>= SetErrorMode(1)
>>nFiles = ADIR(afiles, "A:\*.*")
>>IF nFiles = 0
>> nLastError = GetLastError()
>> cError = SPACE(255)
>> = FormatMessage( 4096, 0, nLastError, 0, @cError, 255, 0)
>> cError = ALLTRIM(STRTRAN( cError, CHR(0)))
>> WAIT WINDOW "Error Code: " + ALLTRIM(STR(nLastError)) + CHR(13) + "Error:
>>" + cError
>> = SetErrorMode(1)
>> = SetLastError(0)
>>ENDIF


Joe

You have an API reference that comes with VFP 3 on the CD. Installable on your HD -- a big file though.

Tom
Tom
--------------------------------
Tom O'Hare
407-299-4268 -- tom@redtile.com -- http://www.redtile.com/
Independent Programmer Using Visual FoxPro, Visual Basic & more...
Operations Manager -- Virtual FoxPro User Group (VFUG)
http://www.vfug.org/ -- tom@vfug.org
President -- Central Florida FoxPro User Group (CFFUG)
http://www.redtile.com/foxpro/
Universal Thread Most Valued Professional (MVP)
http://www.transformation.com/foxpro/
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform