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

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

From: Alain Pastor <apastor@...>
Date: Fri, 14 Dec 2001 16:39:04 +0100
Jeff810095@... wrote:
> 
> 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
> 
Jeff,

Jonathan pointed out that the dim as statement is FB^3 only. That's
right. Note also that the bracket syntax for strings is FB^3 only,
thus gOriginal$[0] won't work in FBII, replace that statement with LEN(gOriginal$)

-- 

Cheers

Alain

-----------------------------------------------------
FB^3 in Europe:  http://euro.futurebasic.com/
FB II Pouch:     http://www.pixmix.com/FB/outils.html
-----------------------------------------------------