Re: [Gambas-user] Writing to a file on disk

2010-11-11 Thread NW
On Thu, 11 Nov 2010 15:47:26 +0100 Rolf-Werner Eilert wrote: > > Sure, and Fabien has already given the example, so I quote him here. > Copying his mail, I find something interesting he mentioned right at the > beginning. I've never used that stuff, so just give it a try :-) Here is > what he

Re: [Gambas-user] Writing to a file on disk

2010-11-11 Thread Rolf-Werner Eilert
Am 11.11.2010 15:13, schrieb NW: > On Thu, 11 Nov 2010 09:03:14 +0100 > Rolf-Werner Eilert wrote: > >> Hi Neil, >> >> Nice to read your code. Here are some comments on it: >> >> >> Anyway, for simple textfile input/output, File.Read and File.Save will >> be your friends. >> > As a follow up to thi

Re: [Gambas-user] Writing to a file on disk

2010-11-11 Thread NW
On Thu, 11 Nov 2010 09:03:14 +0100 Rolf-Werner Eilert wrote: > Hi Neil, > > Nice to read your code. Here are some comments on it: > > > Anyway, for simple textfile input/output, File.Read and File.Save will > be your friends. > As a follow up to this. I have searched around via Google and m

Re: [Gambas-user] Writing to a file on disk

2010-11-11 Thread Fabien Bodard
make an archive of your project and send it here 2010/11/11 NW : > On Thu, 11 Nov 2010 09:03:14 +0100 > Rolf-Werner Eilert wrote: > >> Hi Neil, >> >> Nice to read your code. Here are some comments on it: >> >> > >> > Thanks for your comments. I have made the suggested changes. I still get an > e

Re: [Gambas-user] Writing to a file on disk

2010-11-11 Thread NW
On Thu, 11 Nov 2010 09:03:14 +0100 Rolf-Werner Eilert wrote: > Hi Neil, > > Nice to read your code. Here are some comments on it: > > > > Thanks for your comments. I have made the suggested changes. I still get an extra character at the beginning of the line every time I write the new version

Re: [Gambas-user] Writing to a file on disk

2010-11-11 Thread Rolf-Werner Eilert
Hi Neil, Nice to read your code. Here are some comments on it: > > PUBLIC SUB Button1_Click() > >DIM lineIn AS String >DIM fileIn AS File >DIM fname AS String >fname = "/home/neilwin/basic/trial.txt" > Benoit introduced a new way of writing such an OPEN, you already received mes

Re: [Gambas-user] Writing to a file on disk

2010-11-10 Thread Matti
Well, settings it is a real file that you can use with other programs. It is built like [One chapter] first entry = "some text" another entry = "another text" [Another chapter] 1="something else" Of course, you can read that with another program if you know where the information is stored. And, a

Re: [Gambas-user] Writing to a file on disk

2010-11-10 Thread NW
On Wed, 10 Nov 2010 19:21:47 +0100 Fabien Bodard wrote: > have you tryed to replace result by a global string variable ? > > textbox use utf8 charset > > and yes in your case ... use file.save > > > to resume your code > > Private $sResult as string > > PUBLIC SUB Button1_Click() > > $s

Re: [Gambas-user] Writing to a file on disk

2010-11-10 Thread NW
If you want to store just a few informations from your project, there is also the very simple way via the gb.settings component. You have to choose this component in the project properties first. Then (this is Gambas3, look in the docs if you use Gambas2): Write: Settings["MyText/1"] = result.Tex

Re: [Gambas-user] Writing to a file on disk

2010-11-10 Thread Matti
If you want to store just a few informations from your project, there is also the very simple way via the gb.settings component. You have to choose this component in the project properties first. Then (this is Gambas3, look in the docs if you use Gambas2): Write: Settings["MyText/1"] = result.Tex

Re: [Gambas-user] Writing to a file on disk

2010-11-10 Thread Fabien Bodard
have you tryed to replace result by a global string variable ? textbox use utf8 charset and yes in your case ... use file.save to resume your code Private $sResult as string PUBLIC SUB Button1_Click() $sResult = File.Load("/home/neilwin/basic/trial.txt") END PUBLIC SUB Button3_Click()

Re: [Gambas-user] Writing to a file on disk

2010-11-10 Thread NW
On Wed, 10 Nov 2010 17:14:24 +0100 Rolf-Werner Eilert wrote: > > > > Maybe it's better you give us the lines you are using in your program to > read and write the line. Then we should be able to see where the bug > sits :-) > > Did you try the File functions to do this? These should work with

Re: [Gambas-user] Writing to a file on disk

2010-11-10 Thread Rolf-Werner Eilert
Am 10.11.2010 16:46, schrieb NW: > On Wed, 10 Nov 2010 14:38:57 + > NW wrote: > >> My first question on the list. >> >> I am trying to read in a text file with just one line, to make a slight >> change to that line and then to write the new line to the original file on >> disk. The new line

Re: [Gambas-user] Writing to a file on disk

2010-11-10 Thread NW
On Wed, 10 Nov 2010 14:38:57 + NW wrote: > My first question on the list. > > I am trying to read in a text file with just one line, to make a slight > change to that line and then to write the new line to the original file on > disk. The new line should replace the original line in the fi

Re: [Gambas-user] Writing to a file on disk

2010-11-10 Thread Fabien Bodard
you read the file, you write to a temp file , and then you copy the temp file to replace the readed file. 2010/11/10 NW : > My first question on the list. > > I am trying to read in a text file with just one line, to make a slight > change to that line and then to write the new line to the origin

Re: [Gambas-user] Writing to a file on disk

2010-11-10 Thread Stefano Palmeri
Il mercoledì 10 novembre 2010 15:38:57 NW ha scritto: > My first question on the list. > > I am trying to read in a text file with just one line, to make a slight > change to that line and then to write the new line to the original file on > disk. The new line should replace the original line in th

[Gambas-user] Writing to a file on disk

2010-11-10 Thread NW
My first question on the list. I am trying to read in a text file with just one line, to make a slight change to that line and then to write the new line to the original file on disk. The new line should replace the original line in the file. I can read in the file OK. I then use lineinput and