 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
AHK newbie Guest
|
Posted: Mon Mar 15, 2010 2:54 am Post subject: reading INI in the same working directory |
|
|
Hi.. I am a newbie in AHK..
I was trying to design a program, this program will read all the directory from INI file..
But to start of, I first need to locate the setup ini file. In order to do this, I got to hard code the setup ini file into the code.
Is there a way for me to do it?
Like for example, i managed to read a script from the same working directory for AHK script using
| Code: | | %A_script%/test.ahk |
but when I try to apply this to ini file
| Code: | setup:=%A_script%/setup.ini
IniRead,dir,%setup%,test section,key |
It seems like setup:=%A_script%/setup.ini does not work for INI file.. it shows me "setup.ini" contains illegal character.
Is there a way for me read the setup.ini in the same working directory? |
|
| Back to top |
|
 |
answer4u Guest
|
Posted: Mon Mar 15, 2010 3:05 am Post subject: |
|
|
Have you tried the Built-in Variables? Also, this following is incorrect syntax:
| Code: | | setup:=%A_script%/setup.ini | You prolly meant: | Code: | setup = %A_ScriptDir%/setup.ini
; -OR-
setup := A_ScriptDir "/setup.ini" |
|
|
| Back to top |
|
 |
Tuncay
Joined: 07 Nov 2006 Posts: 1886 Location: Germany
|
Posted: Mon Mar 15, 2010 3:20 am Post subject: |
|
|
just to mention, windows uses backslash for pathes (this is "\"). Normal slashes are accepted mostly, but sometimes not. _________________ {1:"ahkstdlib", 2:"my libs", 3:"my apps", 4:"my license"}
--> Don't feed the troll! <-- |
|
| Back to top |
|
 |
Guest
|
Posted: Mon Mar 15, 2010 3:31 am Post subject: |
|
|
Making up your own AHK variables? Using *nix slashes? Man, get a grip on reality.
Where do you find A_Script?? Look at the help file! A_ScriptDir
| Code: | setup = %A_ScriptDir%\setup.ini
IniRead, dir, %setup%, test section, mykey
msgbox, %dir%
|
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|