[futurebasic] Re: [FB] ASCII Text Not Being Print#ed??

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 2001 : Group Archive : Group : All Groups

From: jonnnathan@...
Date: Fri, 7 Dec 2001 22:10:57 +0100
Le vendredi 7 décembre 2001, à 08:29 , Jeff810095@... a écrit :

> IF ASC(prev$)=13 AND ASC(rectRecord$)=10 THEN "skipLF"

i always beware of lines like this as i never know if the compiler will 
understand;

IF (ASC(prev$)) =( 13 AND ASC(rectRecord$)) =10 THEN "skipLF"

or whatever.
i'd suggested first try should be:

IF(( ASC( prev$) = 13) AND( ASC( rectRecord$ ) = 10)) THEN "skipLF"

even better:
_myRC = 13
_myLF = 10

if(( prev$[1] =_myRC) and( rectRecord$[1] =_myLF)) then goto "skipLF"

to be absolutely sure that you're just testing the first char.

but can't you just strip out "LF"s ? i mean they're not really very 
digestible, and this would bring the code to:

if( rectRecord$[1] =_myLF) then rectRecord$[0] = 0

which just cancels out the value
and no goto [for those who suffer allergy problems].

of course you problem will be revealed to be elsewhere and wo will be 
solved by alain.

:-j

ps.
of course, were i programming your app, i wouldn't do it like this at 
all.
i'd read all the file into a handle and then use munger to replace all 
instances of CRLF with CR.
much quicker read, and much quicker replace.

and then you can parse your text in memeory to transcode it, and this 
would be much quicker too.

of course, as that wasn't your question, i haven't written this 
postscriptum.