Alaska Software Inc. - tdxget() with bVALID
Username: Password:
AuthorTopic: tdxget() with bVALID
Donald Keatingtdxget() with bVALID
on Fri, 11 Apr 2014 18:01:26 -0400
Hi Y'all,

This compiles
	oGET1:= tdxget(3,18,{||cTRNREF},oDA,6,oDLG,"999999")

But, when I add the valid block like this..
	oGET1:= tdxget(3,18,{||cTRNREF},oDA,6,oDLG,"999999"  ,;
        {|o|o:editbuffer():= padl(alltrim(o:currentval()),6),.T.})

I get error.
	XBT0231:Invalid lvalue	

What am I doing wrong?

Thanks.

  >don<
Donald KeatingRe: tdxget() with bVALID
on Fri, 11 Apr 2014 19:17:03 -0400
After a short break I've gone back and reread the error message.  I
think what it's saying is I can't assign a value to the editbuffer in
this way.

What I'm trying to do is have data in the editbuffer be right aligned
when the user exits the get even if he/she didn't enter it that way.

Is this possible?

On Fri, 11 Apr 2014 18:01:26 -0400, Donald Keating wrote:

>Hi Y'all,
>
>This compiles
>	oGET1:= tdxget(3,18,{||cTRNREF},oDA,6,oDLG,"999999")
>
>But, when I add the valid block like this..
>	oGET1:= tdxget(3,18,{||cTRNREF},oDA,6,oDLG,"999999"  ,;
>        {|o|o:editbuffer():= padl(alltrim(o:currentval()),6),.T.})
>
>I get error.
>	XBT0231:Invalid lvalue	
>
>What am I doing wrong?
>
>Thanks.
>
>  >don<
Peter AlderliestenRe: tdxget() with bVALID
on Sat, 12 Apr 2014 09:42:06 +0200
Don,

> What I'm trying to do is have data in the editbuffer be right aligned
> when the user exits the get even if he/she didn't enter it that way.
> 
> Is this possible?

I don't know but I assume that the tdGet is inherited from xbpSle.
Why don't you use the :align variable with  XBPSLE_RIGHT?

Peter
Donald KeatingRe: tdxget() with bVALID
on Sat, 12 Apr 2014 09:29:02 -0400
Thanks Peter,

At first blush this seems to work, I'll do more testing befoe I
release it.

oGET1:= tdxget(3,18,{||cTRNREF},oDA,6,oDLG,"999999",;
          {|o|o:align:= XBPSLE_RIGHT,o:configure(),.T.})

  >don<


On Sat, 12 Apr 2014 09:42:06 +0200, Peter Alderliesten wrote:

>Don,
>
>> What I'm trying to do is have data in the editbuffer be right aligned
>> when the user exits the get even if he/she didn't enter it that way.
>> 
>> Is this possible?
>
>I don't know but I assume that the tdGet is inherited from xbpSle.
>Why don't you use the :align variable with  XBPSLE_RIGHT?
>
>Peter
Clayton Jones Re: tdxget() with bVALID
on Sat, 12 Apr 2014 16:45:36 -0400
Hello Don,

>After a short break I've gone back and reread the error message.  I
>think what it's saying is I can't assign a value to the editbuffer in
>this way.

I think this will work

  oGET1:= tdxget(3,18,{||cTRNREF},oDA,6,oDLG,"999999"  ,;
         {|o| o:setData() := padl(alltrim(o:currentval()),6),.T.})

As for right align configuration, it will automatically do that if the
initial data it's presented with is numeric.  If this version needs to
be right aligned all the time then it can be done in the code when
it's created 

  oGet1 := tdXget(...)
  oGet1:align := XBPSLE_RIGHT
  oGet1:configure()

...and won't need to be done in a bValid codeblock

 oGET1:= tdxget(3,18,{||cTRNREF},oDA,6,oDLG,"999999",;
          {|o|o:align:= XBPSLE_RIGHT,o:configure(),.T.})


That ought to do the job.

Regards,
Clayton

Clayton Jones   www.cjcom.net 
 Top-Down Library for Xbase++
 X-DBU Database Utility   
 X-MEMO Memo Field Replacement
 Spell-X  Spell Checking for Xbase++
Donald KeatingRe: tdxget() with bVALID
on Mon, 14 Apr 2014 11:09:38 -0400
Thanks Clayton,

Your solution gives XBT0231:Invalid lvalue error same as my earlier 
oGET1:= tdxget(3,18,{||cTRNREF},oDA,6,oDLG,"999999",;
          {|o|o:align:= XBPSLE_RIGHT,o:configure(),.T.})

but, as I said in my prior message this seems to work OK.  .
oGET1:= tdxget(3,18,{||cTRNREF},oDA,6,oDLG,"999999",;
          {|o|o:align:= XBPSLE_RIGHT,o:configure(),.T.})

