Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
KaBoom!
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00609042
Message ID:
00609603
Vues:
9
The things you learn in your old age....

I never knew.... you think that would be in the description of the FREAD function......

Thanks!!

>Hi Tommy -
>
>According to MSKB Article Q105043:
>
>
>When you are using FoxPro low-level functions to read a file, the maximum number of bytes that can be read in is 65,535. If this number is exceeded, error message #11 "Invalid function argument value, type or count" will be generated.
>

>
>The article says it applies to VFP3, but apparently it's still a problem in later versions as well.
>
>We ran into a similar problem this past week where FGETS() would give the same error if the number of bytes read was greater than 8192. The original VFP6 release didn't have this limitation, but we bumped into it when we moved to SP5.
>
>Regards,
>Scott
>
>
>>This code is part of a email package that sends out emails automatically to our salesreps - and has worked great in other systems here...
>>
>>but..
>>
>>the latest one I released to production just blew up when run for the 1st time (at least that I've been told).
>>
>>Here is the code..
>>
>>

>>*****************************
>>IF pbMailSent
>> *-- Read Log File
>> nFileHandle = FOPEN(sLogFile, 10)
>> nFileEnd = FSEEK(nFileHandle, 0, 2)
>> nFileBeg = FSEEK(nFileHandle, 0)
>> IF nFileEnd > 0
>>--->Bad Line---> sFileData = FREAD(nFileHandle, nFileEnd)
>> ELSE
>> sFileData = ''
>> ENDIF
>> nFileClose = FCLOSE(nFileHandle)
>>
>> DO LogMail WITH sFileData, .T.
>> *=MESSAGEBOX('Email sent successfully!' , 48, 'RSVP')
>>WAIT WINDOW 'Email sent successfully to ' + SUBSTR(psMailTo,2,LEN(psMailTo)-2) NOWAIT
>>Else
>> WAIT CLEAR
>> =MESSAGEBOX('Email not sent. There was an error', 48, 'RSVP')
>>ENDIF
>>*********************************
>>

>>
>>In the bad line above I get the error message 'Function argument, type, or count is invalid'.
>>
>>These are the values
>>
>>nfileHandle = 49
>>nfileEnd = 81500
>>
>>They are numeric....
>>
>>so any ideas???
>>
>>Thanks a heap!
>>Tommy
Tommy Tillman A+ NetWork+ MCP
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform