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 

whats wrong in the script..if condition not working

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



Joined: 09 Nov 2009
Posts: 258

PostPosted: Mon Dec 07, 2009 12:20 pm    Post subject: whats wrong in the script..if condition not working Reply with quote

hi members...below is my code and i am encountering a problem at if statement plz have a look at it:-
Code:


Gui, Add, Tab, x-4 y0 w630 h480 ,Multitest
Gui, Add, Edit, x106 y60 w190 h20 vMMyEdit
Gui, Add, Text, x6 y30 w90 h25 , Multi Production Test
Gui, Add, Radio, x6 y60 w100 h20 vMProduction, Production Test
Gui, Add, Button, x306 y60 w80 h20 gUpload, Upload
Gui, Add, Button,gMultiStart x6 y290 w100 h40, &MultiStart
Gui, Add, Text, x6 y110 w120 h20 , CASCON TESTING
Gui, Add, Radio, x6 y130 w90 h30 vMLicensed , Licensed Software
Gui, Add, Radio, x6 y160 w90 h30 vMUnlicensed, Unlicensed Software
Gui, Add, Text, x166 y110 w120 h20 , CASCON File Report
Gui, Add, Radio, x166 y130 w90 h30 vMGoodFile, Goodfile
Gui, Add, Radio, x166 y160 w90 h30 vMBadFile, Badfile
Gui, Add, Text, x336 y110 w130 h20 , Enter Folder Name
Gui, Add, Button, gEnter x345 y125 w70 h30 , Enter
Gui, Show, x224 y172 h364 w631, Automatic Release Test
Return

if((MProduction&&MLicensed)=1)
{
Iniread,OutputVar,C:\Documents and Settings\jakhangu\Desktop\GUIcombine\1.ini,Production,%a%
GuiControl,, MyEdit, %OutputVar%
Run C:\ETAS\ETKControlPanel6.4\ETKControlPanel.exe -f=%OutputVar%
WinWaitActive ETK Control Panel 
send 1
send {tab}
send {1}
send {tab}
send !{M}
sleep 2000
Msgbox,,,Process finished,3
sleep 500
send !{f4}
WinActivate Automatic Release Test
sleep 1000
send !{M}

}

if((MProduction&&MLicensed&&MGoodFile)=1) ; when i check these three buttons on the gui it does not shows the below message but instead of it runs the condition of the above if statement "if((MProduction&&MLicensed)=1)"...can u help me in executing this if statement plz???
{
 msgbox Wrong selection
}

Return

GuiClose:
ExitApp

F1::ExitApp
Back to top
View user's profile Send private message
SoLong&Thx4AllTheFish



Joined: 27 May 2007
Posts: 4999

PostPosted: Mon Dec 07, 2009 12:30 pm    Post subject: Reply with quote

Didn't you already post this script and question? Please don't double post
_________________
AHK Wiki FAQ
TF : Text files & strings lib, TF Forum
Back to top
View user's profile Send private message
Jasdeep



Joined: 09 Nov 2009
Posts: 258

PostPosted: Mon Dec 07, 2009 12:39 pm    Post subject: Reply with quote

well i was confused as i was not online for last 4 days and i am sorry for that
Back to top
View user's profile Send private message
Hasso



Joined: 23 Mar 2005
Posts: 321
Location: Germany

PostPosted: Mon Dec 07, 2009 3:55 pm    Post subject: Reply with quote

Quote:
if((MProduction&&MLicensed&&MGoodFile)=1) ; when i check these three buttons on the gui it does not shows the below message but instead of it runs the condition of the above if statement "if((MProduction&&MLicensed)=1)"...can u help me in executing this if statement plz???
{
msgbox Wrong selection
}
That it executes the first if is clear as the condition (MProduction&&MLicensed)=1 is true. Why it doesn't execute the second if I don't see right now.
_________________
Hasso

Programmers don't die, they GOSUB without RETURN
Back to top
View user's profile Send private message
Jasdeep



Joined: 09 Nov 2009
Posts: 258

PostPosted: Mon Dec 07, 2009 4:29 pm    Post subject: Reply with quote

well i am also confused about that but when i changed the position of if statement it started to work i mean

if((MProduction&&MLicensed&&MGoodFile)=1) above the
if((MProduction&&MLicensed)=1)

but i think its not the right way of doing something is missing have to figure out...anyways thanks a lot for replying
Back to top
View user's profile Send private message
Jasdeep



Joined: 09 Nov 2009
Posts: 258

PostPosted: Thu Dec 10, 2009 8:44 am    Post subject: Reply with quote

no solution???
Back to top
View user's profile Send private message
hd0202



Joined: 13 Aug 2006
Posts: 265
Location: Germany

PostPosted: Thu Dec 10, 2009 10:36 am    Post subject: Reply with quote

Jasdeep wrote:
no solution???

ever read of Msgbox? Put a
Code:
msgbox, % mgoodfile
before your if statement. What does it show?

As your code given above is only parts of your script (a testrun immediatly points to missing labels) check your code for changes of the variable mgoodfile in your code, outside of the GUI.

Hubert
Back to top
View user's profile Send private message
Jasdeep



Joined: 09 Nov 2009
Posts: 258

PostPosted: Thu Dec 10, 2009 10:42 am    Post subject: Reply with quote

thanks below is my code please have a look
Code:

MultiStart:
Gui,submit
Gui,minimize

a++
b++

