Hi,
I think you slipped into VFP mode :-} There's nothing like this in C#. You should use a constant (preferably in a global class where you can collect them together if you have more than one). FWIW #define in C# is purely a pre-processor directive and is only a symbol. This shows an example of both:
#define SOMETHING
class Program
{
static void Main(string[] args)
{
#if SOMETHING
#endif
string s = Constants.TABLENAME_S;
}
}
public static class Constants
{
public static readonly string TABLENAME_S = @"\\SERVERNAME\VOLUME\FOLDER\maintable.dbf alias maintable shared";
public static readonly int MAX_USERS = 5;
}
But, like Craig, I'd question the wisdom of hard-coding a URI in this fashion.
>I want to put define table references in a .h file and be able to reference them in my program, but it does not seem to work.
>
>example
>
>#DEFINE _TABLENAME_S \\SERVERNAME\VOLUME\FOLDER\maintable.dbf alias maintable shared
>
>when I try to
>use _TABLENAME_S in the program it will not recognize the variable _TABLENAME_S
>
>the program does have the #include hfilename.h in it.
>
>any ideas?