|
-
Jun 20th, 2015, 12:49 PM
#1
Thread Starter
Hyperactive Member
VB6 Equivalent of C #ifdef directives
I want to add codes for debug log using some directives.
What is the VB6 equivalent of C-language's #ifdef directives?
Here is the C code and I want to know VB6 directive.
------
#define DEBUGLOG
#ifdef DEBUGLOG
//Do Something
#endif
------
-
Jun 20th, 2015, 01:04 PM
#2
Hyperactive Member
Re: VB6 Equivalent of C #ifdef directives
VB Code:
#Const Test = True #If Test Then '... #Else '... #End If
Last edited by MikiSoft; Jun 21st, 2015 at 05:15 AM.
Reason: Boonie West corrected me.
-
Jun 20th, 2015, 01:31 PM
#3
Re: VB6 Equivalent of C #ifdef directives
 Originally Posted by MikiSoft
Code:
#Const Test As Boolean = True
The #Const directive doesn't allow the data type clause. 
 Originally Posted by jdy0803
... I want to know VB6 directive.
The VB6 manual discusses them here.
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
Jun 22nd, 2015, 06:50 AM
#4
Re: VB6 Equivalent of C #ifdef directives
I would argue that conditional compilation is great for optional (paid) features that you don't want to include in the shipped executable until someone coughs up the money for them.
Personally, I'd suggest that you should have your debug logging switchable at run-time, not compile-time.
When your customer has one of those really "odd" problems (i.e. one of the the 99.9% of problems; the ones that only happen out there, in The Wild), then shipping them a new executable to install, just to find out what the trouble might be, probably isn't your best option. Having something that they can just "switch on" when required (possibly through a one-time or time-limited passcode) shows them that you are pro-active in sorting out their problems (i.e. you actually thought about all this before shipping the product) and it gets you the diagnostic information that you require more reliably and in a more timely fashion (so you can fix the issue more quickly; another "plus" with customers).
Regards, Phill W.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|