skipping fields

Discussions about CSEntry
Post Reply
AriSilva
Posts: 594
Joined: July 22nd, 2016, 3:55 pm

skipping fields

Post by AriSilva »

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
Best
Ari
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: skipping fields

Post by josh »

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().
SKARA
Posts: 15
Joined: September 13th, 2012, 7:09 am

Re: skipping fields

Post by SKARA »

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;

{***********************************************************************************************************************}
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: skipping fields

Post by josh »

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.
SKARA
Posts: 15
Joined: September 13th, 2012, 7:09 am

Re: skipping fields

Post by SKARA »

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;

{***********************************************************************************************************************}
Post Reply