I *hope* this is just me being stupid. I am having problems with 
compiling a simple INPUT statement!

I am using QLiberator 3.36 on QPC2 v3.31 to compile a simple program 
which inputs text from a file and encountering a problem I've never 
seen before.

INPUT #channel,t$ should fetch a string from a file. Indeed it does 
unless the buffer is not large enough for the size of string. QLib's 
default input buffer is 128 bytes like a JM or AH rom and can be 
enlarged with a $$buff command on post-JM systems. Trouble is, if the 
string is longer than the buffer it ought to give a 'buffer full' 
error message which could be trapped with a Q_ERR_ON 'input' 
statement, instead the compiled program just locks up.

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.

Anybody else able to explain what's going on? I'm sure this used to 
work on earlier SMSQ/E versions. I don't want to pester Marcel with 
this until I know it's not something silly I'm doing wrong!

(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).

-- 
Dilwyn Jones



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 268.2.6/288 - Release Date: 22/03/2006

_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to