|Date: ||Wed, 21 Sep 2005 12:10:17 -0700|
|Reply-To: ||Bill McKirgan <bill-mckirgan@UIOWA.EDU>|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|From: ||Bill McKirgan <bill-mckirgan@UIOWA.EDU>|
|Subject: ||Re: SCL reading screen variable field properties|
|Content-Type: ||text/plain; charset="iso-8859-1"|
Thank you for your suggestions. As always, you are quick to share your
SCL wisdom, but I'm afraid I need some additional coaching. I have not
been successful applying your example of how to check for field
protection. Would you mind taking a look at this and let me know what
I'm doing incorrectly?
When I do this...
if dpb5b NOT in (1, 5 ) then do; cursor
/* link to data validation message */
if p5c=1 then do;
put p5c=; /* <---just putting it in the log to see */
...p5c always returns as zero.
The variable I am checking protect/unprotect on has that property set
in a previous labeled section of SCL code. So, when the user presses a
1 to indicate, "NO" for current episode of depression, the related
'current episode' questions are protected from data entry. When I test
the fields, they work as expected. That is, if there is NO current
episode, then all related contingency questions are protected and the
cursor passes by them.
However, not all of the questions appear on the same data entry screen,
and this is what is giving me trouble (no, FITS) especially in sections
where I have two or more columns of fields to enter for each question.
So, when the cursor lands on the last unprotected field on an entry
screen, it does not automatically jump to the next open/unprotected
field on the following page/screen when the user enters a value and
presses the enter key. Instead, the cursor goes to the command line:
Command ===> without advancing to the next page.
I cannot get the FIELD function to return anything but a zero. Should
I be coding this in another section of my SCL program?
I'm stumpped, but at least I have a fallback plan, and that is to
create the flag variables I need in the sections where
protect/unprotect is being set.
Thank you *again*,
Richard A. DeVenezia wrote:
> The FIELD function will report the state of the PROTECT flag.
> * set the protection;
> rc = FIELD ('PROTECT', 'Company');
> * check for protection;
> isProtected = FIELD('PROTECTED', 'Company');
> put "Company" isProtected=;
> * unprotect;
> UNPROTECT Company;
> These are all interchangeable
> PROTECT <varname>;
> FIELD('PROTECT', '<varname>');
> varname._protect(); * frame widgets only;
> UNPROTECT <varname>;
> FIELD('UNPROTECT', '<varname>');
> varname._unProtect(); * frame widgets only;
> FIELD('PROTECTED', '<varname>');
> varname._isProtected(); * frame widgets only;
> Richard A. DeVenezia