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

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

From: Jeff810095@...
Date: Fri, 14 Dec 2001 05:15:26 EST
Anyone know why the program below Staz sent me doesn't work?

With FutureBASIC™ 1.02 it crashes or I get the message I get with FBII
With FutureBASIC II (3.2.1) says line DIM @volRefNum% "Invalid String/Record 
length specified."
With FB^3 Editor(3.2.0) no changes are made. The converted file is the same 
as the original. Still 90382 bytes, and it looks identical.

Jeff-

===================
dim gOriginal$,newfile$,sz&
dim @volRefNum%
dim h as handle
dim offset&
dim findstring$,replacestring$


h = 0
gOriginal$=FILES$(_fOpen,"TEXT",,volRefNum%)
long if gOriginal$[0]
OPEN "I",1,gOriginal$,,volRefNum%
sz = lof(1,1)
long if sz
h = fn newhandle(sz)
long if h
read file #1,[h],sz
end if
end if
close #1
end if


findstring$ = chr$(10)+chr$(13)
replacestring$ = chr$(13)

long if h
offset& = 0

do
offset& = fn Munger(h, offset&, @findstring$[1], findstring$[0], 
@replacestring$[1], replacestring$[0])
until offset& = -1
end if



newfile$=gOriginal$+" Print"
DEF OPEN "TEXT"
OPEN "O",1,newfile$,,volRefNum%
write file #1,[h],sz
close #1



Watch out for line wrap in the email. The MUNGER line is pretty long.