AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

INI question

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
etopsirhc



Joined: 12 Mar 2008
Posts: 32
Location: OR

PostPosted: Wed Sep 10, 2008 8:28 am    Post subject: INI question Reply with quote

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
View user's profile Send private message Visit poster's website
etopsirhc



Joined: 12 Mar 2008
Posts: 32
Location: OR

PostPosted: Wed Sep 10, 2008 9:04 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 6264

PostPosted: Wed Sep 10, 2008 9:07 am    Post subject: Reply with quote

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


Smile
_________________


Last edited by SKAN on Wed Sep 10, 2008 9:10 am; edited 1 time in total
Back to top
View user's profile Send private message
ghostman
Guest





PostPosted: Wed Sep 10, 2008 9:10 am    Post subject: Re: INI question Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group