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;
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 = notapplthen numeric selection = accept("Avez vous finis de poser des questions?", "Continuer de saisir des données", "Terminer la saisie"); if selection = 1then// on continue la saisie else endgroup; endif; endif;
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;
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.