Alaska Software Inc. - tdradchk()
Username: Password:
AuthorTopic: tdradchk()
Donald R. Keatingtdradchk()
on Mon, 16 Aug 2010 16:58:34 -0400
Hi Y'all,

First I create the Checkbox.

oSEL1:= tdradchk(2,3,'cb',"First Purchase Date",oGBSEL,tdBG)
oSEL1:selected:= {|l,u,o|if(l,eval(                                    ;
           {||xFILT:= tdgetdate("Earliest Date?",boy(date())  ,;
					   	      	,,,{tdBLK,tdCYN}) ,;
                         cSEL1:= "FIRSTBUY>= xFILT"}),NIL)}
oSEL1:create()

Then later in my code I check to see if checkbox has been checked.

if oSEL1:editbuffer()                                        
  cCOND+= ".and."+ cSEL1                                     
  cFILTMSG+= " First Purchase Date On Or After "+ dtoc(xFILT)
endif                                                        

Problem is the if always returns FALSE even whne the box has been checked.

I'll appreciate very much when someone tells me why.

   >don<
James Loughner Re: tdradchk()
on Mon, 16 Aug 2010 23:31:45 -0400
I assume later is after some sort of event loop???

Jim

On 08/16/2010 04:58 PM, Donald R. Keating wrote:
> Hi Y'all,
> 
> First I create the Checkbox.
> 
> oSEL1:= tdradchk(2,3,'cb',"First Purchase Date",oGBSEL,tdBG)
> oSEL1:selected:= {|l,u,o|if(l,eval(                                    ;
>            {||xFILT:= tdgetdate("Earliest Date?",boy(date())  ,;
> 					   	      	,,,{tdBLK,tdCYN}) ,;
>                          cSEL1:= "FIRSTBUY>= xFILT"}),NIL)}
> oSEL1:create()
> 
> Then later in my code I check to see if checkbox has been checked.
> 
> if oSEL1:editbuffer()                                        
>   cCOND+= ".and."+ cSEL1                                     
>   cFILTMSG+= " First Purchase Date On Or After "+ dtoc(xFILT)
> endif                                                        
> 
> Problem is the if always returns FALSE even whne the box has been checked.
> 
> I'll appreciate very much when someone tells me why.
> 
>    >don<
Donald R. KeatingRe: tdradchk()
on Tue, 17 Aug 2010 05:46:40 -0400
Jim, you assume correctly.

On Mon, 16 Aug 2010 23:31:45 -0400, James Loughner wrote:

> I assume later is after some sort of event loop???
> 
> Jim
> 
> On 08/16/2010 04:58 PM, Donald R. Keating wrote:
> > Hi Y'all,
> > 
> > First I create the Checkbox.
> > 
> > oSEL1:= tdradchk(2,3,'cb',"First Purchase Date",oGBSEL,tdBG)
> > oSEL1:selected:= {|l,u,o|if(l,eval(
;
> >            {||xFILT:= tdgetdate("Earliest Date?",boy(date())  ,;
> > 					   	      	,,,{tdBLK,tdCYN}) ,;
> >                          cSEL1:= "FIRSTBUY>= xFILT"}),NIL)}
> > oSEL1:create()
> > 
> > Then later in my code I check to see if checkbox has been checked.
> > 
> > if oSEL1:editbuffer()                                        
> >   cCOND+= ".and."+ cSEL1                                     
> >   cFILTMSG+= " First Purchase Date On Or After "+ dtoc(xFILT)
> > endif                                                        
> > 
> > Problem is the if always returns FALSE even whne the box has been
checked.
> > 
> > I'll appreciate very much when someone tells me why.
> > 
> >    >don<
James Loughner Re: tdradchk()
on Tue, 17 Aug 2010 10:04:54 -0400
In that case you sure that oSEL1 is pointing to the correct control??

Jim

