When some fields are skipped during data entry, they are assigned NOTAPPL no matter what you assign them before the skipping.
But suppose you want them with a different value than the notappl, like:
...
proc field1
if $ = 9 then
field2 = 999;
skip to field3;
endif;
In this case, if field1=9, field2 will be notappl, even if you assigned it 999 in te postproc before skipping.
The question is:
What is the best strategy to have field2 = 999? That is, I need to skip its proc but still I want it to be a value assigned to it, as the logic went into its onfocus and there $ = 999; noinput;
Or, the system would assign notappl to the sipped fields ONLY if they were not assigned any other value.
Best
skipping fields
Re: skipping fields
In system controlled mode any field that is skipped is assigned notappl. A skipped field has been skipped so by definition it should be blank. If you try to do otherwise in data entry you will run into a lot of issues. Just go with it. If you really need them to be other values record them in batch later.
If you want to assign a non-blank value in data entry then don't use skip. Use noinput or make it protected using setproperty().
If you want to assign a non-blank value in data entry then don't use skip. Use noinput or make it protected using setproperty().
Re: skipping fields
AriSilva,
In your situation, I advise you not to include 999 in the list of possible values of field2 so that the operators do not enter this value in the program by mistake. So you can try the following syntax:
//Main syntax :
Proc QuestionToBeSkipped
onfocus
//Universe = condition under which the question must be asked.
if not (Universe) then
set behavior($) canenter(outofrange) on (noconfirm);
$=SkippedValue; //SkippedValue=999 in your situation
set attributes ($) protect;
else
set attributes ($) native;
set behavior($) canenter(outofrange) off (noconfirm);
endif;
{***********************************************************************************************************************}
//Your situation will be like below :
Proc field2
onfocus
//Universe = not field1 in 9.
if not (not field1 in 9) then // or simply <<==>> if (field1 in 9) then
set behavior($) canenter(outofrange) on (noconfirm);
$=999;
set attributes ($) protect;
else
set attributes ($) native;
set behavior($) canenter(outofrange) off (noconfirm);
endif;
{***********************************************************************************************************************}
In your situation, I advise you not to include 999 in the list of possible values of field2 so that the operators do not enter this value in the program by mistake. So you can try the following syntax:
//Main syntax :
Proc QuestionToBeSkipped
onfocus
//Universe = condition under which the question must be asked.
if not (Universe) then
set behavior($) canenter(outofrange) on (noconfirm);
$=SkippedValue; //SkippedValue=999 in your situation
set attributes ($) protect;
else
set attributes ($) native;
set behavior($) canenter(outofrange) off (noconfirm);
endif;
{***********************************************************************************************************************}
//Your situation will be like below :
Proc field2
onfocus
//Universe = not field1 in 9.
if not (not field1 in 9) then // or simply <<==>> if (field1 in 9) then
set behavior($) canenter(outofrange) on (noconfirm);
$=999;
set attributes ($) protect;
else
set attributes ($) native;
set behavior($) canenter(outofrange) off (noconfirm);
endif;
{***********************************************************************************************************************}
Re: skipping fields
Note that in recent versions of CSPro we have moved away from set behavior and set attributes. Those commands have been replaced with setproperty() https://www.csprousers.org/help/CSPro/s ... ction.html.
Re: skipping fields
====================josh wrote: ↑February 28th, 2020, 8:36 pm Note that in recent versions of CSPro we have moved away from set behavior and set attributes. Those commands have been replaced with setproperty() https://www.csprousers.org/help/CSPro/s ... ction.html.
Code: Select all
Hi AriSilva,
So you can use the syntax below :
//Main syntax :
Proc QuestionToBeSkipped
onfocus
//Universe = condition under which the question must be asked.
if not (Universe) then
setproperty($,"CanEnterOutOfRange","noconfirm");
$=SkippedValue; //SkippedValue=999 in your situation
setproperty($,"Protected","Yes");
else
setproperty($,"Protected","No");
setproperty($,"CanEnterOutOfRange","No");
endif;
{***********************************************************************************************************************}
//Your situation will be like below :
Proc field2
onfocus
//Universe = not field1 in 9.
if not (not field1 in 9) then // or simply <<==>> if (field1 in 9) then
setproperty($,"CanEnterOutOfRange","noconfirm");
$=999;
setproperty($,"Protected","Yes");
else
setproperty($,"Protected","No");
setproperty($,"CanEnterOutOfRange","No");
endif;
{***********************************************************************************************************************}