I'm making a script and it relies on whether a checkbox in a GUI window has been checked or not. The only problem is, although the variable should be 1 for checked or 0 for unchecked it is just blank! Please help!
Code:
Monthdue = 20
IniRead, Earn, Test.ini, Earn, earn
IniRead, Jancheck, Test.ini, Jancheck, check
IniRead, Febcheck, Test.ini, Febcheck, check
IniRead, Marcheck, Test.ini, Marcheck, check
IniRead, Aprcheck, Test.ini, Aprcheck, check
IniRead, Maycheck, Test.ini, Maycheck, check
IniRead, Juncheck, Test.ini, Juncheck, check
IniRead, Julcheck, Test.ini, Julcheck, check
IniRead, Augcheck, Test.ini, Augcheck, check
IniRead, Sepcheck, Test.ini, Sepcheck, check
IniRead, Octcheck, Test.ini, Octcheck, check
IniRead, Novcheck, Test.ini, Novcheck, check
IniRead, Deccheck, Test.ini, Deccheck, check
If Jancheck = N
{
Jantick =
}
If Jancheck = Y
{
Jantick = Checked
}
If Febcheck = N
{
Febtick =
}
If Febcheck = Y
{
Febtick = Checked
}
If Marcheck = N
{
Martick =
}
If Marcheck = Y
{
Martick = Checked
}
If Aprcheck = N
{
Aprtick =
}
If Aprcheck = Y
{
Aprtick = Checked
}
If Maycheck = N
{
Maytick =
}
If Maycheck = Y
{
Maytick = Checked
}
If Juncheck = N
{
Juntick =
}
If Juncheck = Y
{
Juntick = Checked
}
If Julcheck = N
{
Jultick =
}
If Julcheck = Y
{
Jultick = Checked
}
If Augcheck = N
{
Augtick =
}
If Augcheck = Y
{
Augtick = Checked
}
If Sepcheck = N
{
Septick =
}
If Sepcheck = Y
{
Septick = Checked
}
If Octcheck = N
{
Octtick =
}
If Octcheck = Y
{
Octtick = Checked
}
If Novcheck = N
{
Novtick =
}
If Novcheck = Y
{
Novtick = Checked
}
If Deccheck = N
{
Dectick =
}
If Deccheck = Y
{
Dectick = Checked
}
Gui, Add, Text, x5 y5, Months:
Gui, Add, Text, x5 y+10, January
Gui, Add, Text, x5 y+2, Febuary
Gui, Add, Text, x5 y+2, March
Gui, Add, Text, x5 y+2, April
Gui, Add, Text, x5 y+2, May
Gui, Add, Text, x5 y+2, June
Gui, Add, Text, x5 y+2, July
Gui, Add, Text, x5 y+2, August
Gui, Add, Text, x5 y+2, September
Gui, Add, Text, x5 y+2, October
Gui, Add, Text, x5 y+2, November
Gui, Add, Text, x5 y+2, December
Gui, Add, Text, x85 y5, Amount Due:
Gui, Add, Text, x85 y+10, £%Earn%
Gui, Add, Text, x85 y+2, £%Earn%
Gui, Add, Text, x85 y+2, £%Earn%
Gui, Add, Text, x85 y+2, £%Earn%
Gui, Add, Text, x85 y+2, £%Earn%
Gui, Add, Text, x85 y+2, £%Earn%
Gui, Add, Text, x85 y+2, £%Earn%
Gui, Add, Text, x85 y+2, £%Earn%
Gui, Add, Text, x85 y+2, £%Earn%
Gui, Add, Text, x85 y+2, £%Earn%
Gui, Add, Text, x85 y+2, £%Earn%
Gui, Add, Text, x85 y+2, £%Earn%
Gui, Add, Text, x165 y5, Recieved:
Gui, Add, Checkbox, x165 y+10 %Jantick% vJanBox,
Gui, Add, Checkbox, x165 y+2 %Febtick% vFebBox,
Gui, Add, Checkbox, x165 y+2 %Martick% vMarBox,
Gui, Add, Checkbox, x165 y+2 %Aprtick% vAprBox,
Gui, Add, Checkbox, x165 y+2 %Maytick% vMayBox,
Gui, Add, Checkbox, x165 y+2 %Juntick% vJunBox,
Gui, Add, Checkbox, x165 y+2 %Jultick% vJulBox,
Gui, Add, Checkbox, x165 y+2 %Augtick% vAugBox,
Gui, Add, Checkbox, x165 y+2 %Septick% vSepBox,
Gui, Add, Checkbox, x165 y+2 %Octtick% vOctBox,
Gui, Add, Checkbox, x165 y+2 %Novtick% vNovBox,
Gui, Add, Checkbox, x165 y+2 %Dectick% vDecBox,
Gui, Add, Button, x5 y+2 w200 h20 Default, Update
Gui, Show,, Title For GUI,
Return,
ButtonUpdate:
If JanBox = 1
{
MsgBox, Ticked
}
If Jancheck = 0
{
MsgBox, Not Ticked
}
Return,
Note, this script relies on an INI file. That part of it is working perfectly (I think). If you want the INI file its source is:
Code:
****************************************************************
* EARN CHECK *
****************************************************************
[Earn]
Earn=20
****************************************************************
* MONTH / WEEK CHECK *
****************************************************************
[Monthorweek]
Check=Mon
****************************************************************
* CHECK BOX CHECK *
****************************************************************
[Jancheck]
Check=Y
[Febcheck]
Check=Y
[Marcheck]
Check=Y
[Aprcheck]
Check=N
[Maycheck]
Check=N
[Juncheck]
Check=N
[Julcheck]
Check=N
[Augcheck]
Check=N
[Sepcheck]
Check=N
[Octcheck]
Check=N
[Novcheck]
Check=N
[Deccheck]
Check=N
This should be placed in the same directory as the script.
Thanks in advance!
Robbo