AutoHotkey Community

It is currently May 26th, 2012, 4:22 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: March 25th, 2009, 12:01 am 
Offline

Joined: July 27th, 2008, 7:31 am
Posts: 47
Location: England
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

_________________
All scripts are untested unless otherwise mentioned.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 25th, 2009, 12:30 am 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5479
Location: the tunnel(?=light)
This perhaps?

Code:
ButtonUpdate:

Gui, Submit, NoHide

If JanBox = 1
{
MsgBox, Ticked
}
If Jancheck = 0
{
MsgBox, Not Ticked
}

Return,

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 25th, 2009, 12:34 am 
Offline

Joined: July 27th, 2008, 7:31 am
Posts: 47
Location: England
God I must be slow tonight :roll: ! Of course! (I'm not usually that stupid.)

Thanks!

_________________
All scripts are untested unless otherwise mentioned.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Cerberus, poserpro, SKAN, tterB and 14 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group