On 08/17/2010 05:46 AM, Donald R. Keating wrote:
> Jim, you assume correctly.
> 
> On Mon, 16 Aug 2010 23:31:45 -0400, James Loughner wrote:
> 
>> I assume later is after some sort of event loop???
>>
>> Jim
>>
>> On 08/16/2010 04:58 PM, Donald R. Keating wrote:
>>> Hi Y'all,
>>>
>>> First I create the Checkbox.
>>>
>>> oSEL1:= tdradchk(2,3,'cb',"First Purchase Date",oGBSEL,tdBG)
>>> oSEL1:selected:= {|l,u,o|if(l,eval(
> ;
>>>            {||xFILT:= tdgetdate("Earliest Date?",boy(date())  ,;
>>> 					   	      	,,,{tdBLK,tdCYN}) ,;
>>>                          cSEL1:= "FIRSTBUY>= xFILT"}),NIL)}
>>> oSEL1:create()
>>>
>>> Then later in my code I check to see if checkbox has been checked.
>>>
>>> if oSEL1:editbuffer()                                        
>>>   cCOND+= ".and."+ cSEL1                                     
>>>   cFILTMSG+= " First Purchase Date On Or After "+ dtoc(xFILT)
>>> endif                                                        
>>>
>>> Problem is the if always returns FALSE even whne the box has been
> checked.
>>>
>>> I'll appreciate very much when someone tells me why.
>>>
>>>    >don<
Donald R. KeatingRe: tdradchk()
on Tue, 17 Aug 2010 10:15:32 -0400
Sorry Jim, I don't understand your question.

    >don<


On Tue, 17 Aug 2010 10:04:54 -0400, James Loughner wrote:

> In that case you sure that oSEL1 is pointing to the correct control??
> 
> Jim
> 
> On 08/17/2010 05:46 AM, Donald R. Keating wrote:
> > Jim, you assume correctly.
> > 
> > On Mon, 16 Aug 2010 23:31:45 -0400, James Loughner wrote:
> > 
> >> I assume later is after some sort of event loop???
> >>
> >> Jim
> >>
> >> On 08/16/2010 04:58 PM, Donald R. Keating wrote:
> >>> Hi Y'all,
> >>>
> >>> First I create the Checkbox.
> >>>
> >>> oSEL1:= tdradchk(2,3,'cb',"First Purchase Date",oGBSEL,tdBG)
> >>> oSEL1:selected:= {|l,u,o|if(l,eval(
> > ;
> >>>            {||xFILT:= tdgetdate("Earliest Date?",boy(date())  ,;
> >>> 					   	      	,,,{tdBLK,tdCYN}) ,;
> >>>                          cSEL1:= "FIRSTBUY>= xFILT"}),NIL)}
> >>> oSEL1:create()
> >>>
> >>> Then later in my code I check to see if checkbox has been checked.
> >>>
> >>> if oSEL1:editbuffer()                                        
> >>>   cCOND+= ".and."+ cSEL1                                     
> >>>   cFILTMSG+= " First Purchase Date On Or After "+ dtoc(xFILT)
> >>> endif                                                        
> >>>
> >>> Problem is the if always returns FALSE even whne the box has been
> > checked.
> >>>
> >>> I'll appreciate very much when someone tells me why.
> >>>
> >>>    >don<
James Loughner Re: tdradchk()
on Tue, 17 Aug 2010 10:23:07 -0400
Are you sure the assignment of the control reference to oSel1 is the one
you think it is. ie did you accidently assign  another control to this
variable?

Jim



On 08/17/2010 10:15 AM, Donald R. Keating wrote:
> Sorry Jim, I don't understand your question.
> 
>     >don<
> 
> 
> On Tue, 17 Aug 2010 10:04:54 -0400, James Loughner wrote:
> 
>> In that case you sure that oSEL1 is pointing to the correct control??
>>
>> Jim
>>
>> On 08/17/2010 05:46 AM, Donald R. Keating wrote:
>>> Jim, you assume correctly.
>>>
>>> On Mon, 16 Aug 2010 23:31:45 -0400, James Loughner wrote:
>>>
>>>> I assume later is after some sort of event loop???
>>>>
>>>> Jim
>>>>
>>>> On 08/16/2010 04:58 PM, Donald R. Keating wrote:
>>>>> Hi Y'all,
>>>>>
>>>>> First I create the Checkbox.
>>>>>
>>>>> oSEL1:= tdradchk(2,3,'cb',"First Purchase Date",oGBSEL,tdBG)
>>>>> oSEL1:selected:= {|l,u,o|if(l,eval(
>>> ;
>>>>>            {||xFILT:= tdgetdate("Earliest Date?",boy(date())  ,;
>>>>> 					   	      	,,,{tdBLK,tdCYN}) ,;
>>>>>                          cSEL1:= "FIRSTBUY>= xFILT"}),NIL)}
>>>>> oSEL1:create()
>>>>>
>>>>> Then later in my code I check to see if checkbox has been checked.
>>>>>
>>>>> if oSEL1:editbuffer()                                        
>>>>>   cCOND+= ".and."+ cSEL1                                     
>>>>>   cFILTMSG+= " First Purchase Date On Or After "+ dtoc(xFILT)
>>>>> endif                                                        
>>>>>
>>>>> Problem is the if always returns FALSE even whne the box has been
>>> checked.
>>>>>
>>>>> I'll appreciate very much when someone tells me why.
>>>>>
>>>>>    >don<
Donald R. KeatingRe: tdradchk()
on Tue, 17 Aug 2010 10:31:42 -0400
I've checked all PRGs in this project and oSEL1 is assigned only once, as
shown in this message.

   >don<

