[Gambas-user] Writing to a file on disk

NW hiems at ...2501...
Thu Nov 11 16:54:20 CET 2010


On Thu, 11 Nov 2010 15:47:26 +0100
Rolf-Werner Eilert <eilert-sprachen at ...221...> 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 wrote:
> 
> 
> have you tryed to replace result by a global string variable  ?
> 
> textbox use utf8 charset
> 
> and yes in your case ... use file.save
> 
Yes, I did read that but I want to make some changes to the line of code before saving it back to disk so I thought the best way was to use a text box.

Anyway, further research on the Internet and I found a way of doing it. Here is the code I put on a new button for saving the changed line.(Result is the name of the text box).

PUBLIC SUB Button4_Click()

  DIM lines AS String
  DIM dest AS String
  lines = result.Text
  dest = "/home/neilwin/basic/trial.txt"
  File.Save(dest, lines)
  

END

And that has worked just fine.

Now to carry on learning more ....

Neil




More information about the User mailing list