AutoHotkey Community

It is currently May 27th, 2012, 5:38 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: March 15th, 2010, 3:54 am 
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?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 15th, 2010, 4:05 am 
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"


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 15th, 2010, 4:20 am 
Offline

Joined: November 7th, 2006, 9:47 pm
Posts: 1934
Location: Germany
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! <--


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 15th, 2010, 4:31 am 
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%


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], HotkeyStick, mrhobbeys and 60 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group