if((MProduction&&MUnlicensed&&MGoodFile&&MEnglish)=1)
{
Iniread,OutputVar,%A_ScriptDir%\1.ini,Production,%a%
GuiControl,, MyEdit, %OutputVar%
Run C:\ETAS\ETKControlPanel6.4\ETKControlPanel.exe -f=%OutputVar%
Iniread,OutputVar1,%A_ScriptDir%\1.ini,Folder,%b%
Iniread,Output1,%A_ScriptDir%\Operating System.ini,Operating1,English
FileCopy,D:\Result_1.CAP,%Output1%CAS4WIN\UUTs\%OutputVar1%\Results\
WinWaitActive ETK Control Panel 
send 1
send {tab}
send {1}
send {tab}
send !{M}
sleep 2000
Msgbox,,,Process finished,3
sleep 500
send !{f4}
WinActivate Automatic Release Test
sleep 1000
send !{M}

}


if((MProduction&&MUnlicensed&&MBadFile&&MEnglish)=1)
{
Iniread,OutputVar,%A_ScriptDir%\1.ini,Production,%a%
GuiControl,, MyEdit, %OutputVar%
Run C:\ETAS\ETKControlPanel6.4\ETKControlPanel.exe -f=%OutputVar%
Iniread,OutputVar1,%A_ScriptDir%\1.ini,Folder,%b%
Iniread,Output1,%A_ScriptDir%\Operating System.ini,Operating1,English
FileCopy,C:\Documents and Settings\jakhangu\Desktop\Result_1.CAP,%Output1%CAS4WIN\UUTs\%OutputVar1%\Results\
WinWaitActive ETK Control Panel 
send 1
send {tab}
send {1}
send {tab}
send !{M}
sleep 2000
Msgbox,,,Process finished,3
sleep 500
send !{f4}
WinActivate Automatic Release Test
sleep 1000
send !{M}

}

if((MProduction&&MUnlicensed&&MGoodFile&&MGerman)=1)
{
Iniread,OutputVar,%A_ScriptDir%\1.ini,Production,%a%
GuiControl,, MyEdit, %OutputVar%
Run C:\ETAS\ETKControlPanel6.4\ETKControlPanel.exe -f=%OutputVar%
Iniread,OutputVar1,%A_ScriptDir%\1.ini,Folder,%b%
Iniread,Output2,%A_ScriptDir%\Operating System.ini,Operating2,German
FileCopy,D:\Result_1.CAP,%Output1%CAS4WIN\UUTs\%OutputVar1%\Results\
WinWaitActive ETK Control Panel 
send 1
send {tab}
send {1}
send {tab}
send !{M}
sleep 2000
Msgbox,,,Process finished,3
sleep 500
send !{f4}
WinActivate Automatic Release Test
sleep 1000
send !{M}

}


if((MProduction&&MUnlicensed&&MBadFile&&MGerman)=1)
{
Iniread,OutputVar,%A_ScriptDir%\1.ini,Production,%a%
GuiControl,, MyEdit, %OutputVar%
Run C:\ETAS\ETKControlPanel6.4\ETKControlPanel.exe -f=%OutputVar%
Iniread,OutputVar1,%A_ScriptDir%\1.ini,Folder,%b%
Iniread,Output2,%A_ScriptDir%\Operating System.ini,Operating2,German
FileCopy,C:\Documents and Settings\jakhangu\Desktop\Result_1.CAP,%Output1%CAS4WIN\UUTs\%OutputVar1%\Results\
WinWaitActive ETK Control Panel 
send 1
send {tab}
send {1}
send {tab}
send !{M}
sleep 2000
Msgbox,,,Process finished,3
sleep 500
send !{f4}
WinActivate Automatic Release Test
sleep 1000
send !{M}

}

if((MProduction=1)&&(MLicensed=1)&&(MGoodFile=1)) ; here its shows because as i said that if i add this statement before "if((MProduction&&MLicensed)=1)" it works but if i put after it then for the above selection it executes the command of "if((MProduction&&MLicensed)=1)"
{
 msgbox Wrong selection
 Return
}

if((MProduction&&MLicensed&&MBadFile)=1)
{
 msgbox Wrong selection
 Return
}

if((MProduction&&MLicensed)=1)
{
Iniread,OutputVar,%A_ScriptDir%\1.ini,Production,%a%
GuiControl,, MyEdit, %OutputVar%
Run C:\ETAS\ETKControlPanel6.4\ETKControlPanel.exe -f=%OutputVar%
WinWaitActive ETK Control Panel 
send 1
send {tab}
send {1}
send {tab}
send !{M}
sleep 2000
Msgbox,,,Process finished,3
sleep 500
send !{f4}
WinActivate Automatic Release Test
sleep 1000
send !{M}

}
Return
Back to top
View user's profile Send private message
hd0202



Joined: 13 Aug 2006
Posts: 265
Location: Germany

PostPosted: Thu Dec 10, 2009 11:36 am    Post subject: Reply with quote

are you sure your window "ETK Control Panel" is activated?
Is your msgbox with the text "Process finished" shown?

I only find the WinWaitActive as possible reason in your still incomplete code, but please don't show it again.

If you put your "special IF" in front of the multistart-routine, it is independent from the following code and therefore executed with the values from the gui.

Hubert
Back to top
View user's profile Send private message
Jasdeep



Joined: 09 Nov 2009
Posts: 258

PostPosted: Thu Dec 10, 2009 11:41 am    Post subject: Reply with quote

ok thanks i will check out
Back to top
View user's profile Send private message
Display posts from previous:   
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