Tentaal Posted April 9, 2007 Posted April 9, 2007 Hello, $default_ctp="False" $ctp_default_path=@ProgramFilesDir & "\Activision\Civilization-Call to Power" If FileExists($ctp_default_path & "\playctp.exe") Then $default_ctp="True" I have a problem with the FileExists() funtion. What matters that the file playctp.exe exists, $default_ctp come always "True". What's wrong in my code??? Thanks in advance!
xcal Posted April 9, 2007 Posted April 9, 2007 (edited) I'm guessing you're somewhere later doing If $default_ctp Then etc etc. Your $default_ctp will always be true as a string. Remove the quotes. edit - Just to be clear, I mean to remove the quotes from True and False. Edited April 9, 2007 by xcal How To Ask Questions The Smart Way
therks Posted April 9, 2007 Posted April 9, 2007 (edited) You could actually change that whole chunk of code, to this:$ctp_default_path=@ProgramFilesDir & "\Activision\Civilization-Call to Power" $default_ctp=FileExists($ctp_default_path & "\playctp.exe")Since FileExists returns True or False.*Edit: Actually it returns 1 or 0, but that's almost as good.... It probably should return True/False though... Edited April 9, 2007 by Saunders My AutoIt Stuff | My Github
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