Although I haven't tried your example, it should work just fine. Make sure the #DEFINE can be accessed by the code snipped where your SELECT * code exists. Most likely, the error you are getting is because the defines are not found when VFP compiled your select code. If your code is in a .prg, make sure to INCLUDE "mydefines.h" or whatever you called it, at the top of every prg which will need it. Likewise, for SCX & VCX there's a way to specify a header file from the VFP Menu, but I forget at the moment the exact menu choices to make.
At 10:42 PM 9/11/2007, you wrote: >Hi all: > > I'm trying to generalize an application that I've been maintaining for >several years and have hit a bit of a brick wall. I've been trying to set >up a number of #DEFINE values that get loaded by the uppermost object in the >application that are then used throughout the rest of the application. This >approach has worked nicely except for one situation: I can't seem to make it >work when I issue a SELECT statement. > > For example: > > In an included header file: > > #DEFINE TYPE_TOOL_SEQ 998 > #DEFINE TYPE_FEES_SEQ 999 > > Then, later on, in a SELECT statement: > > SELECT * FROM table WHERE rec_seq < TYPE_TOOL_SEQ > > I get a run-time error telling me that the variable TYPE_TOOL_SEQ is not >defined. I thought that, under the covers, the compilation of the >application would convert the code into something like: > > SELECT * FROM table WHERE rec_seq < 998 > > even though it would continue to appear as I typed it above. > > Is there a way to make this work? Or do I need to do something somewhat >less appealing, like put these constants into an INI file or into the >Registry? > > Thanks for any help you can send my way. > > Jon > > > [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

