Page 1 of 1

missing documentation for dccheckbox

Posted: Sat Oct 17, 2015 10:12 pm
by Cliff Wiernik
I just found in dcdialog a DCSAY CHECKBOX command. However, I cannot find it in the documentation, nor can I find out what/how the TRANSFORM clause works. Roger, can you provide the documentation for the missing items.

Thanks.

Cliff

Re: missing documentation for dccheckbox

Posted: Sun Oct 18, 2015 7:29 am
by rdonnay
I will look at this when I get back home from the conference.

Re: missing documentation for dccheckbox

Posted: Mon Oct 19, 2015 12:41 am
by Tom
Hi, Cliff.

That was caused by a suggestion I made many years ago with the first conversion to Xbase++/eXpress++. In Clipper-apps, we didn't have logical gets (!), so database fields contained "Y" or "N" (or in german "J" or "N") in order to work as get datasources directly. We had something like "PICTURE '!' VALID db->Field $ 'JN'", and the user had to type "J" or "N" to set the (somehow logical) value.

"DCSAY ... CHECKBOX" moves/translates a character field into a checkbox. "TRANSFORM" is an array with two elements for logical yes and logical no. Assume "db->customer" is a character field of the length 1 containing a "Y" for "yes, this is a customer" or "N" for "no, this is not a customer". This is the code to move this to a checkbox:

Code: Select all

@ 1,1 DCSAY 'Is this a customer:' GET db->customer CHECKBOX TRANSFORM {'Y','N'}
It will place a checkbox behind (!) the prompt and set it to .T. if db->customer is 'Y' and to .F. in all other cases. If the box is clicked, the data will be computed vice versa.

I don't use this anymore since all tables were converted. DCCHECKBOX is better anyway, since it places the box in front of the prompt.

Re: missing documentation for dccheckbox

Posted: Mon Oct 19, 2015 5:07 pm
by Cliff Wiernik
Thanks Tom,

Bobby also has a version of the DCCHECKBOX with the prompt translated to a say and done either before or after. We do it both ways and often do manually a separate say to get around the dimming effect on the caption if you disable the checkbox. We disable it to change the appearance to indicate that it cannot be edited. However, we don't want the caption dimmed.

As for the conversion. We also had/have a similar circumstance but have not converted all the other clipper character Y/N fields. We handle it in the gather scatter to convert to a logical and back.

Cliff