AutoHotkey Community

It is currently May 27th, 2012, 12:26 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: December 7th, 2009, 1:20 pm 
Offline

Joined: November 9th, 2009, 3:09 pm
Posts: 258
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 7th, 2009, 1:30 pm 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
Didn't you already post this script and question? Please don't double post

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 7th, 2009, 1:39 pm 
Offline

Joined: November 9th, 2009, 3:09 pm
Posts: 258
well i was confused as i was not online for last 4 days and i am sorry for that


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 7th, 2009, 4:55 pm 
Offline

Joined: March 23rd, 2005, 7:53 am
Posts: 321
Location: Germany
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 7th, 2009, 5:29 pm 
Offline

Joined: November 9th, 2009, 3:09 pm
Posts: 258
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 10th, 2009, 9:44 am 
Offline

Joined: November 9th, 2009, 3:09 pm
Posts: 258
no solution???


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 10th, 2009, 11:36 am 
Offline

Joined: August 13th, 2006, 6:45 am
Posts: 355
Location: Germany
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 10th, 2009, 11:42 am 
Offline

Joined: November 9th, 2009, 3:09 pm
Posts: 258
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 10th, 2009, 12:36 pm 
Offline

Joined: August 13th, 2006, 6:45 am
Posts: 355
Location: Germany
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 10th, 2009, 12:41 pm 
Offline

Joined: November 9th, 2009, 3:09 pm
Posts: 258
ok thanks i will check out


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Google Feedfetcher, iDrug, Leef_me, rjgatito, Yahoo [Bot] and 22 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