[Gambas-user] Write-Read from text file

LinuxSeeker linuxseeker at ...626...
Tue Jun 27 01:35:37 CEST 2006


I am writing a program that needs to interact with the user and save the
user's preferences (name, number of textboxes etc) in a text file (named
"conf") at the same directory where the executable is located. The format of
the configuration file will be like:

---------------------------------------
#My comments. These will be added by the program to make to configuration
file easier to understand.
name:(the users name, contained in TextBoxName)
number:(the number of textboxes in a form - the user selects the number from
a ComboBox)
text1:(the contents of TextBox1)
text2:(the contents of TextBox2)
text3:(the contents of TextBox3)
...
text10:(the contents of TextBox10)
#END
------------------------------------

These data must be read from the configuration file as soon as the program
starts and must be loaded in the appropriate position (name->TextBoxName,
text1->TextBox1
, text2->TextBox2... etc.)

You can find an example of the simple app I am trying to write at
http://linstaller.sourceforge.net/rwapp.tar.gz

Any suggestions on how to make this work? How can I update the configuration
file without re-writing the entire configuration file? How do I select which
line to read from?

Please, I am a beginner in Gambas and it all seems difficult due to my lack
of experience with real languages as Gambas is. If you think you can help in
any way please do so.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20060627/5e6f82c6/attachment.html>


More information about the User mailing list