473,783 Members | 2,577 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Logical On

Cor
Hi group,

A question to the group, would it not be for a lot of the users better when
there was beside "Option strict on" an "Option logical Strict on".

I was automaticaly writting Textbox1.text = 0.tostring. I know what it has
to be, but I did this automaticly.

I find this crazy, it cannot be something else than a string, so the
compiler must have to find this very easy, but for the puritains, than that
option, than they can set it off.

I think that for a lot of VB users this kind of things is more important
than operator overloading or other more C behaviour (I understand a lot of
sophisticated users want it, so I would not say, don't let them make it, but
I think that this "Option logical strict on" would get 90% of the users
while operator overloading maybe 10%).

Just a thougth?

Cor
Nov 20 '05 #1
23 1608
From my perspective what you are saying is that a numeric literal is an
object and therefore has a set of methods etc. These methods should show up
as they do for all other objects in the IDE etc. You are mooting a new
compiler directive to enforce formal casting/conversion as you put it for
the "Puritans" - basically when the compiler directive is present,
conversion of types for all objects is performed explicitly (through methods
like toString()) and not implicitly.

If I have understood this correctly, doesn't the following code snippet
demonstrate this (albeit without an additional compiler directive).

Dim cmp As String = "fred"
If "".CompareTo(cm p)=0 .....

vs.

If cmp.CompareTo(" ")=0 ....
Both string comparisons being logically equivalent but the former drawing
attention to the fact that a String is an object.

But here, the object is a string, not a numeric literal. So, you are wanting
to make things consistent with full IDE support etc for the former (you type
in 0. and up come a set of methods etc) and more stringent compilation when
the compiler directive is present.

If so, what is 0, a Long, Integer, Float etc, and what set of default
methods are available (other than toString()) when methods for a numeric
literal are accessed through dot notation? And, most importantly, wouldn't
they be different depending on the numeric literal type and, if so, how
would the compiler know?

I look forward to reading followup posts in this thread. But yes, I am
convinced what you are proposing, if it could be implemented, would be of
more general use than operator overloading and the like.

Hexathioorthoox alate
"Cor" <no*@non.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Hi group,

A question to the group, would it not be for a lot of the users better when there was beside "Option strict on" an "Option logical Strict on".

I was automaticaly writting Textbox1.text = 0.tostring. I know what it has
to be, but I did this automaticly.

I find this crazy, it cannot be something else than a string, so the
compiler must have to find this very easy, but for the puritains, than that option, than they can set it off.

I think that for a lot of VB users this kind of things is more important
than operator overloading or other more C behaviour (I understand a lot of
sophisticated users want it, so I would not say, don't let them make it, but I think that this "Option logical strict on" would get 90% of the users
while operator overloading maybe 10%).

Just a thougth?

Cor


Nov 20 '05 #2
Hiya Hex,

I'm not sure what you're saying, but I think what Cor is saying is that

Option Strict On
Dim S as String
S = 3 'Compiler error

is Option Strict going a bit too far and that
S = 3
should do an implicit conversion (not late-bound) because "what else
<could> it be?".

Is that what you understood and were agreeing with? I couldn't really tell,
I'm afraid.

Regards,
Fergus

