Using Settings File

Post

Posted
Rating:
#1 (In Topic #305)
Avatar
Regular
Cedron is in the usergroup ‘Regular’
This is forwarded from:

Gambas One - Gambas ONE

(New topics deserve new threads.)

Lavos said

So I looked into this: /comp/gb.settings/settings - Gambas Documentation and this seems like it could only handle form Objects… It's probably obvious for you guys where I'm trying to achieve here(Creating a database for the application to access files when needed.) So starting off, I'm trying to figure out how to create a .ini or .conf file to preset options to save for the user. Perfect reference is getprivateProfileString from windows if that makes any sense to you. I've never worked with XML before but it seems like it might be an alternative, any code examples of that would help.

I'm on a windows machine when i posted this, so any request of posting codes, i'd be happy too when i get to my linux machine.

-Regards, Lavos

I'm not sure where you got the impression that Settings could only handle form Objects.  It deals in strings.  The format of the files are very similar, if not identical, to .ini files in Windows.  And the calls to retrieve the values are also similar.

By default, you will find the .conf file in your ~/.config/gambas3 directory.

You can find a usage example from this thread:

Gambas One - Gambas ONE

Download the copy from the last post.

Ced

.... and carry a big stick!
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Guru
cogier is in the usergroup ‘Guru’
I wrote a simple program to show how to use settings here if it helps.
Online now: Yes Back to the top
1 guest and 0 members have just viewed this.