ea9000 Posted August 2, 2010 Share Posted August 2, 2010 (edited) Hi All, I am trying to create a directories by reading an ini file ,but its not interpreted properly. thax in advance for any replay. EA #include <Array.au3> #include <file.au3> #include <Date.au3> $Plantcode = IniRead("Config.ini", "Environment_Variables", "Plantcode", "NotFound") $env_code = IniRead("Config.ini", "Environment_Variables", "env_code", "NotFound") $AproAppDrv = IniRead("Config.ini", "Environment_Variables", "AproAppDrv", "NotFound") $AproDBDrv = IniRead("Config.ini", "Environment_Variables", "AproDBDrv", "NotFound") $TEST_DIR = IniRead("Config.ini", "TEST_DIR", "TEST_DIR", "NotFound") ;DirCreate($TEST_DIR) MsgBox(0,"demo _PathMake",$TEST_DIR) config.ini [Environment_Variables] Plantcode=0111 env_code=TEST2 AproAppDrv=D: [TEST_DIR] TEST_DIR=$AproAppDrv\$env_code\$Plantcode Edited August 2, 2010 by ea9000 Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 2, 2010 Share Posted August 2, 2010 Hi and Welcome to the forums! IniRead returns a string, if you want it "interpreted" you have to do so yourself, like: $TEST_DIR = Execute(IniRead("Config.ini", "TEST_DIR", "TEST_DIR", "NotFound")) And this needs fixing, that is not valid AutoIt syntax: TEST_DIR=$AproAppDrv\$env_code\$Plantcode End result would be: $Plantcode = IniRead("Config.ini", "Environment_Variables", "Plantcode", "NotFound") $env_code = IniRead("Config.ini", "Environment_Variables", "env_code", "NotFound") $AproAppDrv = IniRead("Config.ini", "Environment_Variables", "AproAppDrv", "NotFound") $TEST_DIR = Execute(IniRead("Config.ini", "TEST_DIR", "TEST_DIR", "NotFound")) MsgBox(0,"demo _PathMake",$TEST_DIR) And: [Environment_Variables] Plantcode=0111 env_code=TEST2 AproAppDrv=D: [TEST_DIR] TEST_DIR=$AproAppDrv & "\" & $env_code & "\" & $Plantcode Easy, isn't it? Don't hesitate to ask if you got any further questions. This is a very active forum and someone should find you eventually. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Bert Posted August 2, 2010 Share Posted August 2, 2010 Look here: http://www.autoitscript.com/forum/index.php?showtopic=39412&hl=menu++iniread++text The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
ea9000 Posted August 2, 2010 Author Share Posted August 2, 2010 thanx a lot for the quick replay ,as you said ,it is an active forum Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now