ralph
12/5/2011 8:12:00 PM
On Sun, 4 Dec 2011 19:55:01 -0500, "Nobody" <nobody@nobody.com> wrote:
>"BeeJ" <nospam@spamnot.com> wrote in message
>news:jbh1j6$2fd6$1@adenine.netfront.net...
>> Source Review (I use it) finds unused Dims and such.
>>
>> I have used
>>
>> #Const USE_TESTBED = 1
>>
>> #If USE_TESTBED Then
>> Public Function foo() As String
>> ....
>> End Function
>> ...
>> #EndIF
>>
>> but put the USE_TESTBED = 1 in the Conditional compile line.
>>
>> Nice to know about using
>> #Const USE_TESTBED = 1
>>
>> What other syntax is available?
>>
>> e.g. searching Help for #if only finds if. Strange?
>> searching for "conditional near compile" only finds #if #else #endif
>>
>> Seems someone should by now have written the XREF for VB6 (feebee).
>
>Go to Project properties, Make tab, and at the bottom, check "Conditional
>Compilation Arguments". Click the help button for more details. Here they
>would apply to the whole project rather than having to use #Const in each
>module. For more than one argument, use ":". Example:
>
>USE_TESTBED = 1 : DEMO = 1
>
While noted in the documentation it is often over-looked that the
#Const directive is 'private' to the module in which it appears and
will over-ride any 'public' directive, whether through the project
attributes or command line. Thus a module that contains
#Const DEMO = 0
will not compile any conditional blocked with DEMO within the module
regardless of any public directive.
Because of this I often place this bit of fluff at the top of modules
that contain conditional compiles just to remind myself. <g>
' Use Public directive
'#Const DEMO = 0
-ralph