How to write "data" in files?

For questions about using Classic.

Post » Mon Feb 01, 2010 3:20 pm

Hello,
First of all I am new here and I try to learn a lot about this wonderful tool.

I am trying to write some data into a file. For example, I want to write the player name. I inserted an INI object in my Layout and then I stuck. I read on wiki and I searched the forums with no luck.

The idea is to create a new ini file after the user enter his name into a text box and press the "Create button"

I have tried something like:
INI: Set INI file to "profile.ini"
INI: Write string EditBox.Text to item "Name" in group "Player"

but nothing happens..
B
2
G
2
Posts: 20
Reputation: 690

Post » Mon Feb 01, 2010 4:21 pm

[quote="raul":184faifp]INI: Set INI file to "profile.ini"[/quote:184faifp]

There's no path there, just the file name. Odd though, I believe if you left out the path it used to default to C:\, but there's nothing there. Try this:

INI: Set INI file to [color=#40BF00:184faifp]AppPath & "profile.ini"[/color:184faifp]

Be sure to save your .cap first so it knows where AppPath is at. This will create the .ini in the same directory as your .cap (or your .exe when you build it).
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon Feb 01, 2010 6:34 pm

yeah it seems I have to specify AppPath before enter the file name. I though it will work like binary files :)

I observed the "System" has also a "Write to INI file" function. Is there any diference?
B
2
G
2
Posts: 20
Reputation: 690


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests