in my roster i have a size column contain
1 -350 gr
2 -450 gr
3 -650 gr
.
.
..
and next column in the roster is empty i want when user select 1 from size column the system write 000.350 in the second column and so on
write value in roster culomn
Re: write value in roster culomn
In the PROC for your size column you can assign a value to the second column. For example if the dictionary variables for your columns are named SIZE and SECOND then you could write logic like this:
If you don't want the user to be able to change the value in the second column then you could use the command noinput in the preproc of the second column to prevent user input or you could set the field to protected by right clicking on it and choosing "Field properties". Again you can look in the help for more info on protected fields and noinput.
PROC SIZE
if SIZE = 1 then
SECOND = 0.350;
elseif SIZE = 2 then
SECOND = 0.450;
elseif SIZE = 3 then
SECOND = 0.650;
endif;
You could also look at the recode command which is similar to a series of if, elseif but offers a more compact syntax. Details on that are available in online help.if SIZE = 1 then
SECOND = 0.350;
elseif SIZE = 2 then
SECOND = 0.450;
elseif SIZE = 3 then
SECOND = 0.650;
endif;
If you don't want the user to be able to change the value in the second column then you could use the command noinput in the preproc of the second column to prevent user input or you could set the field to protected by right clicking on it and choosing "Field properties". Again you can look in the help for more info on protected fields and noinput.
Re: write value in roster culomn
another question . regarding the above question i have in the size column "98-other weight" i want when the user select this the second column be available for writing as i make it protected field how can i remove protection programmatic.
i tried noinput but the user could go back and change the value even for fixed size so i need to use field protected instead of noinput.
i tried noinput but the user could go back and change the value even for fixed size so i need to use field protected instead of noinput.
Re: write value in roster culomn
hi xcode,
to protect a field in logic you need to use the set attributes statement.
You can do someting like this:
That way the operator is not gonna be able to access, modify or change field value in any way.
and to unprotect the field you use:
For more information about how to use it, you can take a look at the set attributes statement on CSPro help. (Pressing F1).
Regards.
Joshua Figueroa.
to protect a field in logic you need to use the set attributes statement.
You can do someting like this:
Code: Select all
set attributes (my_field) protect;
and to unprotect the field you use:
Code: Select all
set attributes (my_field) native;
Regards.
Joshua Figueroa.
Re: write value in roster culomn
many thanks Joshua.