Strict and Explicit always on?

  • Thread starter Thread starter Klaus Löffelmann
  • Start date Start date
K

Klaus Löffelmann

Hi,

simple question, and maybe I'm just too blind finding it, but: is there a
simple way to have Option Explicit and Option Strict switched to on by
default with the IDE, or do I have to create new templates for
VB-Applications?

Thanks,

Klaus
 
Without any project opened. Set option strict to ON and then it will remain
on.

OHM
 
One Handed Man said:
Without any project opened. Set option strict to ON and then it will
remain on.

Project properties are not available with no open project. :-)
 
Klaus Löffelmann said:
simple question, and maybe I'm just too blind finding it, but: is
there a simple way to have Option Explicit and Option Strict
switched to on by default with the IDE, or do I have to create new
templates for VB-Applications?

In VB 2003, you can go to Extras -> Optionen -> Projekte -> VB-Standard:
Option Strict ON

In VB 2002, you can change the template, e.g. in

E:\Programme\Microsoft Visual Studio
..NET\Vb7\VBWizards\WindowsApplication\Templates\1031\WindowsApplication.vbpr
oj

There must be
<Settings
OutputType = "WinExe"
OptionExplicit = "On"
OptionStrict = "On"
 
* "Klaus Löffelmann said:
simple question, and maybe I'm just too blind finding it, but: is there a
simple way to have Option Explicit and Option Strict switched to on by
default with the IDE, or do I have to create new templates for
VB-Applications?

In the project properties, "General properties" -> "Bild" set "Option
Strict" to "On".
 
OHM,

without any project opened, who *do* I actually set this option to on?

Klaus
(feeling like No Eyed Man... ;-)
 
Hi Herfried,

I thought will I write a message, Herfried is giving a message in German,
that is to tickle, and then I saw it was just a typo :-(
In the project properties, "General properties" -> "Bild" set "Option
Strict" to "On".

:-)

Cor
 
TOOLS / OPTIONS/ PROJECTS/VB DEFAULTS

OHM

OHM,

without any project opened, who *do* I actually set this option to on?

Klaus
(feeling like No Eyed Man... ;-)
 
* "Cor said:
I thought will I write a message, Herfried is giving a message in German,
that is to tickle, and then I saw it was just a typo :-(

Ooops... Really ugly typo. In German it's called "Erstellen".

Replace "Bild" with "Build".
 
I think he wanted this as a default, not for the specific project.

OHM ( God I wish I could be an MVP )
 
* "One Handed Man said:
I think he wanted this as a default, not for the specific project.

Mhm... You already gave the answer. I thought he wanted it as default
for all files in the project.

;->
 
I was referring to 2003 - see my post.

OHM

Armin said:
In VB 2003, you can go to Extras -> Optionen -> Projekte ->
VB-Standard: Option Strict ON

In VB 2002, you can change the template, e.g. in

E:\Programme\Microsoft Visual Studio
..NET\Vb7\VBWizards\WindowsApplication\Templates\1031\WindowsApplication.vbpr
oj

There must be
<Settings
OutputType = "WinExe"
OptionExplicit = "On"
OptionStrict = "On"
 
I didnt realise that the TOOLS/OPTIONS etc was not not available in 2002
Version as Armin pointed out.

Cheers - OHM
 
* "One Handed Man said:
I didnt realise that the TOOLS/OPTIONS etc was not not available in 2002
Version as Armin pointed out.

Huh... I didn't remember that too...
 
* "One Handed Man said:
I was referring to 2003 - see my post.

.... and I still prefer these 3 lines on top of every source file:

\\\
Option Explicit On
Option Strict On
Option Compare Binary
///

;-)
 
Hi Herfried,

... and I still prefer these 3 lines on top of every source file:

\\\
Option Explicit On
Option Strict On
Option Compare Binary
///
Maybe that will be in Withbey?

:-)))

Cor
 
Herfried,
Than I do something wrong,

I did everything you and OHM said, but I still have to put it by hand above
my code.
So what do I wrong.

Cor
 
* "Cor said:
Than I do something wrong,

I did everything you and OHM said, but I still have to put it by hand above
my code.
So what do I wrong.

You checked the options in the project's settings?
 
Herfried,

Yes and I cannot write my favorite code on a brand new form

Dim a As Integer = 3 * 2 / 1

So option Strict is on, but not placed above the form.

But it is not that important, has its charm if I forgot it, and today I saw
I did.

:-))

Cor
 
Back
Top