This will give correct initial configuration but, not right align if
user changes data.
oGet1 := tdXget(...)
oGet1:align := XBPSLE_RIGHT
oGet1:configure()

  >don<

On Sat, 12 Apr 2014 16:45:36 -0400, Clayton Jones <topdown@cjcom.net>
wrote:

>Hello Don,
>
>>After a short break I've gone back and reread the error message.  I
>>think what it's saying is I can't assign a value to the editbuffer in
>>this way.
>
>I think this will work
>
>  oGET1:= tdxget(3,18,{||cTRNREF},oDA,6,oDLG,"999999"  ,;
>         {|o| o:setData() := padl(alltrim(o:currentval()),6),.T.})
>
>As for right align configuration, it will automatically do that if the
>initial data it's presented with is numeric.  If this version needs to
>be right aligned all the time then it can be done in the code when
>it's created 
>
>  oGet1 := tdXget(...)
>  oGet1:align := XBPSLE_RIGHT
>  oGet1:configure()
>
>...and won't need to be done in a bValid codeblock
>
> oGET1:= tdxget(3,18,{||cTRNREF},oDA,6,oDLG,"999999",;
>          {|o|o:align:= XBPSLE_RIGHT,o:configure(),.T.})
>
>
>That ought to do the job.
>
>Regards,
>Clayton
>
>Clayton Jones   www.cjcom.net 
> Top-Down Library for Xbase++
> X-DBU Database Utility   
> X-MEMO Memo Field Replacement
> Spell-X  Spell Checking for Xbase++
Clayton Jones Re: tdxget() with bVALID
on Mon, 28 Apr 2014 18:39:55 -0400
Hello Don,

Sorry for my late reply, been away for awhile.

>Your solution gives XBT0231:Invalid lvalue error same as my earlier 
>oGET1:= tdxget(3,18,{||cTRNREF},oDA,6,oDLG,"999999",;
>          {|o|o:align:= XBPSLE_RIGHT,o:configure(),.T.})
>
>but, as I said in my prior message this seems to work OK.  .
>oGET1:= tdxget(3,18,{||cTRNREF},oDA,6,oDLG,"999999",;
>          {|o|o:align:= XBPSLE_RIGHT,o:configure(),.T.})
>
>This will give correct initial configuration but, not right align if
>user changes data.
>oGet1 := tdXget(...)
>oGet1:align := XBPSLE_RIGHT
>oGet1:configure()

This whole thing seems very odd, somehow the dots aren't connecting.
It doesn't make sense that the alignment property would change just
because the buffer data is changed.  I just looked at the code in
tdcXget and found a different approach, assignment to :Xbpsle.  So
maybe this will work without changing

 oGet1:XbpSle:align := XBPSLE_RIGHT



Regards,
Clayton

Clayton Jones   www.cjcom.net 
 Top-Down Library for Xbase++
 X-DBU Database Utility   
 X-MEMO Memo Field Replacement
 Spell-X  Spell Checking for Xbase++
Donald KeatingRe: tdxget() with bVALID
on Mon, 28 Apr 2014 19:43:26 -0400
Hi Clayton,

So far my solution is working fine.  Will be back when it doesn't.

  >don<

On Mon, 28 Apr 2014 18:39:55 -0400, Clayton Jones <topdown@cjcom.net>
wrote:

>Hello Don,
>
>Sorry for my late reply, been away for awhile.
>
>>Your solution gives XBT0231:Invalid lvalue error same as my earlier 
>>oGET1:= tdxget(3,18,{||cTRNREF},oDA,6,oDLG,"999999",;
>>          {|o|o:align:= XBPSLE_RIGHT,o:configure(),.T.})
>>
>>but, as I said in my prior message this seems to work OK.  .
>>oGET1:= tdxget(3,18,{||cTRNREF},oDA,6,oDLG,"999999",;
>>          {|o|o:align:= XBPSLE_RIGHT,o:configure(),.T.})
>>
>>This will give correct initial configuration but, not right align if
>>user changes data.
>>oGet1 := tdXget(...)
>>oGet1:align := XBPSLE_RIGHT
>>oGet1:configure()
>
>This whole thing seems very odd, somehow the dots aren't connecting.
>It doesn't make sense that the alignment property would change just
>because the buffer data is changed.  I just looked at the code in
>tdcXget and found a different approach, assignment to :Xbpsle.  So
>maybe this will work without changing
>
> oGet1:XbpSle:align := XBPSLE_RIGHT
>
>
>
>Regards,
>Clayton
>
>Clayton Jones   www.cjcom.net 
> Top-Down Library for Xbase++
> X-DBU Database Utility   
> X-MEMO Memo Field Replacement
> Spell-X  Spell Checking for Xbase++
>