--
(Please ignore this - there's a feud going on)
=============== =============== =============== =====
Quote of the day
Herfried:
I don't need/want human interaction.
=============== =============== =============== =====
Nov 20 '05 #3
* "Cor" <no*@non.com> scripsit:
A question to the group, would it not be for a lot of the users better when
there was beside "Option strict on" an "Option logical Strict on".

I was automaticaly writting Textbox1.text = 0.tostring. I know what it has
to be, but I did this automaticly.

I find this crazy, it cannot be something else than a string, so the
compiler must have to find this very easy, but for the puritains, than that
option, than they can set it off.


You would like ro skip the 'ToString()' part with 'Option Strict On'?

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
* "Fergus Cooney" <fi****@post.co m> scripsit:
I'm not sure what you're saying, but I think what Cor is saying is that

Option Strict On
Dim S as String
S = 3 'Compiler error

is Option Strict going a bit too far and that
S = 3
should do an implicit conversion (not late-bound) because "what else
<could> it be?".


The next time somebody wants to assign an object of type 'Bla'. Should
the implicit conversion call its 'ToString' method too? Yes -- there is
only one way to assign an object to a string: get its string
representation.

IMO that doesn't make sense because it will cause a lot of ambiguity.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
* "hexathioorthoo xalate" <ru***@REMOVESP AM.clara.co.uk> scripsit:
From my perspective what you are saying is that a numeric literal is an
object and therefore has a set of methods etc. These methods should show up
as they do for all other objects in the IDE etc. You are mooting a new
compiler directive to enforce formal casting/conversion as you put it for
the "Puritans" - basically when the compiler directive is present,
conversion of types for all objects is performed explicitly (through methods
like toString()) and not implicitly.

If I have understood this correctly, doesn't the following code snippet
demonstrate this (albeit without an additional compiler directive).

Dim cmp As String = "fred"
If "".CompareTo(cm p)=0 .....

vs.

If cmp.CompareTo(" ")=0 ....
I think Cor would prefer something like:

\\\
If 8.CompareTo("8" ) = 0 Then...
///
If so, what is 0, a Long, Integer, Float etc, and what set of default
methods are available (other than toString()) when methods for a numeric
literal are accessed through dot notation? And, most importantly, wouldn't
they be different depending on the numeric literal type and, if so, how
would the compiler know?


AFAIU Cor would first call the 'ToString' method implicitly (at compile
time) and then call the method of the string object.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #6
Cor
Herfried,

An IDE or compiler or whatever name you give must have use some
intelligence.
It is a tool for a programmer, not other than Word is a tool for someone who
writes a letter.

dim a as string = 0 can only be a one position string with the unicode 0.

But I find that Option Strict On has a lot of good things when it is not so
predictable.

Therefore I think an Option Logical Strict On, that does an implicit
conversion (not late-bound) because "what else <could> it be?" (as Fergus
said it) would be a greath benefit for the VB.net language.

Cor
Nov 20 '05 #7
* "Cor" <no*@non.com> scripsit:
An IDE or compiler or whatever name you give must have use some
intelligence.
ACK. But the actions must be forseeable to the programmer. There must
not be any ambiguities.
It is a tool for a programmer, not other than Word is a tool for someone who
writes a letter.
100% ACK.
dim a as string = 0 can only be a one position string with the unicode 0.
Would you expect a 'NullChar' or the string containing "0"?
Therefore I think an Option Logical Strict On, that does an implicit
conversion (not late-bound) because "what else <could> it be?" (as Fergus
said it) would be a greath benefit for the VB.net language.


I think it won't be a benefit, but that's my personal opinion.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #8
Cor
Hi Herfried,
Would you expect a 'NullChar' or the string containing "0"?


No never, I would impliciet writing for that

dim a as string = nothing 'why else exist that

and I thougth a "0" is a unicode 0, if I am wrong, than is that beside this
discussion.

But this are just examples of course.

And I thought that afterwards, when the IDE does it and not the compiler,
it can even be automicly when you leave the row. And then:
dim a as string = 0 becomes automaticly dim a as string = "0"

When you then want to change it why not.
For me it is something the same as setting the cases automaticly.

Cor
Nov 20 '05 #9
* "Cor" <no*@non.com> scripsit:
Would you expect a 'NullChar' or the string containing "0"?
No never, I would impliciet writing for that

dim a as string = nothing 'why else exist that

and I thougth a "0" is a unicode 0, if I am wrong, than is that beside this
discussion.


You implicitly want to call the 'ToString' method. But here is one
"problem":

Let's write this:

\\\
Dim s As String = 22.4
///

On a German language system 'ToString()' will return "22,4", on an
English language system "22.4". This would occur if the conversion is
done at runtime, but which conversion should be done at compile time?
And I thought that afterwards, when the IDE does it and not the compiler,
it can even be automicly when you leave the row. And then:
dim a as string = 0 becomes automaticly dim a as string = "0"


Ah... you only want an "improvemen t" of the IDE?

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #10

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

Similar topics

6
44112
by: Hari Om | last post by:
Here are the details of my error log files: I execute the command and get following message at console: ---------------------------------------------------------------------- ../sqlldr scott/tiger@common control=/full_path/test.ctl log=/full_path/adhoc/test.log SQL*Loader: Release 9.2.0.1.0 - Production on Tue Sep 2 10:49:27 2003 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
7
2903
by: Charles Crume | last post by:
Hello all; I have used dBASE, and other computer languages/databases, for years. They all have a logical field type. However, the version of MySQL used by the ISP hosting my site does not support a "logical" field type. It does support ENUM and I have set some up in a couple of tables that accept the values 'T' and 'F'. Sometimes they work like a logical field: if ($myrow) echo 'New';
80
35133
by: Christopher Benson-Manica | last post by:
Of course one can get the effect with appropriate use of existing operators, but a ^^ operator would make for nice symmetry (as well as useful to me in something I'm working on). Am I the only one who would find it useful? -- Christopher Benson-Manica | I *should* know what I'm talking about - if I ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
3
1572
by: serge | last post by:
How do I determine which method I should use if I want to optimize the performance of a database. I took Northwind's database to run my example. My query is I want to retrieve the Employees' First and Last Names that sold between $100,000 and $200,000. First let me create a function that takes the EmployeeID
4
3559
by: serge | last post by:
I am running a query in SQL 2000 SP4, Windows 2000 Server that is not being shared with any other users or any sql connections users. The db involves a lot of tables, JOINs, LEFT JOINs, UNIONS etc... Ok it's not a pretty code and my job is to make it better. But for now one thing I would like to understand with your help is why the same SP on the same server and everything the same without me changing anything at all in terms of SQL...
14
36863
by: blueboy | last post by:
Hi, I am planning to automate a nighty restore of a DB on another server can someone point me in the right direction with the SQL script to modify the logical file names to the correct path and not the ones carried over with the DB?? i.e the database is to be renamed on the new server any help much appreciated
2
5545
by: dbtwo | last post by:
Until today I always thought as long as you see a lot of logical reads as compared to physical reads, then you're good. But it looks like it isn't so. But doesn't logical read mean it's being read from memory and no I/O involved? So why is Logical Reads = CPU Consumption ? I ran into an exact scenario last week when our applciation were running something, and each time an application started, the CPU would go from 99% idle to 48% idle. I...
1
1951
by: ags5406 | last post by:
Hi -- I posted this in a Fortran group but thought I'd post here as well. Any help is appreciated. I have a IVF10 DLL that is the calculation engine for a frontend application written in VB.NET 2005. I've noticed that when I pass a Boolean/Logical from VB.NET to IVF10 as part of an argument list, when I try to evaluate it it only
11
4694
by: Dominic Vella | last post by:
I am using MS-Access2000. I can't seem to set the default values for Logical type fields. I start with Dim dbsTmp As Object ' I think it's DAO.Database Set dbsTmp = DBEngine.OpenDatabase(CurrentProject.path & "\data_be.mdb") and then use the following to run my SQL ststement dbsTmp.Execute ----------------------------------------------------- Something like this SQL statement works: "ALTER TABLE tblStudent ADD COLUMN student_number...
7
3561
by: raylopez99 | last post by:
I have a logical drawing space much bigger than the viewport (the screen) and I'd like to center the viewport (the screen) to be at the center of the logical drawing space. After following the excellent transforms specified on Bob Powell's site, I still wonder if there's an easier way of centering it than the following procedure? Here is what I do now (it's awkward but it works): 1) I follow the transforms specified on Bob Powell's...
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10083
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9946
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.