473,322 Members | 1,403 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,322 software developers and data experts.

Option Strict Off/On

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 I do not have the time to fix
everything to set it to ON.

Anyway, my question is if its set to OFF why is it it keeps getting set back
to ON, everytime we move the package from one machine to another. It's the
Option Strict option specific to the project?

So, how can I get the Option Strict option for this project to stay at OFF?

Thanks.
Jan 24 '08 #1
8 3863
Greg wrote:
So, how can I get the Option Strict option for this project to stay
at OFF?
Just type Option Strict Off as the first line of every code file.

That way, it keeps silently nagging you to do something about the faulty
code. :-)

Andrew
Jan 24 '08 #2
Greg wrote:
We have an application in our office that has the Option Strict option set to
off right now.
.. . .
why is it it keeps getting set back to ON, everytime we move the package
from one machine to another. It's the Option Strict option specific to the
project?
There's another one!
There's a "default" for /all/ projects that's set at the IDE level. If
these are the way they're /supposed/ to be (i.e. On), you'll have to
switch it off again, every time.

Quick fix:
Stick the line

Option Strict Off

at the top of each source file. (It also acts as a visual reminder that
you've done this).

HTH,
Phill W.
Jan 24 '08 #3
Which kind of application ? It could be also part of the web.config file if
ASP.NET...

As others suggested my personal preference would be also to let this anyway
be On by default and to set this Off in each source file that really needs
this...

This way you are taking good habits for new code and you can fix the old
code on a file by file basis...

--
Patrice

"Greg" <Ac**********@newsgroups.nospama écrit dans le message de news:
29**********************************@microsoft.com...
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 I do not have the time to
fix
everything to set it to ON.

Anyway, my question is if its set to OFF why is it it keeps getting set
back
to ON, everytime we move the package from one machine to another. It's the
Option Strict option specific to the project?

So, how can I get the Option Strict option for this project to stay at
OFF?

Thanks.

Jan 24 '08 #4
OK, I've got it with regards to setting Option Strict in code for each file.
In fact, I just took the time today to make sure all the code is correct to
all Option Strict ON, which is best anyways.

But, what my question was though, if I set the Option Strict to OFF in the
Project's My Project tab/screen for a specific project, why would it keep
getting set back to ON, when it was changed for the project to be OFF? I
thought these were project specific settings.

I'm concerned that Visual Studio is changing settings I have already made
without notifying me. If I set Option Strict to OFF in my project, it seems
it should stay that way unless I change it. Or, is the Option Strict / Option
Compare and Option Explicit always changed back to default values regardless
of what I set them to?

This is what my question is, "Why does the Option Strict keep getting set to
ON, when I have specifically set it to OFF for my project?". I'm not having
problems with it now since I have fixed my code, I just want to know why it
keeps getting set back to ON everytime.

Thanks,
Greg

"Patrice" wrote:
Which kind of application ? It could be also part of the web.config file if
ASP.NET...

As others suggested my personal preference would be also to let this anyway
be On by default and to set this Off in each source file that really needs
this...

This way you are taking good habits for new code and you can fix the old
code on a file by file basis...

--
Patrice

"Greg" <Ac**********@newsgroups.nospama écrit dans le message de news:
29**********************************@microsoft.com...
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 I do not have the time to
fix
everything to set it to ON.

Anyway, my question is if its set to OFF why is it it keeps getting set
back
to ON, everytime we move the package from one machine to another. It's the
Option Strict option specific to the project?

So, how can I get the Option Strict option for this project to stay at
OFF?

Thanks.


Jan 24 '08 #5
Greg,

Your options are not project settings, it are your personal settings for
Visual Studio.

Cor

Jan 25 '08 #6
Michael,

You can better ask this to an MVP like Herfried, Bill or Seth (now) they
have contact with the product team, normally Linda does not.

:-)

(Yes I too and I have placed your question there)

:-)

Cor

Jan 25 '08 #7
Greg,

It takes some time and sometimes double casting, however I never had any
need to keep option strict off. (Maybe I come to it once, however sometimes
will casting over casting help a lot

a = DirectCast(A, DirectCast(b,c).d

Cor

Jan 26 '08 #8
Duh, wrong

x = DirectCast(DirecCast(A,B).C),E).F

Cor
Jan 26 '08 #9

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...
11
by: Daylor | last post by:
hi. im using option strict on. im doing in ,from the simple reason ,to be warn when there are implict conversion like string to int ,int to string. BUT. the price ,(now i see ), is very bad....
8
by: Rich | last post by:
Hello, If I leave Option Strict Off I can use the following syntax to read data from a Lotus Notes application (a NotesViewEntry object represents a row of data from a Lotus Notes View - like a...
17
by: David | last post by:
Hi all, I have the following problem: my program works fine, but when I add option strict at the top of the form, the following sub fails with an error that option strict does not allow late...
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...
13
by: C. Moya | last post by:
I fully expected the lack of a way to set Option Strict globally to be fixed in SP1. I can't seem to figure out if it has been fixed or not. It still seems we have to add the declaration at the top...
1
by: Jerad Rose | last post by:
I believe this issue is specific to ASP.NET. Why does VB.NET (2.0) ignore the project-level setting for Option Strict? I have the setting turned on in web.config: <compilation debug="true"...
18
by: Poldie | last post by:
How do I turn it on? I'm using vb 2005 in visual studio 2005 sp1. In my web.config I have: <compilation debug="true" strict="true" /> In my Tools/Options/Projects and solutions/vb defaults...
8
by: Rory Becker | last post by:
A wise man once said: "Never put off until runtime what you can fix at compile time." Actually I think he said it about 10 minutes before I started this post. I am a firm believer, like the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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...
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)...
1
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

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.