On Tue, 17 Aug 2010 10:23:07 -0400, James Loughner wrote:

> Are you sure the assignment of the control reference to oSel1 is the one
> you think it is. ie did you accidently assign  another control to this
> variable?
> 
> Jim
> 
> 
> 
> On 08/17/2010 10:15 AM, Donald R. Keating wrote:
> > Sorry Jim, I don't understand your question.
> > 
> >     >don<
> > 
> > 
> > On Tue, 17 Aug 2010 10:04:54 -0400, James Loughner wrote:
> > 
> >> In that case you sure that oSEL1 is pointing to the correct control??
> >>
> >> Jim
> >>
> >> On 08/17/2010 05:46 AM, Donald R. Keating wrote:
> >>> Jim, you assume correctly.
> >>>
> >>> On Mon, 16 Aug 2010 23:31:45 -0400, James Loughner wrote:
> >>>
> >>>> I assume later is after some sort of event loop???
> >>>>
> >>>> Jim
> >>>>
> >>>> On 08/16/2010 04:58 PM, Donald R. Keating wrote:
> >>>>> Hi Y'all,
> >>>>>
> >>>>> First I create the Checkbox.
> >>>>>
> >>>>> oSEL1:= tdradchk(2,3,'cb',"First Purchase Date",oGBSEL,tdBG)
> >>>>> oSEL1:selected:= {|l,u,o|if(l,eval(
> >>> ;
> >>>>>            {||xFILT:= tdgetdate("Earliest Date?",boy(date())  ,;
> >>>>> 					   	      	,,,{tdBLK,tdCYN}) ,;
> >>>>>                          cSEL1:= "FIRSTBUY>= xFILT"}),NIL)}
> >>>>> oSEL1:create()
> >>>>>
> >>>>> Then later in my code I check to see if checkbox has been checked.
> >>>>>
> >>>>> if oSEL1:editbuffer()                                        
> >>>>>   cCOND+= ".and."+ cSEL1                                     
> >>>>>   cFILTMSG+= " First Purchase Date On Or After "+ dtoc(xFILT)
> >>>>> endif                                                        
> >>>>>
> >>>>> Problem is the if always returns FALSE even whne the box has been
> >>> checked.
> >>>>>
> >>>>> I'll appreciate very much when someone tells me why.
> >>>>>
> >>>>>    >don<
Zupan Miran Re: tdradchk()
on Tue, 17 Aug 2010 20:25:49 +0200
Hello, I use somethnig like this ...

oGb1 := tdGbox(4.1,2,3,18,oStat," Tip izpisne datoteke ")
oSel1:= tdRadChk(2,4,'rb',".RTF (Word)",oGb1,tdBG)
     IF xRtf_Pdf=1
        oSel1:selection:= .T.
     endif
     oSel1:selected := {|mp1,mp2,obj| iif(mp1,cSel := "R",nil) }
     oSel1:create()

oSel2:= tdRadChk(3,4,'rb',".PDF (Adobe reader)",oGb1,tdEG)
     IF xRtf_Pdf=2
        oSel2:selection:= .T.
     endif
     oSel2:selected := {|mp1,mp2,obj| iif(mp1,cSel := "P",nil) }
     oSel2:create()


Regards
Miran Zupan


--------------------------------
SPC Zupan Miran s.p.
Tomanova pot 9, 1251 Moravce, Slovenia
TEL: (xx386)  59 / 045 - 909
GSM: 041/ 620 - 753

E-mail: spczupan@spc-zupan.si
Web site:    www.spc-zupan.si
--------------------------------
Donald R. KeatingRe: tdradchk()
on Tue, 17 Aug 2010 14:37:13 -0400
Hi Miran,

Thanks for your reply.

That's essentially same thing I've done for creating the check boxes.  My
problem is testing to see if the checkbox has been selected.  It always
returns False.

On Tue, 17 Aug 2010 20:25:49 +0200, Zupan Miran wrote:

> Hello, I use somethnig like this ...
> 
> oGb1 := tdGbox(4.1,2,3,18,oStat," Tip izpisne datoteke ")
> oSel1:= tdRadChk(2,4,'rb',".RTF (Word)",oGb1,tdBG)
>      IF xRtf_Pdf=1
>         oSel1:selection:= .T.
>      endif
>      oSel1:selected := {|mp1,mp2,obj| iif(mp1,cSel := "R",nil) }
>      oSel1:create()
> 
> oSel2:= tdRadChk(3,4,'rb',".PDF (Adobe reader)",oGb1,tdEG)
>      IF xRtf_Pdf=2
>         oSel2:selection:= .T.
>      endif
>      oSel2:selected := {|mp1,mp2,obj| iif(mp1,cSel := "P",nil) }
>      oSel2:create()
> 
> 
> Regards
> Miran Zupan
> 
> 
> --------------------------------
> SPC Zupan Miran s.p.
> Tomanova pot 9, 1251 Moravce, Slovenia
> TEL: (xx386)  59 / 045 - 909
> GSM: 041/ 620 - 753
> 
> E-mail: spczupan@spc-zupan.si
> Web site:    www.spc-zupan.si
> --------------------------------
Raymond Re: tdradchk()
on Tue, 17 Aug 2010 20:37:30 +0200
Hello Don,

I am not sure that you can use oSEL1:editbuffer() in this case.
I would suggest you to add a logical field that is initialized to .F. 
and changed to .T. in your eval code block.
Later on you could then check this logical field.

Best regards,
Raymond


Le 16/08/2010, Donald R. Keating a supposé :
> Hi Y'all,
>
> First I create the Checkbox.
>
> oSEL1:= tdradchk(2,3,'cb',"First Purchase Date",oGBSEL,tdBG)
> oSEL1:selected:= {|l,u,o|if(l,eval(                                    ;
>            {||xFILT:= tdgetdate("Earliest Date?",boy(date())  ,;
> 					   	      	,,,{tdBLK,tdCYN}) ,;
>                          cSEL1:= "FIRSTBUY>= xFILT"}),NIL)}
> oSEL1:create()
>
> Then later in my code I check to see if checkbox has been checked.
>
> if oSEL1:editbuffer()                                        
>   cCOND+= ".and."+ cSEL1                                     
>   cFILTMSG+= " First Purchase Date On Or After "+ dtoc(xFILT)
> endif                                                        
>
> Problem is the if always returns FALSE even whne the box has been checked.
>
> I'll appreciate very much when someone tells me why.
>
>    >don<

Amicalement,
Raymond

http://www.mouches.org
http://www.cpmn.be
Donald R. KeatingRe: tdradchk()
on Tue, 17 Aug 2010 15:25:21 -0400
Hi Raymond,

I too thought it strange when I saw this in the XPP Help file.
	:editBuffer() --> lChecked

But, darned if I can make it work.

So, have already done as you suggest, I'm checkng the value of a character
variable that is populated when the checkbox is acitvated.

Although I've worked around it for now I'd still like to know how to make
it work as advertised.

Thanks for your thoughts and time.

     >don<




On Tue, 17 Aug 2010 20:37:30 +0200, Raymond wrote:

> Hello Don,
> 
> I am not sure that you can use oSEL1:editbuffer() in this case.
> I would suggest you to add a logical field that is initialized to .F. 
> and changed to .T. in your eval code block.
> Later on you could then check this logical field.
> 
> Best regards,
> Raymond
> 
> 
> Le 16/08/2010, Donald R. Keating a supposé :
> > Hi Y'all,
> >
> > First I create the Checkbox.
> >
> > oSEL1:= tdradchk(2,3,'cb',"First Purchase Date",oGBSEL,tdBG)
> > oSEL1:selected:= {|l,u,o|if(l,eval(
;
> >            {||xFILT:= tdgetdate("Earliest Date?",boy(date())  ,;
> > 					   	      	,,,{tdBLK,tdCYN}) ,;
> >                          cSEL1:= "FIRSTBUY>= xFILT"}),NIL)}
> > oSEL1:create()
> >
> > Then later in my code I check to see if checkbox has been checked.
> >
> > if oSEL1:editbuffer()                                        
> >   cCOND+= ".and."+ cSEL1                                     
> >   cFILTMSG+= " First Purchase Date On Or After "+ dtoc(xFILT)
> > endif                                                        
> >
> > Problem is the if always returns FALSE even whne the box has been
checked.
> >
> > I'll appreciate very much when someone tells me why.
> >
> >    >don<
Raymond Re: tdradchk()
on Tue, 17 Aug 2010 21:41:52 +0200
Hi Don,

I looked at the docs and found that editbuffer() cannot always be used.

<snip>
Description

The method :editBuffer() returns the current value in the edit buffer 
of the XbpCheckbox object. This method is only necessary during data 
validation and is called by the validation code block. In other cases, 
the current value is determined using the method :getData() which uses 
the code block in :dataLink to retrieve the data.
</snip>

Therefore I suggest to use getData() instead (same as in their example)

<snip>
oXbp:selected := ;
      {| mp1, mp2, oChk| QOut( "Checkbox B", ;
          IIf( oChk:getData(), "selected", ;
                               "not selected" ) ) }
</snip>

Best regards,
Raymond



Le 17/08/2010, Donald R. Keating a supposé :
> Hi Raymond,
>
> I too thought it strange when I saw this in the XPP Help file.
> 	:editBuffer() --> lChecked
>
> But, darned if I can make it work.
>
> So, have already done as you suggest, I'm checkng the value of a character
> variable that is populated when the checkbox is acitvated.
>
> Although I've worked around it for now I'd still like to know how to make
> it work as advertised.
>
> Thanks for your thoughts and time.
>
>      >don<
>
>
>
>
> On Tue, 17 Aug 2010 20:37:30 +0200, Raymond wrote:
>
>> Hello Don,
>> 
>> I am not sure that you can use oSEL1:editbuffer() in this case.
>> I would suggest you to add a logical field that is initialized to .F. 
>> and changed to .T. in your eval code block.
>> Later on you could then check this logical field.
>> 
>> Best regards,
>> Raymond
>> 
>> 
>> Le 16/08/2010, Donald R. Keating a supposé :
>>> Hi Y'all,
>>> 
>>> First I create the Checkbox.
>>> 
>>> oSEL1:= tdradchk(2,3,'cb',"First Purchase Date",oGBSEL,tdBG)
>>> oSEL1:selected:= {|l,u,o|if(l,eval(
> ;
>>>            {||xFILT:= tdgetdate("Earliest Date?",boy(date())  ,;
>>> 					   	      	,,,{tdBLK,tdCYN}) ,;
>>>                          cSEL1:= "FIRSTBUY>= xFILT"}),NIL)}
>>> oSEL1:create()
>>> 
>>> Then later in my code I check to see if checkbox has been checked.
>>> 
>>> if oSEL1:editbuffer()                                        
>>>   cCOND+= ".and."+ cSEL1                                     
>>>   cFILTMSG+= " First Purchase Date On Or After "+ dtoc(xFILT)
>>> endif                                                        
>>> 
>>> Problem is the if always returns FALSE even whne the box has been checked.
>>> 
>>> I'll appreciate very much when someone tells me why.
>>> 
>>>    >don<

Amicalement,
Raymond

http://www.mouches.org
http://www.cpmn.be
Donald R. KeatingRe: tdradchk()
on Tue, 17 Aug 2010 15:54:36 -0400
Raymond,

I tried :getdata() with same results.

    >don<


On Tue, 17 Aug 2010 21:41:52 +0200, Raymond wrote:

