double becomes integer

Jules Jacquot jules.jacquot at wanadoo.fr
Sun Jun 26 06:53:00 CDT 2005


thanks ruslan

jules
Le 25 juin 05 à 19:25, Ruslan Zasukhin a écrit :

> On 6/25/05 7:50 PM, "Jules Jacquot" <jules.jacquot at wanadoo.fr> wrote:
>
> Hi Jules,
>
>
>> hi,ruslan
>>
>> if i have defined a double value like this
>>
>>    cotisouv=tblCotisations.field("Assdouv").value
>>
>> i have 2,40
>>
>> if i multiply cotisouv by a constant e.g. 3
>>
>> cotisouv=tblCotisations.field("Assdouv").value*3
>>
>> i have 6
>>
>> workarond :
>>
>> cotisouv=cdbl(tblCotisations.field("Assdouv").getstring)*3
>>
>> then i have the correct result 7,2
>>
>> what do you think about ? Bug ?
>>
>
> No. this is why:
>
>     tblCotisations.field("Assdouv").value * 3
>                ^^^^^^^^^
>
> You use access as to Vfield.Value. This is VARIANT.
> I.e. This value do not have own type.
>
> Now you do * 3, which is integer.
>
>         unknown type * integer
>
> What type RB choose for result?
> Right. Integer.
>
> You can do
>
> 1)
>     tblCotisations.field("Assdouv").value * 3.0
>
>
> 2)
>     tblCotisations.DoubleField("Assdouv").value*3
>
>
> -- 
> Best regards,
>
> Ruslan Zasukhin
> VP Engineering and New Technology
> Paradigma Software, Inc
>
> Valentina - Joining Worlds of Information
> http://www.paradigmasoft.com
>
> [I feel the need: the need for speed]
>
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
>
>

Réussir dans la vie,  c'est échouer au bon endroit

Jean-Baptiste de Foucauld




More information about the Valentina mailing list