01-08-2014 04:07 AM - edited 01-08-2014 04:17 AM
Norbert_B a écrit :
Yes, you miss-typed "step" as "setp" (red marked in the expression)......
Norbert
sorry but I also do not find button on Message Popup step when I'm writing "step.", below is a list of suggestions on teststand ( I see only the button 1,2 up to 5)
01-08-2014 04:38 AM
Ah, seen only the typo.... there is another issue in your expression as i presumed: Delete the leading and postponing quotation mark.
Norbert
01-08-2014 05:27 AM
Norbert_B a écrit :
Ah, seen only the typo.... there is another issue in your expression as i presumed: Delete the leading and postponing quotation mark.
Norbert
I have removed the quotes and I tried two method, but both have the error
01-08-2014 05:35 AM
crossrulz a écrit :
Another simple option is to create an array with the possible values and then just index the value that was chosen with the button.
Locals.CanType = CanTypeArray[Step.Result.ButtonHit-1] //If the array is 0 based, you will need to subtract 1 from the ButtonHit result
I created a string in array as you can see on the attachment because my Locals.Can_Type must be equal to a string but I get an error
01-08-2014 05:53 AM - edited 01-08-2014 05:57 AM
As you can see in your second screenshot, the ButtonHit equals 0 in your execution. That is only possible, if the PostExpression is not part of the MessagePopup step.
Norbert
EDIT: I see that the dialog is no runtime error, but an evaluation warning. Sorry for the confusion. Obviously, you haven't executed the sequence yet. Do it.....
01-08-2014 06:26 AM
Norbert_B a écrit :
As you can see in your second screenshot, the ButtonHit equals 0 in your execution. That is only possible, if the PostExpression is not part of the MessagePopup step.
Norbert
EDIT: I see that the dialog is no runtime error, but an evaluation warning. Sorry for the confusion. Obviously, you haven't executed the sequence yet. Do it.....
I did, but I always get an error
and I dont understand why I see always warning Step.button0label
01-08-2014 06:45 AM
You need to tell the analyzer to ignore that error. Use this as your PostExpression:
Locals.CanType = #NoValidation(Locals.CanTypeArray[Step.Result.ButtonHit-1])
The #NoValidation is a flag to tell the analyzer to not pre-evaluate the expression. The ButtonHit is default to 0, but after actually running, the value will be greater than 0 since the first button will return 1.
01-08-2014 07:26 AM - edited 01-08-2014 07:35 AM
crossrulz a écrit :
You need to tell the analyzer to ignore that error. Use this as your PostExpression:
Locals.CanType = #NoValidation(Locals.CanTypeArray[Step.Result.ButtonHit-1])
The #NoValidation is a flag to tell the analyzer to not pre-evaluate the expression. The ButtonHit is default to 0, but after actually running, the value will be greater than 0 since the first button will return 1.
sorry, I can not open the document because you do not have the same version as me and when I use your suggestion I get an error
and when I removed the # I get another error
01-08-2014 07:35 AM
sonnyanderson wrote:sorry, I can not open the document because you do not have the same version as me and when I use your suggestion I get an error
Ah, you have a version from before that function. In that case do this:
Locals.CanType = Locals.CanTypeArray[max(Step.Result.ButtonHit-1,0)]
This will force the index to be no less than 0.
01-08-2014 07:42 AM - edited 01-08-2014 07:45 AM
thx thx this function
forgiveness is that you can explain to me how you doing? that is what you used? and why ? please