> Hi Don,
> 
> I looked at the docs and found that editbuffer() cannot always be used.
> 
> <snip>
> Description
> 
> The method :editBuffer() returns the current value in the edit buffer 
> of the XbpCheckbox object. This method is only necessary during data 
> validation and is called by the validation code block. In other cases, 
> the current value is determined using the method :getData() which uses 
> the code block in :dataLink to retrieve the data.
> </snip>
> 
> Therefore I suggest to use getData() instead (same as in their example)
> 
> <snip>
> oXbp:selected := ;
>       {| mp1, mp2, oChk| QOut( "Checkbox B", ;
>           IIf( oChk:getData(), "selected", ;
>                                "not selected" ) ) }
> </snip>
> 
> Best regards,
> Raymond
> 
> 
> 
> Le 17/08/2010, Donald R. Keating a supposé :
> > Hi Raymond,
> >
> > I too thought it strange when I saw this in the XPP Help file.
> > 	:editBuffer() --> lChecked
> >
> > But, darned if I can make it work.
> >
> > So, have already done as you suggest, I'm checkng the value of a
character
> > variable that is populated when the checkbox is acitvated.
> >
> > Although I've worked around it for now I'd still like to know how to
make
> > it work as advertised.
> >
> > Thanks for your thoughts and time.
> >
> >      >don<
> >
> >
> >
> >
> > On Tue, 17 Aug 2010 20:37:30 +0200, Raymond wrote:
> >
> >> Hello Don,
> >> 
> >> I am not sure that you can use oSEL1:editbuffer() in this case.
> >> I would suggest you to add a logical field that is initialized to .F. 
> >> and changed to .T. in your eval code block.
> >> Later on you could then check this logical field.
> >> 
> >> Best regards,
> >> Raymond
> >> 
> >> 
> >> Le 16/08/2010, Donald R. Keating a supposé :
> >>> Hi Y'all,
> >>> 
> >>> First I create the Checkbox.
> >>> 
> >>> oSEL1:= tdradchk(2,3,'cb',"First Purchase Date",oGBSEL,tdBG)
> >>> oSEL1:selected:= {|l,u,o|if(l,eval(
> > ;
> >>>            {||xFILT:= tdgetdate("Earliest Date?",boy(date())  ,;
> >>> 					   	      	,,,{tdBLK,tdCYN}) ,;
> >>>                          cSEL1:= "FIRSTBUY>= xFILT"}),NIL)}
> >>> oSEL1:create()
> >>> 
> >>> Then later in my code I check to see if checkbox has been checked.
> >>> 
> >>> if oSEL1:editbuffer()                                        
> >>>   cCOND+= ".and."+ cSEL1                                     
> >>>   cFILTMSG+= " First Purchase Date On Or After "+ dtoc(xFILT)
> >>> endif                                                        
> >>> 
> >>> Problem is the if always returns FALSE even whne the box has been
checked.
> >>> 
> >>> I'll appreciate very much when someone tells me why.
> >>> 
> >>>    >don<
Raymond Re: tdradchk()
on Tue, 17 Aug 2010 22:17:12 +0200
Hi Don,

I looked more deaply in the example and I think we have all wrong.

Alaska: {| mp1, mp2, oChk| ....
           oChk:getData() ... }

Your check box: {|l,u,o| ... }
and later: IF oSEL1:editbuffer() --> should be IF o:editbuffer()
but as o is known only in the code block, this will not work.

So the work aroud is the only solution.

Raymond


Donald R. Keating avait énoncé :
> Raymond,
>
> I tried :getdata() with same results.
>
>     >don<
>
>
> On Tue, 17 Aug 2010 21:41:52 +0200, Raymond wrote:
>
>> Hi Don,
>> 
>> I looked at the docs and found that editbuffer() cannot always be used.
>> 
>> <snip>
>> Description
>> 
>> The method :editBuffer() returns the current value in the edit buffer 
>> of the XbpCheckbox object. This method is only necessary during data 
>> validation and is called by the validation code block. In other cases, 
>> the current value is determined using the method :getData() which uses 
>> the code block in :dataLink to retrieve the data.
>> </snip>
>> 
>> Therefore I suggest to use getData() instead (same as in their example)
>> 
>> <snip>
>> oXbp:selected := ;
>>       {| mp1, mp2, oChk| QOut( "Checkbox B", ;
>>           IIf( oChk:getData(), "selected", ;
>>                                "not selected" ) ) }
>> </snip>
>> 
>> Best regards,
>> Raymond
>> 
>> 
>> 
>> Le 17/08/2010, Donald R. Keating a supposé :
>>> Hi Raymond,
>>> 
>>> I too thought it strange when I saw this in the XPP Help file.
>>> 	:editBuffer() --> lChecked
>>> 
>>> But, darned if I can make it work.
>>> 
>>> So, have already done as you suggest, I'm checkng the value of a character
>>> variable that is populated when the checkbox is acitvated.
>>> 
>>> Although I've worked around it for now I'd still like to know how to make
>>> it work as advertised.
>>> 
>>> Thanks for your thoughts and time.
>>> 
>>>      >don<
>>> 
>>> 
>>> 
>>> 
>>> On Tue, 17 Aug 2010 20:37:30 +0200, Raymond wrote:
>>> 
>>>> Hello Don,
>>>> 
>>>> I am not sure that you can use oSEL1:editbuffer() in this case.
>>>> I would suggest you to add a logical field that is initialized to .F. 
>>>> and changed to .T. in your eval code block.
>>>> Later on you could then check this logical field.
>>>> 
>>>> Best regards,
>>>> Raymond
>>>> 
>>>> 
>>>> Le 16/08/2010, Donald R. Keating a supposé :
>>>>> Hi Y'all,
>>>>> 
>>>>> First I create the Checkbox.
>>>>> 
>>>>> oSEL1:= tdradchk(2,3,'cb',"First Purchase Date",oGBSEL,tdBG)
>>>>> oSEL1:selected:= {|l,u,o|if(l,eval( ;
>>>>>            {||xFILT:= tdgetdate("Earliest Date?",boy(date())  ,;
>>>>> 					   	      	,,,{tdBLK,tdCYN}) ,;
>>>>>                          cSEL1:= "FIRSTBUY>= xFILT"}),NIL)}
>>>>> oSEL1:create()
>>>>> 
>>>>> Then later in my code I check to see if checkbox has been checked.
>>>>> 
>>>>> if oSEL1:editbuffer()                                        
>>>>>   cCOND+= ".and."+ cSEL1                                     
>>>>>   cFILTMSG+= " First Purchase Date On Or After "+ dtoc(xFILT)
>>>>> endif                                                        
>>>>> 
>>>>> Problem is the if always returns FALSE even whne the box has been 
>>>>> checked.
>>>>> 
>>>>> I'll appreciate very much when someone tells me why.
>>>>> 
>>>>>    >don<

