Page 1 of 1

Popup jump option

Posted: Mon Oct 05, 2015 8:18 am
by omni
Roger,

We have a popup that jumps to the next field, but that field is not always the one we want it to go to. If the user makes a certain selection it needs to go to another field.

POPUP {|c|{bookship(c,.t.,"S"),Dateship}} ;

IF they leave the field blank (actually a 0 in the validation) it then needs to go to oMiscship instead of Dateship. Can we use logic in that feature?

Thanks

Fred
Omni

Re: Popup jump option

Posted: Mon Oct 05, 2015 8:40 am
by rdonnay
This may work:

Code: Select all

POPUP {|c|{bookship(c,.t.,"S"),IIF(c='0',oMiscShip,Dateship)}} ;

Re: Popup jump option

Posted: Mon Oct 05, 2015 3:11 pm
by omni
It always responds as if it is zero (which is the default value), it acts af if it needs to be {||c or similar which compiles but gives an error when running. Its a number zero if that matters, not a character. Error is parameter has a wrong data type when using {||

Fred

Re: Popup jump option

Posted: Mon Oct 05, 2015 6:40 pm
by rdonnay

Code: Select all

POPUP {|c|{bookship(c,.t.,"S"),IIF(c=0,oMiscShip,Dateship)}} ;

Re: Popup jump option

Posted: Tue Oct 06, 2015 12:54 pm
by omni
Yes, I changed it to a number when I tested. Just did not know if it made a difference that it would not allow a numeric for comparison. The problem appears to be that the popup/jump occurs prior to the validation, so it always uses the original value for C.

Re: Popup jump option

Posted: Tue Oct 06, 2015 1:26 pm
by rdonnay
Write me a small sample program to work with.

I'm very busy getting ready for the Phoenix devcon next week.

Re: Popup jump option

Posted: Tue Oct 06, 2015 1:41 pm
by TWolfe

Code: Select all

POPUP {|c|{bookship(@c,.t.,"S"),IIF(c=0,oMiscShip,Dateship)}} ;
Pass c to bookship() by reference.

From the docs: "Code block parameters are LOCAL variables which exist when the code block is executed and are only visible within the code block."

As locals, they must be passed by reference if you want to see them changed by the called function/procedure.

HTH,
Terry
"I hate obvious stuff, it is often so hard to see!"