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
6
S
1
G
4
Posts: 21
Reputation: 1,344

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
113
S
41
G
20
Posts: 1,586
Reputation: 19,126

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
403
S
238
G
89
Posts: 24,654
Reputation: 196,145

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
6
S
1
G
4
Posts: 21
Reputation: 1,344


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests