knowledge-database (beta)

Current group: dbase.reports

Re: empty and canrender

Re: empty and canrender  
Nico Oudshoorn
 Re: empty and canrender  
Geoff Wass
From:Nico Oudshoorn
Subject:Re: empty and canrender
Date:Sat, 27 Nov 2004 09:19:11 +0100
The solution I found is to test the field in the table to see if it is
empty. Than the answer is true.

Nico Oudshoorn.

"Geoff Wass" schreef in bericht
news:3dGqIEmzEHA.2020@news-server...
> Nico Oudshoorn wrote:
>> No, the result of testVar is 0,000000000000000000 and the result of
>> empty(testVar) is still false. But when I do testVar =
>> round(this.form.me_saldo,2) then the result of testVar is still
>> 0,000000000000000000, BUT empty(testVar) is true.
>>
>> Nico.
>>
>>
>> "Geoff Wass" schreef in bericht
>> news:JVVq4rNzEHA.1000@news-server...
>>> Nico Oudshoorn wrote:
>>>> This is what I tested:
>>>>
>>>> function TEXTFA_FAKTNR1_canRender
>>>> private testVar
>>>> testVar = this.form.me_saldo
>>>> if this.form.faktuur1.rowset.fields["fa_faktnr"].value == 79
>>>> alertmessage("testVar is " + testVar, "waarde")
>>>> alertmessage("testVar is type " + type( "testVar" ), "type")
>>>> alertmessage("Is testVar empty? " + empty( testVar ),
>>>> "empty") endif
>>>> //faktuurnumer 79 gives as results: testVar is, 0,00; type is N;
>>>> empty(testVar) is false.
>>>>
>>>> if empty(testVar)
>>>> return false
>>>> endif
>>>> // so, faktuurnumber 79 is still here and the following test I show
>>>> that by displaying true.
>>>> if this.form.faktuur1.rowset.fields["fa_faktnr"].value == 79
>>>> alertmessage("true", "t/f")
>>>> endif
>>>> // but now I test saldo to see if its zero and it is, because the
>>>> follwing message shows false to me.
>>>> if testVar == 0
>>>> if this.form.faktuur1.rowset.fields["fa_faktnr"].value ==
>>>> 79 alertmessage("false", "t/f")
>>>> endif
>>>> return false
>>>> endif
>>>>
>>>> return true
>>>>
>>>> Faktuurnumber 79 is not the only number with this problem.
>>>>
>>>> I hope that this test helps you by solving the problem,
>>>>
>>>> Nico.
>>>
>>>
>>> Nico,
>>>
>>> Try this:
>>>
>>> set decimals to 18
>>>
>>> and repeat your test so that we can see more digits after the decimal
>>> point.
>>> Maybe the 0,00 you see is really something like 0,0000000000012 .
>>>
>>>
>>>
>>> --
>>>
>>> :-)
>>>
>>>
>>> ----------
>>> Geoff Wass (dBVIPS)
>>> Montréal, Québec, Canada
>>>
>>>
>>> ==========
>>> =======
>>> ====
>>> =
>>> More dBASE information at http://geocities.com/geoff_wass
>>>
>>> Please reply in the news groups only.
>>> Have you backed up your work?!
>>> =
>>> ====
>>> =======
>>> ==========
>
> Nico,
>
> It sounds like it may be 0,000000000000000000000000000000012. Perhaps what
> you could do is this:
>
> use yourTable
> replace all yourField with 0 for round( yourField, 2 ) = 0
>
> "2" may need to be another value depending on how many digits are
> significant to your calculations. See the on-line help for round().
>
> This will, hopefully, fix the table so that you code works as expected.
>
> --
>
> :-)
>
>
> ----------
> Geoff Wass (dBVIPS)
> Montréal, Québec, Canada
>
>
> ==========
> =======
> ====
> =
> More dBASE information at http://geocities.com/geoff_wass
>
> Please reply in the news groups only.
> Have you backed up your work?!
> =
> ====
> =======
> ==========
>
>
>
>
From:Geoff Wass
Subject:Re: empty and canrender
Date:Mon, 29 Nov 2004 12:20:59 -0500
Nico Oudshoorn wrote:
> The solution I found is to test the field in the table to see if it is
> empty. Than the answer is true.
>
> Nico Oudshoorn.



Nico,

Good to hear you have a solution. Thanks for letting us know.

--

:-)


----------
Geoff Wass (dBVIPS)
Montréal, Québec, Canada


==========
=======
====
=
More dBASE information at http://geocities.com/geoff_wass

Please reply in the news groups only.
Have you backed up your work?!
=
====
=======
==========
   

Copyright © 2006 knowledge-database   -   All rights reserved