write value in roster culomn

Discussions about CSEntry
Post Reply
xcode
Posts: 21
Joined: August 8th, 2016, 8:54 am

write value in roster culomn

Post by xcode »

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

Re: write value in roster culomn

Post by josh »

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:
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 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.
xcode
Posts: 21
Joined: August 8th, 2016, 8:54 am

Re: write value in roster culomn

Post by xcode »

done thanks :)
xcode
Posts: 21
Joined: August 8th, 2016, 8:54 am

Re: write value in roster culomn

Post by xcode »

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.
jfigueroa
Posts: 100
Joined: August 28th, 2014, 12:46 pm

Re: write value in roster culomn

Post by jfigueroa »

hi xcode,

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;
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:

Code: Select all

set attributes (my_field) native;
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.
xcode
Posts: 21
Joined: August 8th, 2016, 8:54 am

Re: write value in roster culomn

Post by xcode »

many thanks Joshua.
Post Reply