[Gambas-user] config file issue

Thomas Mathiesen thomas at ...947...
Wed Apr 13 15:51:06 CEST 2005


> Speaking as the guy who wrote the backtick function (which could 
> probably use some refinement), I'd love to see a project where it 
> fails to work so I can find the bug in my function.  Could you send 
> one?
> 
> Also, rather than using awk and backtick, it looks to me like you 
> should  really be doing
> 
> dim s as string
> dim t as string
> dim pair as new string[]
> dim c as new collection
> 
> s = file.load("/path/to/config/file")
> for each t in split(s, "\n")
> 	pair = split(t, " ")
>         c[pair[0]] = pair[1]
> next
> 
> Of course, you'd need to make c a public variable rather than using 
> DIM if you want to use it throughout your project.
> 
> Rob

Great function Rob!
I've found out that I could use this Gambas file.load to do the config, 
but I wanted to get the backtick fixed.. because I know I'll need it one 
day.

/T




More information about the User mailing list