advance and accept functions

Discussions about CSEntry
Post Reply
Enkhbayar
Posts: 68
Joined: November 10th, 2014, 11:48 pm

advance and accept functions

Post by Enkhbayar »

Hi,

How to avoid "accept" function when I call "advance"? When I reenter to the cases and call "advance", accept function runs in every variable it used and requires action from enumerators. How can go to last position without this problem?

Thanks,
Enkhbayar
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: advance and accept functions

Post by josh »

There are a couple of ways to handle this.

1) Add a global variable isAdvancing and initialize it to zero. Set it to one before calling advance and only call accept if the variable is set to one. You will also need to set it back to zero after you have finished advancing.

2) Use a dictionary variable and a field on the form instead of the accept function. Make the value set for the variable the same list of options as you have for accept. Since the value of the variable is saved, when you advance past it it will not stop you.

Personally I prefer option 2 and I almost never use accept but I know others that use option 1.
Enkhbayar
Posts: 68
Joined: November 10th, 2014, 11:48 pm

Re: advance and accept functions

Post by Enkhbayar »

Thanks Josh,

I've managed it using global variable, skip and advance, but the solutions you're mentioned are better than my option.
Post Reply