Re: [Gambas-user] EOF problem

2010-04-19 Thread Ed & Clare Kelm
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 guess,

Re: [Gambas-user] EOF problem

2010-04-19 Thread Doriano Blengino
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

Re: [Gambas-user] EOF problem

2010-04-18 Thread Ed & Clare Kelm
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 i

Re: [Gambas-user] EOF problem

2010-04-18 Thread Dimitris Anogiatis
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

Re: [Gambas-user] EOF problem

2010-04-18 Thread Ed & Clare Kelm
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 t

Re: [Gambas-user] EOF problem

2010-04-18 Thread Doriano Blengino
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 t

Re: [Gambas-user] EOF problem

2010-04-18 Thread Les Hardy
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 e

Re: [Gambas-user] EOF problem

2010-04-18 Thread Ed & Clare Kelm
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 te

Re: [Gambas-user] EOF problem

2010-04-18 Thread Doriano Blengino
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

Re: [Gambas-user] EOF problem

2010-04-18 Thread Les Hardy
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 th

Re: [Gambas-user] EOF problem

2010-04-18 Thread Les Hardy
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

Re: [Gambas-user] EOF problem

2010-04-17 Thread Dimitris Anogiatis
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" Pr

Re: [Gambas-user] EOF problem

2010-04-17 Thread Ed & Clare Kelm
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

Re: [Gambas-user] EOF problem

2010-04-17 Thread BenoƮt Minisini
> 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

[Gambas-user] EOF problem

2010-04-17 Thread Ed & Clare Kelm
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 Button1_