On Wed, 10 Nov 2010 19:21:47 +0100
Fabien Bodard <[email protected]> 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()
>
> $sResult = File.Load("/home/neilwin/basic/trial.txt")
>
> END
>
> PUBLIC SUB Button3_Click()
>
> File.Save("/home/neilwin/basic/trial.txt", $sResult)
>
> END
>
>
>
>
> But i think you want to modify somethong on a line so :
>
>
> dim s as string
> Dim sFile as string
> Dim hFile as File
> Dim sTempName as String
> Dim sMyFile as String = "/home/neilwin/basic/trial.txt"
>
> sTempName = Temp()
>
> hFile = Open sTempName FOR CREATE
>
> sFile = File.Load( sMyFile)
>
> For each s in split(sFile, "\n")
>
> if trim(s) Begin "Var=" then
> s = "coucou"
> endif
>
> print #hFile, s
>
> next
>
> close #hfile
> kill sMyFile
> copy sTempFile TO sMyFile
>
Wow, thanks. I have made a copy of your suggestions and I will study it all
carefully. I will then have a go at it. There is still a lot for me to learn
about Gambas. Thank goodness there is this help list.
I will let you know how I get on,
regards
Neil
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user