Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Representing Empty Time in Code
Message
From
07/05/1998 12:40:52
 
 
To
07/05/1998 11:47:22
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00097715
Message ID:
00097742
Views:
20
>Is there an "official" correct way to represent am empty time data type in code? For dates, {} or {//} seem accepted (and work).
>
>I started out with:
>
>{:}
>
>because TYPE( "{:}") returned "T", but I was somewhat horrified to learn that VFP5 considered EMPTY({:}) to be FALSE! The following all return TRUE (at least for now). Any idea what the right one is?
>
>{//:}
>{//::}
>
>-- Randy
Unlike a date value where there is no real world equivalent to the concept of 00/00/0000, there is a real world equivalent to a time value of 00:00:00, that is the stroke of midnight. That's why {//} gives you an empty date epression but {::} give you a non-empty time expression. {::} is the equivalent of midnight for the time component.
After doing some checking it appears that what I just wrote is true for direct assignment of a blank value to a datetime type variable but not for fields.
I created a cursor with a single datetime field and put the value {::} into that field. In fact that field returns true to ?empty(name of field). When a assigned the value of that field to a new variable, that variable showed up as empty too. So one way to do what you're trying to do is to create a cursor with a datetime field, assign it the value {::} and assign that field value to a variable. You end up with a datetime type variable that is empty.
-Dore
Previous
Reply
Map
View

Click here to load this message in the networking platform