default 'option explicit on' and 'option strict on' 
Author Message
 default 'option explicit on' and 'option strict on'

Hi,

I am an experienced VB5 and VB6 developer, and I am starting to learn
VB.NET.
I have been searching for an option to have option explicit on and option
strict on by default in every new project.  Can you tell me how I can do
this?

Thanks,

Joris Zwaenepoel



Thu, 01 Jul 2004 05:31:19 GMT  
 default 'option explicit on' and 'option strict on'
Joris,
There was a post a while ago (2 or 3 months) that showed how to change the
templates in VS.NET so that is the default.

Unfortunately I cannot find the exact reference right now...

Hope this helps
Jay


Quote:
> Hi,

> I am an experienced VB5 and VB6 developer, and I am starting to learn
> VB.NET.
> I have been searching for an option to have option explicit on and option
> strict on by default in every new project.  Can you tell me how I can do
> this?

> Thanks,

> Joris Zwaenepoel



Thu, 01 Jul 2004 06:30:42 GMT  
 default 'option explicit on' and 'option strict on'
Hi, Joris,

Quote:
> I have been searching for an option to have option explicit on and option
> strict on by default in every new project.  Can you tell me how I can do
> this?

Unfortunately, in the Beta's and RC1, there is no UI option to turn on
Option Explicit and Strict on by default. However, you can manually edit the
default files that VS.NET uses for classes, modules and projects to turn
these things on.

You'll find these files in C:\Program Files\Microsoft Visual Studio
.NET\Vb7\VBWizards\ClassLibrary\Templates\1033 (or a similar location if
your install directory is different than the default or if your language
code isn't 1033). In this directory are directories for all the different
types of objects VS.NET can create.

For all files that end in .vb, you can add

Option Explicit On
Option Strict On

to the top of the file and they will appear when ever you create an item of
that type (e.g., a class). Files that end in .vbproj are XML files that
define a project. Add 'OptionExplicit = "On" OptionStrict = "On"' (case
sensitive, so be careful) to the VisualStudioProject | VisualBasic | Build |
Settings node as attributes to force these options on (as if you turned them
on in the Project Properties dialog in VS.NET).

Hope this helps,

Ian.



Thu, 01 Jul 2004 09:41:44 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Option Explicit/Option Strict Settings?

2. Question about Option Strict/Option Explicit

3. OPTION EXPLICIT DOESN'T WORK IN SCRIPT CONTROL

4. Option Explicit / Strict ON by default

5. CreateTableDef 'attributes' option

6. Option Groups 'Why No SetFocus'

7. 'keep track of formatting' option

8. 'Create Symbolic Debug Info' option

9. 'Create Symbolic Debug Info' option

10. option explicit or no option explicit?

11. **************!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Help me !!!!!!!!!!!!!!!!!!!!!!!!'''''''''''''''''''''''*************

12. Option Explicit/Strict

 

 
Powered by phpBB® Forum Software