10-09-2008 10:09 PM
when I add a message popup in my sequence,I need two button: Ok(button1) and Cancel(Button2).and set timeout.
My question is like this; I need get the status when execute,if uesr click ok,the sequence should go to next step,the other stauts,the sequence should abort executing.
example:
Message Popup
if(RunState.Sequence.Main["Message Popup"].Button1Label=="OK")
call sequence //this action need execute when click "OK"
else
break //this is a action ,without any connection of message popup
end
but no matter what button I click ,the sequence always execute break,that's means the if condition can't get the status of message,where is my error.
any one help me ,thanks very much
10-10-2008 12:51 AM
Hi,
You need to use
if(RunState.Sequence.Main["Message Popup"].Result.ButtonHit == 1)
call sequence
else
break
end
RunState.Sequence.Main["Message Popup"].Button1Label will always equal OK but the string is actually ""OK"" which is why you are seeing it as false.
hope this helps
Regards
Ray Farmer
01-22-2009 03:52 AM
Hi Ray,
I have a need to get the label of the button pressed. (in this example to read "OK" or "Cancel".
How do you do that?
Thanks
Rafi
01-22-2009 08:20 AM
Hi,
If you are getting the value in the pre or post expression of the MessagePopup step then use (as an example):
Locals.Buton1LabelString = Step.Button1Label.GetValString("",0) this will return ""OK""
likewise for Button2.
If you are getting the value outside of the step eg in a step before the MessagePopup step then try
Locals.Buton1LabelString = NextStep.Button1Label.GetValString("",0) this will return ""OK""
Hope this helps
Ray
01-23-2009 02:36 AM
Hi Ray and thanks,
My meaning was to obtain the label of the key which was pressed by the user, not the lable of button 1 or 2.
Thanks
Rafi
01-23-2009 02:57 AM
Hi Rafi,
I thought I must have not fully understood your question.
But I must still confess I still dont understand. which key would this be, the one on the keyboard?
Regards
Ray
01-25-2009 04:08 AM
Hi Ray,
You have a pop up messag with 3 buttons to select. I would like to know the string content of the label which was selected by the user.
for example
button 1 - "Ver A.01"
button 2 - "Ver A.05"
button 3 - "Ver C.80"
If the user pressed button no.3, then I would like to get the string "Ver C.80".
I know how to work around it by using the key no. Pressed, but I prefer to get the string directly, if possible.
Thanks
Rafi
01-26-2009 02:14 AM
Hi Rafi,
Is this what you are looking for.
Regards
Ray
01-26-2009 02:51 AM
Hi Ray,
YES EXACTLY.
Thank you so much.
I was not familiar with the function 'evaluate'. Thanks for introducing it to me.
Best Regards
Rafi
01-28-2009 02:48 AM
Hi Ray,
The result of the step is ""Rel 01"" and not "Rel 01".
Is there a simple way to get rid of the extra quotes?
I can do it, of course, by stripping it out with mid() function but wonder whether there's a simplier way.
Thanks
Rafi.