Then the "homef" label saves the var into the ini file I am using. My problem is that the filepath which I try to save into the filef1 variable cannot be saved because as my programm jumps to the homef part the variable is resettet to the value which was already in the ini saved. I testet it when I deleted the first line of code. Then the Scipt just saved nothing into the ini. Why is this happening? Am i being stupid? xD
Code: Select all
; Read the var when the programm starts to show it in the gui
IniRead, filef1, Settings.ini, Fshortcut, filef1
kontroll:
if(filef1 = "ERROR" or filef1 = "")
filef1 = NONE
Gui,kontroll: new
;Gui, -MaximizeBox -MinimizeBox
IniRead, filef1, Settings.ini, Fshortcut, filef1
Gui,kontroll: font, s25 cwhite
Gui,kontroll: Add, Text , x50 y270 +BackgroundTrans, F1
Gui,kontroll: font, s12 cblack
Gui,kontroll: Add, Button, gf1a x100 y270 w100 h40, &Load
Gui,kontroll: font, s10
Gui,kontroll: Add, Edit, x210 y270 w400 h40 vfilef1, %filef1%
Gui,kontroll: Add, Picture, x600 y620 +BackgroundTrans ghomef, HomeB.png ; this button saves the Url part..
Return
homef:
;gui, submit, NoHide
gui, submit
MsgBox,,,%filef1%
IniWrite, %filef1%, Settings.ini, Fshortcut, filef1
IniRead, filef1, Settings.ini, Fshortcut, filef1
gosub, kontroll
return
f1a:
FileSelectFile ,filef1,x190 y270 w250 h40,, Select an image:, Images (*.exe; *.de; *.com; *.net; *.org; *.io; *.bat; *.png; *.*)
if filef1 =
{
gosub, Einstellungen
MsgBox, The user didn't select anything.
return
}
else
{
MsgBox,,,"gosub homef before"
MsgBox,,,%filef1%
gosub, homef
MsgBox,,,%filef1%
MsgBox,,,"gosub homef after"
Return
}
+F1::Run "%filef1%"