[Gambas-user] Gambas2: Replace doesn't replace

Rolf-Werner Eilert eilert-sprachen at ...221...
Tue Mar 12 13:24:27 CET 2013


Hi folks,

This is a just another case for me to experience trouble with Replace.

Look at this:

PUBLIC SUB ReplaceStringDruckformulare(kartei AS String, alterString AS 
String, neuerString AS String)
DIM pfad, datei, txt AS String

   pfad = ini.pfadKarteien() &/ kartei &/ "texte"

   FOR EACH datei IN Dir(pfad, "*.frm")
     txt = file.Load(pfad &/ datei)
     Replace(txt, alterString, neuerString)
     file.Save(pfad &/ datei, txt)
   NEXT

END

It does load and save the files, but they remain untouched, i. e. 
Replace doesn't replace anything. When I give e. g.

alterString = "Name1"
neuerString = "NameNew"

nothing happens.

What am I doing wrong? Thanks for your ideas!

Rolf




More information about the User mailing list