how to end a roster in a numeric type.

Discussions about CSEntry
Post Reply
lodiatic
Posts: 4
Joined: February 22nd, 2016, 8:39 pm

how to end a roster in a numeric type.

Post by lodiatic »

Hi I'm developping a capi for smartphone. I can end a roster where selctionn is in alpha, I've tried the same code for numeric area but it don't work.

i've used this code in alpha selection

Code: Select all

PROC C1
if C1 = "" then
		numeric selection = accept("Avez vous finis de poser des questions?",
								"Continuer de saisir des données",
								"Terminer la saisie");
		if selection = 1 then // on continue la saisie
		else
			endgroup;
		endif;
endif;
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: how to end a roster in a numeric type.

Post by josh »

The empty string ("") can only be used to compare against alpha values not against numeric values. An empty (or blank) number will have the special value notappl. Try the following:
PROC C1
if C1 = notappl then
      
numeric selection = accept("Avez vous finis de poser des questions?",
                        
"Continuer de saisir des données",
                        
"Terminer la saisie");
      
if selection = 1 then // on continue la saisie
      else
         
endgroup;
      
endif;
endif;
amanuel
Posts: 1
Joined: April 26th, 2017, 10:59 am

Re: how to end a roster in a numeric type.

Post by amanuel »

Dear josh,
Thank you for your post.
I have encounter the same issue while trying to end a roster(funding information) that have 5 questions DQ18,DQ19,DQ20,DQ21,DQ22. The first question, DQ18 is a numeric type that have value sets while the remaining four is numeric that wil take an integer value that didn't have value sets. I have used both method in your posts using notappl it compile successfully but it doesn't stop the roster while nothing is entered.
i have used the following codes as per your recommendation:

PROC DQ18
if DQ18 = notappl then
numeric selection = accept("Are you finished entering Funding sources?","Continue Entering Funding information","End Funding information Roster");
if Selection = 1 then //continue with Funding information
reenter;
else
endgroup;
endif;

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

Re: how to end a roster in a numeric type.

Post by josh »

If you are using system controlled mode (default when you select new CAPI application) then by default you are not allowed to enter blanks for numeric fields. You can change that behavior using the Set Behavior Canenter Statement in your application logic (look in the help for details). Add the following to your FF preproc.

set behavior(DQ18) canenter(notappl) on (noconfirm);

Personally I prefer not to use entering blanks to terminate a roster. Instead I add an additional yes/no question at the end of the roster asking if there are more rows. This way you avoid the weirdness of notappl and you don't need the accept box either. I also avoid using accept in CAPI applications because if you resume from partial save to a field after the roster the accept box still pops up.
Post Reply