Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GOTCHA or know problem???
Message
 
To
19/09/1997 22:18:16
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00049550
Message ID:
00051013
Views:
39
> >I remember having trouble with that in the days of FP1.02... and they >didn't change a thing, eh? Well, I don't mind - we who use LL functions >should be old wolves enough to keep such little tricks in our heads. > Well, it's been a while, I've been doing LL functions, but until now I didn't find this... That's why it was sos strange for me.... Once more I can say, I gotta learn a lot!!! >Besides, I don't trust fgets(), because it expects some kind of a >regular string (i.e. no nulls, ending with cr, lf, or both) but one's >never sure what it might encounter inside. So I prefer writing it like >this: > >#define delim chr(13) >m.go_on = .t. >m.buffer="" >do while m.go_on and not feof(handle1) >m.buffer=m.buffer+fread(handle1, 4096) >m.eol=at(delim, m.buffer) >if m.eol>0 >m.lineoftext = left(m.buffer, m.eol-1) >m.buffer=subs(m.buffer, m.eol+1) >if left ( m.lineoftext, 11 ) = '##########:' >....etc. It does work a bit faster like this (maybe), but the matter is >it checks for feof() (i don't take existence of final record marker for >granted, the file may be corrupt), and chop my buffer into lines. >FGets() will take nulls as line delimiters, and I've had a case of some >unused fields in some records being filled with null bytes - FGets() >simply dropped the rest of the line. FRead() surely gets your data, and >then you can use simple string manipulation to work with it... and yes, >you have to chop it into lines yourself. Well, now I know I can't believe it too, and it makes my faithless in VFP even stronger... ;-) Thanx for inspiration.. Dezider. --
There were three worst disasters in the history of human
race in 20-th century:
1, Hiroshima 44
2, Tchernobyl 86
3, Windows 95
Previous
Reply
Map
View

Click here to load this message in the networking platform