Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cntrl char in SDF file?
Message
From
31/10/1999 21:42:04
 
 
To
28/10/1999 15:08:21
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00282908
Message ID:
00284641
Views:
16
Thanks Manivel,
This should do the trick!

>Hi Bill,
>The following code should remove the control character and you have to thank Ralph.
>********************************************************
>Function StripEoF
>********************************************************
>*
>* Written by: Ralph P. Morse Jr. (c) 1995
>* RalphMorse@msn.com
>*
>* Parameter: Path:\FileName
>*
>* Returns:
>* -1 = File access denied
>* 0 = File did not end with
>* +1 = successfully removed
>*
>* Strips an end-of-file byte (0x1Ah) off of a given
>* file if such a byte exists. If the file does
>* not end with an EoF byte, it will not be altered.
>*
>* Usage: =StripEoF("drive:\path\filename.ext")
>********************************************************
>Parameter PCFileName
>Private ;
> JNFileSize ;
> JNFileHand
>
>JNFileHand = FOpen(PCFileName, 12)
>
>If JNFileHand = -1
> Return -1
>Endif
>
>JNFileSize = FSeek(JNFileHand, -1, 2)
>
>If Asc(FRead(JNFileHand, 1)) = 26
> =FChSize(JNFileHand, JNFileSize)
> =FClose(JNFileHand)
> Return 1
>Else
> =FClose(JNFileHand)
> Return 0
>Endif
>**********
Previous
Reply
Map
View

Click here to load this message in the networking platform