 |

12-30-2002, 03:40 AM
|
|
Regular
|
|
Join Date: Dec 2002
Location: Israel
Posts: 81
|
|
Define
|
Hi,guys.
Just wouder if VB has a Key word "define" like in c,c++.
I know that Vb is a interpetor and c,c++ are compiled prog.
still...
|
|

12-30-2002, 03:48 AM
|
 |
Lost Soul
Super Moderator * Guru *
|
|
Join Date: May 2001
Location: Vorlon
Posts: 18,928
|
|
|
VB is compiled too.
You can use #If, #Else and #End if
You can specify them in the "conditional compilation arguments" in the project properties, it's not exactly the same as in C, but maybe you can use them.
|
|

12-30-2002, 05:15 AM
|
|
Regular
|
|
Join Date: Dec 2002
Location: Israel
Posts: 81
|
|
|
I C...
But can I use the "DEFINE" Staement?
|
|

12-30-2002, 06:09 AM
|
 |
Lost Soul
Super Moderator * Guru *
|
|
Join Date: May 2001
Location: Vorlon
Posts: 18,928
|
|
|

12-30-2002, 06:56 AM
|
 |
Jedi Coder
* Expert *
|
|
Join Date: Aug 2002
Location: Abingdon, MD
Posts: 3,438
|
|
|
You can define constants by using the Const statement, which is part of what #define does.
|
|

12-30-2002, 12:24 PM
|
|
Senior Contributor
Retired Leader * Expert *
|
|
Join Date: Sep 2002
Location: Israel
Posts: 918
|
|
Like this:
Code:
Option Explicit
#Const bDebug = True
Private Sub Something()
#If bDebug Then
' all this code won't get compiled if you set bDebug = False
Debug.Print "Debugging"
#End If
End Sub
You can also set the conditional compilation arguments (bDebug in our case) in the Make tab of Project Properties... instead of using #Const.
|
__________________
Have you tried looking right in front of you (or at least in MSDN)?
|

12-31-2002, 05:39 AM
|
|
Regular
|
|
Join Date: Dec 2002
Location: Israel
Posts: 81
|
|
|
mmm....
Does VB support a method like "DEFINE" in c,c++?
|
|

12-31-2002, 06:25 AM
|
 |
Jedi Coder
* Expert *
|
|
Join Date: Aug 2002
Location: Abingdon, MD
Posts: 3,438
|
|
|
Not exactly like it, no. But there are workarounds as was noted above.
|
|

12-31-2002, 12:43 PM
|
|
Regular
|
|
Join Date: Dec 2002
Location: Israel
Posts: 81
|
|
|
I c...
any way, thanks for your help.
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|