Amicalement,
Raymond

http://www.mouches.org
http://www.cpmn.be
Donald R. KeatingRe: tdradchk()
on Tue, 17 Aug 2010 17:02:26 -0400
Thanks Raymond.

    >don<

On Tue, 17 Aug 2010 22:17:12 +0200, Raymond wrote:

> Hi Don,
> 
> I looked more deaply in the example and I think we have all wrong.
> 
> Alaska: {| mp1, mp2, oChk| ....
>            oChk:getData() ... }
> 
> Your check box: {|l,u,o| ... }
> and later: IF oSEL1:editbuffer() --> should be IF o:editbuffer()
> but as o is known only in the code block, this will not work.
> 
> So the work aroud is the only solution.
> 
> Raymond
> 
> 
> Donald R. Keating avait énoncé :
> > Raymond,
> >
> > I tried :getdata() with same results.
> >
> >     >don<
> >
> >
> > On Tue, 17 Aug 2010 21:41:52 +0200, Raymond wrote:
> >
> >> Hi Don,
> >> 
> >> I looked at the docs and found that editbuffer() cannot always be
used.
> >> 
> >> <snip>
> >> Description
> >> 
> >> The method :editBuffer() returns the current value in the edit buffer 
> >> of the XbpCheckbox object. This method is only necessary during data 
> >> validation and is called by the validation code block. In other cases, 
> >> the current value is determined using the method :getData() which uses 
> >> the code block in :dataLink to retrieve the data.
> >> </snip>
> >> 
> >> Therefore I suggest to use getData() instead (same as in their
example)
> >> 
> >> <snip>
> >> oXbp:selected := ;
> >>       {| mp1, mp2, oChk| QOut( "Checkbox B", ;
> >>           IIf( oChk:getData(), "selected", ;
> >>                                "not selected" ) ) }
> >> </snip>
> >> 
> >> Best regards,
> >> Raymond
> >> 
> >> 
> >> 
> >> Le 17/08/2010, Donald R. Keating a supposé :
> >>> Hi Raymond,
> >>> 
> >>> I too thought it strange when I saw this in the XPP Help file.
> >>> 	:editBuffer() --> lChecked
> >>> 
> >>> But, darned if I can make it work.
> >>> 
> >>> So, have already done as you suggest, I'm checkng the value of a
character
> >>> variable that is populated when the checkbox is acitvated.
> >>> 
> >>> Although I've worked around it for now I'd still like to know how to
make
> >>> it work as advertised.
> >>> 
> >>> Thanks for your thoughts and time.
> >>> 
> >>>      >don<
> >>> 
> >>> 
> >>> 
> >>> 
> >>> On Tue, 17 Aug 2010 20:37:30 +0200, Raymond wrote:
> >>> 
> >>>> Hello Don,
> >>>> 
> >>>> I am not sure that you can use oSEL1:editbuffer() in this case.
> >>>> I would suggest you to add a logical field that is initialized to
.F. 
> >>>> and changed to .T. in your eval code block.
> >>>> Later on you could then check this logical field.
> >>>> 
> >>>> Best regards,
> >>>> Raymond
> >>>> 
> >>>> 
> >>>> Le 16/08/2010, Donald R. Keating a supposé :
> >>>>> Hi Y'all,
> >>>>> 
> >>>>> First I create the Checkbox.
> >>>>> 
> >>>>> oSEL1:= tdradchk(2,3,'cb',"First Purchase Date",oGBSEL,tdBG)
> >>>>> oSEL1:selected:= {|l,u,o|if(l,eval( ;
> >>>>>            {||xFILT:= tdgetdate("Earliest Date?",boy(date())  ,;
> >>>>> 					   	      	,,,{tdBLK,tdCYN}) ,;
> >>>>>                          cSEL1:= "FIRSTBUY>= xFILT"}),NIL)}
> >>>>> oSEL1:create()
> >>>>> 
> >>>>> Then later in my code I check to see if checkbox has been checked.
> >>>>> 
> >>>>> if oSEL1:editbuffer()                                        
> >>>>>   cCOND+= ".and."+ cSEL1                                     
> >>>>>   cFILTMSG+= " First Purchase Date On Or After "+ dtoc(xFILT)
> >>>>> endif                                                        
> >>>>> 
> >>>>> Problem is the if always returns FALSE even whne the box has been 
> >>>>> checked.
> >>>>> 
> >>>>> I'll appreciate very much when someone tells me why.
> >>>>> 
> >>>>>    >don<
Joe Carrick Re: tdradchk()
on Tue, 17 Aug 2010 16:53:03 -0700
Hi Don,

