Dilwyn Jones schreef:
> I *hope* this is just me being stupid. I am having problems with
> compiling a simple INPUT statement!
>SNIP>
> To see what I mean, run this in basic, that works, then compile it
> with QLib 3.36 (must have Winds on)
>
> 10 CLS : CLS #0
> 100 OPEN_NEW #3,ram1_test_txt:PRINT #3,FILL$('.',256):CLOSE #3 : REM
> create test file
> 110 OPEN_IN #3,ram1_test_txt
> 120 INPUT #3,t$ : PRINT t$
> 130 CLOSE #3
>
> Works fine interpreted, you would expect it to cause a 'buffer
> overflow' error message when QLiberator compiled due to exceeding the
> input buffer length (which could be error trapped) but on my system
> the compiled program locks up with no error message. Sometimes with
> (not so) pretty screen pattern corruption.
<SNIP>
> (Francois van Emelen will know what I mean - I am investigating his
> bug report into my TidyUp program when used with 'wide' lines of text
> in files on ramdisk).
Hi Dilwyn,
Using 'input' can return unexpected results even without exceeding
the input buffer length.
100 open#0,con_
105 open#1,con_
110 open#2,con_
115 open_over#3,'ram2_nolinefeed_txt'
120 st1$="Dilwyn":print#3,st1$;
125 rem print#3,st1$; = no linefeed sent
130 close#3
135 rem display error number and error line
140 when error
145 if ernum<>0:print#0,ernum,erlin:endif
150 end when
155 open_in#3,'ram2_nolinefeed_txt'
160 input#3,st$
165 print#0,st$,len(st$):
170 rem len(st$)=0 because there is no linefeed
175 rem in 'ram2_nolinefeed_txt'
180 pause
185 close#3
Kind regards,
François Van Emelen
_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm