Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I'm looking for the Syntax of Expressions 2

Status
Not open for further replies.
Aug 18, 2006
8
US
Can anyone point me in the right directiion to an online resource that shows the proper syntax for expressions?

I have a program that has foxpro reports in it and it gives you a place to add expressions to filter the info on the reports. I need to know the proper syntax. AND and OR are not working as expected and just looking for a general help article on building expressions.

thank you
 
The first place you can probably look is Visual FoxPro Help (your application is written in Visual FoxPro, not an older version, right? Even for an older app, though, the general rules for the expressions are the same).

I gather you don't have FoxPro and the Help, so look here:

MSDN Library
Expand "Development Tools and Languages", until you find an appropriate part, or just search using keywords (say, expression Visual FoxPro, because it has information on other Microsoft products, too).

Here is one of the articles from there,
"Visual FoxPro 9.0 Expression Builder Dialog Box":

As for "AND and OR are not working as expected", you can post here an expression that you tried, what you want to get, and possible errors or incorrect results you actually got, and people here can try to set you straight as to what you have done wrong. It could be something small.

Also, keep an eye on the type (numeric, character string, etc.) of the fields/variables you are using, to avoid many possible problems.
 
MitzysMan4Life,

The other thing to keep in mind that expressions in VFP are not very much different from in most other languages. You've got the usual arithmetic operators ( + - / * ), parentheses work as you would expect, as do AND, OR and NOT.

In the Help, there's a useful topic called Basic Programming Concepts that will give you a good start.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Here is the article Mike recommends you:

Thinking of your AND/OR problems (even though I dont't know what exactly you meant), I just wanted to add that if you have a really old application, you might need to delimit your ANDs, ORs, and NOTs by dots, like this: .AND., .OR., .NOT.. I don't remember when it became not necessary, but definitely remember doing that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top