I don't see any codeblock for datalink which you must have.  Without it, 
you need to put a o:setdata(.T.) in the :selected callback.  Then and 
onlyh then will :getdata() return a value of .T.

The simplest way is to have a defined datatlink codeblock.  That way, 
clicking on the radiobutton will not only change the appearance but will 
also set value to .T.

hth, Joe

On 8/16/2010 1:58 PM, Donald R. Keating wrote:
> Hi Y'all,
>
> First I create the Checkbox.
>
> oSEL1:= tdradchk(2,3,'cb',"First Purchase Date",oGBSEL,tdBG)
> oSEL1:selected:= {|l,u,o|if(l,eval(                                    ;
>             {||xFILT:= tdgetdate("Earliest Date?",boy(date())  ,;
> 					   	      	,,,{tdBLK,tdCYN}) ,;
>                           cSEL1:= "FIRSTBUY>= xFILT"}),NIL)}
> oSEL1:create()
>
> Then later in my code I check to see if checkbox has been checked.
>
> if oSEL1:editbuffer()
>    cCOND+= ".and."+ cSEL1
>    cFILTMSG+= " First Purchase Date On Or After "+ dtoc(xFILT)
> endif
>
> Problem is the if always returns FALSE even whne the box has been checked.
>
> I'll appreciate very much when someone tells me why.
>
>     >don<
>
Donald R. KeatingRe: tdradchk()
on Wed, 18 Aug 2010 08:19:52 -0400
Thanks Joe.

   >don<


On Tue, 17 Aug 2010 16:53:03 -0700, Joe Carrick wrote:

> Hi Don,
> 
> I don't see any codeblock for datalink which you must have.  Without it, 
> you need to put a o:setdata(.T.) in the :selected callback.  Then and 
> onlyh then will :getdata() return a value of .T.
> 
> The simplest way is to have a defined datatlink codeblock.  That way, 
> clicking on the radiobutton will not only change the appearance but will 
> also set value to .T.
> 
> hth, Joe
> 
> On 8/16/2010 1:58 PM, Donald R. Keating wrote:
> > Hi Y'all,
> >
> > First I create the Checkbox.
> >
> > oSEL1:= tdradchk(2,3,'cb',"First Purchase Date",oGBSEL,tdBG)
> > oSEL1:selected:= {|l,u,o|if(l,eval(
;
> >             {||xFILT:= tdgetdate("Earliest Date?",boy(date())  ,;
> > 					   	      	,,,{tdBLK,tdCYN}) ,;
> >                           cSEL1:= "FIRSTBUY>= xFILT"}),NIL)}
> > oSEL1:create()
> >
> > Then later in my code I check to see if checkbox has been checked.
> >
> > if oSEL1:editbuffer()
> >    cCOND+= ".and."+ cSEL1
> >    cFILTMSG+= " First Purchase Date On Or After "+ dtoc(xFILT)
> > endif
> >
> > Problem is the if always returns FALSE even whne the box has been
checked.
> >
> > I'll appreciate very much when someone tells me why.
> >
> >     >don<
> >