Re: Most Economical VB Development Compiler
- From: "Schmidt" <sss@xxxxxxxxx>
- Date: Sun, 8 Jan 2006 13:24:43 +0100
"pwrichcreek" <pwrichcreek@xxxxxxxxxxxxxxxxxxxxxxxxx> schrieb im Newsbeitrag
news:B69E9830-FD3A-4060-A2AF-D486F3B5F42F@xxxxxxxxxxxxxxxx
> I've tried the VB5 complier that Schmidt suggested. I got a compiler
> error "duplicate definition" from VB5 on the demo source code ...
I would search for '#Const' SubStrings inside your Code-Modules (or better
inside your VB6-Files directly).
This is, what I've found doing a Google-Search:
On MSDN:
http://msdn.microsoft.com/library/en-us/vbenlr98/html/vamsgduplicatedefn.asp
****************Begin excerpt****************
You can only define a conditional compiler constant to have one value. This
error has the following cause and solution:
You specified two different values for the same conditional compiler
constant, for example:
#Const Mac = 0
#Const Mac = 1
Remove one of the definitions.
****************End excerpt****************
Another one, found on:
http://www.oreilly.com/catalog/vbanut/chapter/booklet.html
****************Begin excerpt****************
- Conditional compiler constants are evaluated by the conditional compiler
#If...Then statement block.
- You can use any arithmetic or logical operator in the expression except
Is.
- You can't use other constants defined with the standard Const statement in
the expression.
- According to the documentation, you can't use intrinsic functions in the
expression; e.g., #Const MY_CONST = Chr(13) is illegal. In most cases, VBA
displays a "Compile error : Variable not found" message if you try this. But
there are numerous exceptions. For example, the use of the Int function in
the following code fragment doesn't produce a compiler error, and in fact,
successfully defines a constant ccDefInt whose value is 3:
#Const ccDefFloat = 3.1417
#Const ccDefInt = Int(ccDefFloat)
- When using #Const, you can't use variables to assign the conditional
constant a value.
- Constants defined with #Const can be used only in conditional code blocks.
- Constants defined with #Const have scope only within the module in which
they are defined; i.e., they are private.
- You can place the #Const directive anywhere within a module.
- You can't use the #Const directive to define the same constant more than
once within a module. Attempting to do so produces a "Compile Error:
Duplicate Definition" error message.
- Interestingly, you can define the same constant both through the VB or VBA
interface (see the second item in the "Programming Tips & Gotchas" section)
and using the #Const directive. In this case, the constant defined through
the interface is visible throughout the application, except in the routine
in which the #Const directive is used, where the private constant is
visible.
- The #Const directive must be the first statement on a line of code. It can
be followed only by a comment. Note that the colon, which combines two
complete sets of statements onto a single line, can't be used on lines that
contain #Const.
****************End excerpt****************
Olaf
.
- References:
- Re: Most Economical VB Development Compiler
- From: pwrichcreek
- Re: Most Economical VB Development Compiler
- Prev by Date: Re: Most Economical VB Development Compiler
- Next by Date: Re: Most Economical VB Development Compiler
- Previous by thread: Re: Most Economical VB Development Compiler
- Next by thread: Re: Eject USB Device Via Application?
- Index(es):
Relevant Pages
|