Jump to content


Variable changes regardless that it has been set


  • Please log in to reply
4 replies to this topic

#1 Guests

  • Guests

Posted 19 April 2004 - 01:53 PM

I've created a script which takes some login details from an INI (user, pw).

To run that script (from a path like this C:\FB\_FBPROCESS) I've created a shortcut on the desktop.

With the upgrade to 1.0.08 something has changed.

The INI file can't be found/read if the script has been started via the desktop shortcut. Based on that, the vars which should hold the login details are empty and have been set by AutoHotkey with its root path.

If the script is started directly everything is fine. :? :?:

#2 Beastmaster

Beastmaster
  • Members
  • 191 posts

Posted 19 April 2004 - 02:10 PM

Holy Moly - the above post was mine :oops: Beastmaster :oops:

#3 Chris

Chris
  • Administrators
  • 10727 posts

Posted 19 April 2004 - 02:17 PM

I can't think of anything that has changed that would explain this.

Check the properties of the shortcut, especially the "Start In" (working directory) field. Make sure it is set to be the directory where your INI file resides.

If you discover the exact nature of the change that happened in 1.0.08 vs. the other version, please post it here and I'll try to address it.

Also, the built-in variables %A_ScriptDir% and %A_WorkingDir% may be of use in this case.

#4 Beastmaster

Beastmaster
  • Members
  • 191 posts

Posted 19 April 2004 - 02:56 PM

Have checked the shortcut(s). Both were/are set the way you've advised --> Start in [ C:\FB\_FBPROCESS ].

FB.ahk
IniRead, PW, FB.INI, Frontend, PW
IniRead, USER, FB.INI, Frontend, USER
.
.
.

FB.INI
[Frontend]
USER = myusername
PW = mypassword

The format of the INI (tab/tab/key/tab/equal/tab/keyval) hasn't changed.

#5 Chris

Chris
  • Administrators
  • 10727 posts

Posted 19 April 2004 - 07:21 PM

I used the following steps to try to reproduce this bug:

1) Installed using the latest Installer.
2) Created the .ahk file and .ini file the way you described.
3) Created a shortcut on the desktop via copy & paste.
4) Ran the shortcut from the desktop.

The values .ini files are correctly read (as shown by "msgbox, pw=%pw%`nuser=%user%").

Perhaps you adding the following line to your script to find out what the working directory is:
MsgBox, %A_WorkingDir%

The working directory should be the same as the shortcut's "Start In" field. If it isn't, perhaps we can investigate further.