Ini Object & Path Object

For questions about using Classic.

Post » Fri Feb 13, 2009 8:13 pm

Hi!! I'am a Construct fan, the work of the team is incredible!!
I need help with the Ini & Path Object,
How i can do to write a Ini file in (for example) my documents using "Path",
I use this:
SET INI FILE -> Set Ini File to "'Path.MyDocuments'Inifile.ini" and don't work,
i have as result a ini file stored in c:\WINDOWS\ called 'Path.MyDocuments'Inifile.ini.

Nos Vemos! y Gracias a Todo el Equipo por Crear Construct!!
PD: I trying to make a external CONFIGURATION windows apps, i someone want to know.
- Sorry about my poor english- THIS IS NO MY MOTHER TOUNGUE
B
4
S
1
G
4
Posts: 20
Reputation: 1,292

Post » Fri Feb 13, 2009 8:31 pm

You don't want to put Path.MyDocuments in quotes because it's an expression, not a string. Your code should look more like this:

Path.MyDocuments & "inifile.ini"

The "&" symbol will essentially stitch strings and expressions together. Hope that helps. :)
Moderator
B
97
S
36
G
19
Posts: 1,584
Reputation: 17,692

Post » Fri Feb 13, 2009 9:01 pm

Windows Vista might not let you write to the My Documents folder like that.

You could alternatively try storing it in the same directory as the application:
AppPath & "myfile.ini"
Scirra Founder
B
357
S
214
G
72
Posts: 22,946
Reputation: 178,208

Post » Fri Feb 13, 2009 11:03 pm

I'm not sure that works either. To be safe you really should always save configuration files in the application settings directory:

Path.AppData & "inifile.ini"
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Sat Feb 14, 2009 1:24 am

Yeah! It's working now, Thank for your & HELP & :lol:
B
4
S
1
G
4
Posts: 20
Reputation: 1,292


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest