Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OK! This is interesting
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
OK! This is interesting
Miscellaneous
Thread ID:
00655074
Message ID:
00655074
Views:
57
Either I am totally standing on the line or this is weird.

having
a = {^2002-05-10 16:18:00}
b = {^2002-05-10 16:19:00}

This should make a minute if I separate them from each other and
devide by 60 right?

? b - 1 and
? (b-a) / 60

should be 60 or 1 respectively. And if I do this, my screen shows me 1.0000. So far, so good.

However putting this into a table with an integer endurance-field leaves
0 there

so I tried

? int((b-a) / 60 )

and this gave me 0

Maybe this was to complicated for my system. So make it in two
steps

x = b - a
? x ==> 60
? int(x / 60) ==> 0

After this did not make too much sense, I set decimals to 15. And see:

? (b-a) / 60

actually is

0.99999994039535500

Just as every little child knows 60 / 60 is 0.99999994039535500.

So the trick to make this work actually is to employ round()

int( round(b-a, 1) / 60 )

actually works.

But I thought this might be interesting for the one or the other as it was not truely obvious (to me). If you like, tell me if You can reproduce this.

It's VFP7 SP1, German edition, WinNT 4.0 SP6a

set DATE GERMAN
set POINT to ","
set SEPARATOR to "."


P.S. I have the same behaviour in VFP 6 SP5
Regards from Berlin

Frank

Dietrich Datentechnik (Berlin)
Softwarekombinat Teltow (Teltow)

Frank.Dietrich@dd-tech.de
DFPUG # 327
Next
Reply
Map
View

Click here to load this message in the networking platform