Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42215

VS 2010 VBC_VER compiler constant

$
0
0
I want to use the compiler constant VBC_VER to generate different code for VS 2008 and VS 2010. So, I made a little test:
Code:

#If VBC_VER >= 10.0 Then
        Debug.Print("Greater than or equal to 10.0")
#End If

Under Visual Studio 2010, the enclosed Debug.Print statement is greyed out and does not execute. However from the command prompt I see that:

Code:

C:\Program Files\Microsoft Visual Studio 10.0\VC>vbc
Microsoft (R) Visual Basic Compiler version 10.0.30319.233
Copyright (c) Microsoft Corporation.  All rights reserved.

So, how should I write my #if statement to get the Debug command to compile and execute?

Also, how can I see the value of VBC_VER as it is at compile time?

Viewing all articles
Browse latest Browse all 42215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>