Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Feature or Bug?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00175203
Message ID:
00175245
Views:
32
>I just spent ... um ... a long time debugging a problem and found something I think the compiler should complain about, but it did not. There's a line of code in this app as follows:
>
>lnHour = HOUR(DATETIME())--11
>
>Note the two minus signs (--). I typed this in the command window at 12:45 and it returned 23. The expected value is 1. So, is -- a feature? or is that a bug?
>
>Thanks

Mark,

The hour was 12, your code subtracted -11 from that number which is equivalent to adding 11 to 12 and the answer is 23. It is not a bug in VFP but it is a bug in the code you posted :-).
Previous
Reply
Map
View

Click here to load this message in the networking platform