 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
etopsirhc
Joined: 12 Mar 2008 Posts: 32 Location: OR
|
Posted: Wed Sep 10, 2008 8:28 am Post subject: INI question |
|
|
ok idk whats wrong here so plz help
ahk script
| Code: | Gui, Add, Button, x6 y10 w100 h30 gOne, 1
Gui, Add, Button, x116 y10 w100 h30 gTwo, 2
Gui, Show
Return
FILES:
gui,submit,nohide
FileSelectFile, FILE , C:, , testing,shortcuts (*.lnk)
if FILE =
{
return
}
else if SHCT == 2
{
IniWrite,FILE,desk,Files,two
msgbox,file writen i hope
}
return
Two:
IniRead, TWO, desk, Files, two
run,%TWO%
return
One:
SHCT == 2
gosub,FILES
return |
ini set up (some parts to be used later)
| Code: | [FirstRun]
run=0
[Files]
two=
three=
four=
five=
six=
seven=
eight=
[HotKeys]
shutdown=
edit=
|
|
|
| Back to top |
|
 |
etopsirhc
Joined: 12 Mar 2008 Posts: 32 Location: OR
|
Posted: Wed Sep 10, 2008 9:04 am Post subject: |
|
|
i should try fixing stuff more b4 i ask 4 help here
| Code: | Gui, Add, Button, x6 y10 w100 h30 gOne, 1
Gui, Add, Button, x116 y10 w100 h30 gTwo, 2
Gui, Show
Return
FILES:
gui,submit,nohide
FileSelectFile, FILE , C:, , testing,shortcuts (*.lnk)
if FILE =
{
return
}
else if SHCT == 2
{
IniWrite,%FILE%,%A_ScriptDir%\desk.ini,Files,two
msgbox,file writen i hope
}
return
Two:
IniRead, TWO, %A_ScriptDir%\desk.ini, Files, two
run,%TWO%
return
One:
SHCT == 2
gosub,FILES
return |
|
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6264
|
Posted: Wed Sep 10, 2008 9:07 am Post subject: |
|
|
| Code: | SetWorkingDir, %A_ScriptDir%
Gui, Add, Button, x6 y10 w100 h30 gOne, 1
Gui, Add, Button, x116 y10 w100 h30 gTwo, 2
Gui, Show
Return
FILES:
Gui, Submit, NoHide
FileSelectFile, FILE , C:, , testing,shortcuts (*.lnk)
If ( FILE="" Or ErrorLevel )
Return
If ( SHCT=2 )
{
IniWrite, %FILE% ,desk.ini,Files,two
msgbox,file writen i hope
}
Return
Two:
IniRead, TWO, desk.ini, Files, two
Run,%TWO%
Return
One:
SHCT=2
GoSub,FILES
Return |
 _________________

Last edited by SKAN on Wed Sep 10, 2008 9:10 am; edited 1 time in total |
|
| Back to top |
|
 |
ghostman Guest
|
Posted: Wed Sep 10, 2008 9:10 am Post subject: Re: INI question |
|
|
| etopsirhc wrote: | ok idk whats wrong here so plz help
ahk script
| Code: | Gui, Add, Button, x6 y10 w100 h30 gOne, 1
Gui, Add, Button, x116 y10 w100 h30 gTwo, 2
Gui, Show
Return
FILES:
gui,submit,nohide
FileSelectFile, FILE , C:, , testing,shortcuts (*.lnk) ; <--- , in wrong place for empty options
if FILE =
{
return
}
else if SHCT == 2 ; <--- should be =
{
IniWrite,FILE,desk,Files,two
msgbox,file writen i hope
}
return
Two:
IniRead, TWO, desk, Files, two
run,%TWO%
return
One:
SHCT == 2 ; <--- should be =
gosub,FILES
return |
|
I see three problems with the code. After making these changes (see above added comments), it seems to work.
| Code: | Gui, Add, Button, x6 y10 w100 h30 gOne, 1
Gui, Add, Button, x116 y10 w100 h30 gTwo, 2
Gui, Show
Return
FILES:
gui,submit,nohide
; FileSelectFile, OutputVar [, Options, RootDir\Filename, Prompt, Filter]
FileSelectFile, FILE ,, C:, testing,shortcuts (*.lnk)
if FILE =
{
return
}
else if SHCT = 2
{
; IniWrite, Value, Filename, Section, Key
IniWrite,%FILE%,desk,Files,two
msgbox,file writen i hope
}
return
Two:
; IniRead, OutputVar, Filename, Section, Key [, Default]
IniRead, TWO, desk, Files, two
run,%TWO%
return
One:
SHCT = 2
gosub,FILES
return |
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|