previous marking a checkbox

Discussions about editing and cleaning data
Forum rules
New release: CSPro 8.0
Post Reply
AriSilva
Posts: 591
Joined: July 22nd, 2016, 3:55 pm

previous marking a checkbox

Post by AriSilva »

Is there a way to mark some specific entries in a checkbox field.
There is the ischeck function, which is very good, to get the responses that are marked, but what I need is, after creating dinamically the checkbox field, to mark certain responses that the user answered before.
Something like check(x, field);
Best
Ari
Best
Ari
sherrell
Posts: 397
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

Re: previous marking a checkbox

Post by sherrell »

Hi Ari,

I'm assuming you want to do something like the following? If so, you'd have to write your own function to do that, that's not something we currently offer in CSPro.
PROC ALPHA2
onfocus
  if ischecked
("A",alpha1) and !ischecked("A", $) then
   
$ = "A" + $;
 
endif;
Of course, this only works on a single character. If you wanted to check all values of alpha1, you'd have to make this recursive.

Sherrell
Last edited by sherrell on September 2nd, 2021, 9:03 pm, edited 2 times in total.
AriSilva
Posts: 591
Joined: July 22nd, 2016, 3:55 pm

Re: previous marking a checkbox

Post by AriSilva »

Thank you Sherrell,
I´m doing something like that with maketext instead of concat (your solution is much neater).
As a Christmas gift, could I suggest developing it as a built in function?
Best
Ari
Best
Ari
sherrell
Posts: 397
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

Re: previous marking a checkbox

Post by sherrell »

xmas pressies: lol

I'll let the guys know (tho I'm sure Greg at least has read this)

Note I modified the example above. I suppose I should use ischecked() over pos() (old habits die hard).

Sherrell
Post Reply