preprocessor directives (the code in them) 
Author Message
 preprocessor directives (the code in them)

#if DEBUG

//dev version of connection
public static string connectionString =
"provider=Microsoft.JET.OLEDB.4.0; " + "data source = C:\\Documents
and Settings\\Master Noah\\My Documents\\Visual Studio
Projects\\VocabPhobia\\lists.mdb";

#else

static string dataPath = Application.ExecutablePath.ToString();
//get rid of the .exe
Regex.Replace(frmMain.dataPath, ".exe", "");
public static string connectionString =
"provider=Microsoft.JET.OLEDB.4.0; " + "data source = " +
frmMain.dataPath + "\\lists.mdb";            

#endif

the annoying errors:

C:\Documents and Settings\Master Noah\My Documents\Visual Studio
Projects\VocabPhobia\frmMain.cs(41): Invalid token '(' in class,
struct, or interface member declaration

C:\Documents and Settings\Master Noah\My Documents\Visual Studio
Projects\VocabPhobia\frmMain.cs(41): Invalid token ',' in class,
struct, or interface member declaration

Somehow it thinks there is no Replace or something even though
intellishow or whatever its called thinks there is. What's up with
this? TIA

NF



Fri, 29 Oct 2004 10:25:03 GMT  
 preprocessor directives (the code in them)
Hi Noah,

Where did you declare the string? It ssems to be caused by the invalid usage of  the "static" keyword.

For more information about "static" keyword, please refer to :

http://msdn.microsoft.com/library/en-us/csref/html/vclrfStaticPG.asp

Regards,

Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

Quote:

>Newsgroups: microsoft.public.dotnet.languages.CSharp
>Subject: preprocessor directives (the code in them)

>X-Newsreader: Forte Free Agent 1.21/32.243
>Lines: 34
>Date: Mon, 13 May 2002 02:25:03 GMT
>NNTP-Posting-Host: 64.185.154.207

>X-Trace: newsread1.prod.itd.earthlink.net 1021256703 64.185.154.207 (Sun, 12 May 2002 19:25:03 PDT)
>NNTP-Posting-Date: Sun, 12 May 2002 19:25:03 PDT
>Organization: EarthLink Inc. -- http://www.EarthLink.net
>Path: cpmsftngxa08!tkmsftngp01!newsfeed00.sul.t-online.de!t-online.de!news-xfer.newsread.com!netaxs.com!newsread.com!feed2.news.rcn.net!rcn!

newsfeed1.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!3ca58cd8!not-for-mail
Quote:
>Xref: cpmsftngxa08 microsoft.public.dotnet.languages.csharp:60178
>X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

>#if DEBUG

>//dev version of connection
>public static string connectionString =
>"provider=Microsoft.JET.OLEDB.4.0; " + "data source = C:\\Documents
>and Settings\\Master Noah\\My Documents\\Visual Studio
>Projects\\VocabPhobia\\lists.mdb";

>#else

>static string dataPath = Application.ExecutablePath.ToString();
>//get rid of the .exe
>Regex.Replace(frmMain.dataPath, ".exe", "");
>public static string connectionString =
>"provider=Microsoft.JET.OLEDB.4.0; " + "data source = " +
>frmMain.dataPath + "\\lists.mdb";            

>#endif

>the annoying errors:

>C:\Documents and Settings\Master Noah\My Documents\Visual Studio
>Projects\VocabPhobia\frmMain.cs(41): Invalid token '(' in class,
>struct, or interface member declaration

>C:\Documents and Settings\Master Noah\My Documents\Visual Studio
>Projects\VocabPhobia\frmMain.cs(41): Invalid token ',' in class,
>struct, or interface member declaration

>Somehow it thinks there is no Replace or something even though
>intellishow or whatever its called thinks there is. What's up with
>this? TIA

>NF



Sat, 30 Oct 2004 13:44:38 GMT  
 preprocessor directives (the code in them)
Thanks man. I figured it out.


Sat, 30 Oct 2004 23:28:17 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. C Macros textually substituting for preprocessor directives.

2. #ident (preprocessor directive)

3. C# preprocessor directives

4. Preprocessor directive to replace with source line number

5. Preprocessor: defining a macro inside a #define directive

6. Is this a standard preprocessor directive?

7. Conditional inclusion of preprocessor directives

8. Able To Use Preprocessor Directives Inside Macros?

9. preprocessor directives across assemblies

10. preprocessor directives' identation

11. Are preprocessor directives with preceding whitespace allowed?

12. #PRAGMA preprocessor directive

 

 
Powered by phpBB® Forum Software