Ed Clare Kelm ha scritto:
I was feeling that my words could be seemed not appropriate. In fact, I
added that our friends know what they are doing, and labeled those
things as very little thing, knowing in my mind that was experimental
code to debug some strange behavior. Sorry for that. I did
Doriano:
Your words were perfectly appropriate, and I understood them and
appreciate the support!
Thanks!
Yes, I wish EOF would work properly - it would make moving the code from
VB6 to Gambas less trouble, since the VB6 code uses EOF. I really need
to try updating Ubuntu and Gambas I
Hi Ed, After many tries, I managed to recreate your problem.
It happens with your code and the code supplied by Dimitris.
I am using Ubuntu 9.04, Kernel 2.6.28-18, Gambas 2.20.2, QT
I have not managed to figure out the cause yet.
I will do more tests and get back to you.
Regards
Les Hardy
Ed
Hi Ed,
I figured it out.
First of all, depending how the text file was emptied/created, the
contents may not be truely empty.
Gedit for example leaves the 0A (end-of-line) character in the 'empty'
file. This is recognised by eof() as a character, so, end-of-file is not
found.
I am not sure if
Les Hardy ha scritto:
Hi Ed,
I figured it out.
First of all, depending how the text file was emptied/created, the
contents may not be truely empty.
Gedit for example leaves the 0A (end-of-line) character in the 'empty'
file. This is recognised by eof() as a character, so, end-of-file is
Dimitris Les:
First Dimitris:
OK, I pasted in your code. I had to change temp to tmp, because
Temp seems to be a Keyword. With that out of the way, the problem
persists. When it fails, I get EOF both in label1 and the debug
window. When it works OK, I get a blank label1 and the text
Doriano Blengino wrote:
Les Hardy ha scritto:
Hi Ed,
I figured it out.
First of all, depending how the text file was emptied/created, the
contents may not be truely empty.
Gedit for example leaves the 0A (end-of-line) character in the 'empty'
file. This is recognised by eof() as a
Les Hardy ha scritto:
Doriano Blengino wrote:
Les Hardy ha scritto:
Hi Ed,
I figured it out.
First of all, depending how the text file was emptied/created, the
contents may not be truely empty.
Gedit for example leaves the 0A (end-of-line) character in the 'empty'
file.
Hi all:
A couple of comments about the discussions below:
1. The test program was written with EOF at the start, because the
actual program I am working on has this structure, for reading in
multiple lines of text:
WHILE NOT EOF(tfile)
(bunch of code for reading the lines in and putting
Ed,
if reading a text file and extracting information from it is what you're
trying to do, why not just use
tmp = File.Load(Fname)
File.Load is documented over here
http://www.gambasdoc.org/help/comp/gb/file/load
after loading the contents of Fname in tmp you can do your magic, without
using an
Dimitris:
Oooh! That works! Weird. I'll have to write a little code to parse
out my data from the single string variable, but that's a great
work-around if I can't get EOF to work.
Thanks!
Ed K.
Dimitris Anogiatis wrote:
Ed,
if reading a text file and extracting information from it is
Hi!
I'm having a problem reliably reading a text file.
I am using:
Panasonic CF-51 Toughbook
Ubuntu 9.04 , Kernel 2.6.28-18
Gambas 2.8, QT
Below is the code for a test program which demonstrates the problem.
This is a simple form, with one button, and one label. The only code is
the
Hi!
I'm having a problem reliably reading a text file.
I am using:
Panasonic CF-51 Toughbook
Ubuntu 9.04 , Kernel 2.6.28-18
Gambas 2.8, QT
Below is the code for a test program which demonstrates the problem.
This is a simple form, with one button, and one label. The only code is
Thanks for the quick reply!
1. The problem is independent of the contents of the text file.
2. I tried a more complicated test program in which there are TWO
buttons, and TWO different text files. This behaves similarly; most of
the time, failure of one button/file will be accompanied by
Ed can you try this and tell us if it still doesn't work?
PUBLIC SUB Button1_Click()
DIM tfile AS File
DIM Fname AS String
Dim temp AS String
Fname = /home/us/Documents/testdat.txt
tfile = OPEN Fname FOR READ
label1.Text =
IF Eof(tfile) THEN
label1.Text = EOF
Print
15 matches
Mail list logo