Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query without max()
Message
From
23/09/2019 15:22:22
Walter Meester
HoogkarspelNetherlands
 
 
To
23/09/2019 14:55:05
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01670845
Message ID:
01671055
Views:
70
>>>In practice it's equally useless, as you can't do anything with it - no operators work with those values. You can't say "if table1.bitfld1 OR table2.bitfld2" or any such thing - the stored values or variables with such values can't be used in boolean expressions, only in comparisons. Damn, even the 5K basic interpreter on ZX Spectrum, 36 years ago, was able to do "if x and y then".
>>
>>Even with boolean values I've grown into the habit of adding = .T. or = .F. , so to me it does not matter. I could not care less.
>
>So you prefer to write "if a=1 and b=1" as it's much faster, more readable and easier to maintain than "if a and b"? :)

Well, yes and no. I gradually ruled out the use of the exclamation point as not as indeed it is very easy to miss that one. Using the NOT function I never found attractive and VFP never implemented a syntax IF NOT A, I settled IF A = .F. instead. And if you're using .F. I think its defendable to use IF A = .T. as well.

SQL does support NOT but then does not support boolean logic on bit variables, only on certain functions like EXISTS() and IN()

In SQL i've been using the bitwise operators | and &
E.g.:
IF a|b|c = 1 THEN ….
which eliminates the need to use of
IF a = 1 or b=1 or c=1 THEN
All in all, it does not bother me. There are more irritating issues to nag about.

Walter,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform