tamir Posted January 10, 2005 Share Posted January 10, 2005 i have a script that writes into ini file and (which doesn't exists yet). sometimes, especially when i use the compiled .exe file, it doesn't creates the ini file. moreover, i made the script checking if the ini file exists and if it is missing give an error message, but even when it fails, there is no error message. why is it happening? is it better to create the file and only then use IniWrite? Link to comment Share on other sites More sharing options...
SlimShady Posted January 10, 2005 Share Posted January 10, 2005 An example of how to use the INI functions. Dim $IniFile $IniFile = StringTrimRight(@ScriptFullPath, 3) & "ini" $value = INIRead($IniFile, "Settings", "WordWrap", "No INIFile");<-- if the INI file doesn't exist, $value will equal the last parameter. If $value = "No INIFile" Then INIWrite($IniFile, "Settings", "WordWrap", "Off") Else ;INIFile exists, do whatever you want. EndIf Link to comment Share on other sites More sharing options...
SvenP Posted January 10, 2005 Share Posted January 10, 2005 i have a script that writes into ini file and (which doesn't exists yet).sometimes, especially when i use the compiled .exe file, it doesn't creates the ini file. moreover, i made the script checking if the ini file exists and if it is missing give an error message, but even when it fails, there is no error message.why is it happening? is it better to create the file and only then use IniWrite?<{POST_SNAPBACK}>Hello Tamir,Could you give a code snippet with your IniWrite lines?I could think of a filepath problem. If you want the INI file to be created in the same directory as your compiled script, you could add the @SCRIPTDIR macro in front of the filename.Regards,-Sven Link to comment Share on other sites More sharing options...
tamir Posted January 10, 2005 Author Share Posted January 10, 2005 well, in the end it was a path problem, coz i tried @ScriptDir & "\file.ini" instead of "file.ini" and it worked. i'm just not usual that if i write "file.ini" it isn't in the same dir as the script, coz in php it is... thanks for all. 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