473,320 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Strict and Explicit always on?

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
Nov 20 '05 #1
19 1047
Without any project opened. Set option strict to ON and then it will remain
on.

OHM
Klaus Löffelmann wrote:
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

Nov 20 '05 #2
* "Klaus Löffelmann" <fo***********@loeffelmann.de> scripsit:
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".

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
OHM,

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

Klaus
(feeling like No Eyed Man... ;-)
"One Handed Man" <Bo****@Duck.net> schrieb im Newsbeitrag
news:bp**********@titan.btinternet.com...
Without any project opened. Set option strict to ON and then it will remain on.

OHM
Klaus Löffelmann wrote:
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


Nov 20 '05 #4
Cor
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
Nov 20 '05 #5
TOOLS / OPTIONS/ PROJECTS/VB DEFAULTS

OHM
Klaus Löffelmann wrote:
OHM,

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

Klaus
(feeling like No Eyed Man... ;-)
"One Handed Man" <Bo****@Duck.net> schrieb im Newsbeitrag
news:bp**********@titan.btinternet.com...
Without any project opened. Set option strict to ON and then it will
remain on.

OHM
Klaus Löffelmann wrote:
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

Nov 20 '05 #6
* "Cor" <no*@non.com> scripsit:
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".
In the project properties, "General properties" -> "Bild" set "Option
Strict" to "On".


Replace "Bild" with "Build".

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #7
I think he wanted this as a default, not for the specific project.

OHM ( God I wish I could be an MVP )

Herfried K. Wagner [MVP] wrote:
* "Cor" <no*@non.com> scripsit:
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".
In the project properties, "General properties" -> "Bild" set
"Option Strict" to "On".


Replace "Bild" with "Build".

Nov 20 '05 #8
* "One Handed Man" <Bo****@Duck.net> scripsit:
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.

;->

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #9
"Klaus Löffelmann" <fo***********@loeffelmann.de> schrieb

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\1 031\WindowsApplication.vbpr
oj

There must be
<Settings
OutputType = "WinExe"
OptionExplicit = "On"
OptionStrict = "On"

--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #10
"One Handed Man" <Bo****@Duck.net> schrieb
Without any project opened. Set option strict to ON and then it will
remain on.


Project properties are not available with no open project. :-)
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #11
I was referring to 2003 - see my post.

OHM

Armin Zingler wrote:
"Klaus Löffelmann" <fo***********@loeffelmann.de> schrieb

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\1 031\WindowsApplication.vbpr oj

There must be
<Settings
OutputType = "WinExe"
OptionExplicit = "On"
OptionStrict = "On"
>

Nov 20 '05 #12
I didnt realise that the TOOLS/OPTIONS etc was not not available in 2002
Version as Armin pointed out.

Cheers - OHM
Herfried K. Wagner [MVP] wrote:
* "One Handed Man" <Bo****@Duck.net> scripsit:
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.

;->

Nov 20 '05 #13
* "One Handed Man" <Bo****@Duck.net> scripsit:
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...

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #14
* "One Handed Man" <Bo****@Duck.net> scripsit:
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
///

;-)

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #15
Cor
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
Nov 20 '05 #16
* "Cor" <no*@non.com> scripsit:
... 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?


Why? That's possible since VB.NET 2002.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #17
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
Nov 20 '05 #18
* "Cor" <no*@non.com> scripsit:
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 K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #19
Cor
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
Nov 20 '05 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Microsoft News | last post by:
I have a project that was created all with Option Strict OFF. Works great, not a problem with it. But if I turn Option Strict ON then I get a LOT of errors. My question, should I even care...
6
by: Brett | last post by:
I find there is more casting required in C# than VB.NET. If Option Strict/Explicit is turned on, will this basically create the same environment as C# - uppercase, more casting required, must...
4
by: zacks | last post by:
A common programming technique I use in VB is making a collection of structures. But if Option Strict is on (which I would prefer), the .Add that adds the structure to the collection is flagged...
9
by: YYZ | last post by:
After reading many messages in this group, it seems that the preferred setting for this is ON. Okay, I did that in my project (first with ..Net -- long time VB6 developer) and now a bunch of...
15
by: guy | last post by:
when i first started using .net (beta 1) i came across option strict and thought hey this could be really good, and since then have always turned it on, most people here seem to agree that this is...
4
by: John | last post by:
Hi I have a vs 2003 project which I have just imported into vs 2005. Now I am getting the "Option Strict On disallows operands of type Object for operator '='. Use the 'Is' operator to test for...
3
by: jonniethecodeprince | last post by:
Hello everyone. Last Friday I finally found a good compiler for PERL and the "shebang" line I think I need to run. They might not be running on a server but certainly they compiling well on my hard...
8
by: =?Utf-8?B?R3JlZw==?= | last post by:
We have an application in our office that has the Option Strict option set to off right now. I do understand it should be set to ON, but right now, I'm just going to continue with it this way since...
92
by: Erwin Moller | last post by:
Hi group, I encoutered page validation error, but I don't know a way around. The page has the following doctype: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.