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

If (astrThisOne <> "") Then falls through even if astrThisOne <> ""

I use quickwatch on
(astrThisOne <> "")
and it reports: False

as it should because
astrThisOne reports: ""

Yet
If (astrThisOne <> "") Then
executes the Then clause
I'm going to try checking the length instead but would like to know what's
happening because I've got many such checks

I've got the code at Break in front of me and know what I've said above is
true because I can easily check it.
Thanks
Cal

I've got the code at Break in front of me and know what I've said above is
true because I can easily check it.
Break highlighted" DoThisItemQ = True and the quickwatchs as described
above.
If (astrThisOne <> "") Then
If (sstrLastOne <> astrThisOne) Then DoThisItemQ = True
End If
Nov 20 '05 #1
8 1344
" active" <ac****@REMOVEa-znet.com> schrieb
I use quickwatch on
(astrThisOne <> "")
and it reports: False

as it should because
astrThisOne reports: ""

Yet
If (astrThisOne <> "") Then
executes the Then clause
I'm going to try checking the length instead but would like to know
what's happening because I've got many such checks

I've got the code at Break in front of me and know what I've said
above is true because I can easily check it.
Thanks
Cal

I've got the code at Break in front of me and know what I've said
above is true because I can easily check it.
Break highlighted" DoThisItemQ = True and the quickwatchs as
described above.
If (astrThisOne <> "") Then
If (sstrLastOne <> astrThisOne) Then DoThisItemQ = True
End If


That's only a drawback/bug of the IDE. The command seems to get executed but
it does not. BTW, can easily be checked after also watching DoThisItemQ. You
will see that it stays False (if it was False before).
--
Armin

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

Nov 20 '05 #2
* " active" <ac****@REMOVEa-znet.com> scripsit:
I use quickwatch on
(astrThisOne <> "")
and it reports: False

as it should because
astrThisOne reports: ""

Yet
If (astrThisOne <> "") Then
executes the Then clause
I'm going to try checking the length instead but would like to know what's
happening because I've got many such checks

I've got the code at Break in front of me and know what I've said above is
true because I can easily check it.


That's a "known" bug in the IDE.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
I do watch DoThisItemQ and it changes from False to True
which is why I investageted in the first place.

Thanks for leting me in on something that might be good to know in the
future but I don't think it solves my current problem.

I expected someone to say' you don't can't check for "" that way in VB.NET,
but I now assume it's OK.

I'm guessing that quickwatch showing astrThisOne as "" is the problem.

For one thing it's declared thus: astrThisOne As String

Quickwatch simply shows it as: astrThisOne with a value of: ""

If it is an object shouldn't quickwatch show all the members?

It get set by:
astrThisOne = Trim(CagListViews1.SelectedItem(alngColumn, alngItem))
which uses results in:

Get

Dim llvwX As ListViewItem

llvwX = lvwSelected.Items(alngIndex)

If alngColumn = 0 Then

SelectedItem = llvwX.Text

Else

SelectedItem = llvwX.SubItems(alngColumn - 1).Text

End If

End Get

I wonder what get returned fo a subitem that is never set?
I tried Debug.WriteLine(astrThisOne.ToString)
and nothing gets written when it's ""

Any ideas?

Thanks for the reply
Cal

"Armin Zingler" <az*******@freenet.de> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
" active" <ac****@REMOVEa-znet.com> schrieb
I use quickwatch on
(astrThisOne <> "")
and it reports: False

as it should because
astrThisOne reports: ""

Yet
If (astrThisOne <> "") Then
executes the Then clause
I'm going to try checking the length instead but would like to know
what's happening because I've got many such checks

I've got the code at Break in front of me and know what I've said
above is true because I can easily check it.
Thanks
Cal

I've got the code at Break in front of me and know what I've said
above is true because I can easily check it.
Break highlighted" DoThisItemQ = True and the quickwatchs as
described above.
If (astrThisOne <> "") Then
If (sstrLastOne <> astrThisOne) Then DoThisItemQ = True
End If
That's only a drawback/bug of the IDE. The command seems to get executed

but it does not. BTW, can easily be checked after also watching DoThisItemQ. You will see that it stays False (if it was False before).
--
Armin

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

Nov 20 '05 #4
I found something

It get set by:
astrThisOne = Trim(CagListViews1.SelectedItem(alngColumn, alngItem))

which goes to CagListViews1.SelectedItem as follows:

Get

Dim llvwX As ListViewItem

llvwX = lvwSelected.Items(alngIndex)

If alngColumn = 0 Then

SelectedItem = llvwX.Text

Else

SelectedItem = llvwX.SubItems(alngColumn - 1).Text

End If

End Get

I wonder what get returned fo a subitem that is never set?

I tried:

Dim arr() As Char
arr = astrThisOne.ToCharArray(3, 4)
Console.Write("The letters in '{0}' are: '", astrThisOne)
Console.Write(arr)
Console.WriteLine("'")
Console.WriteLine("Each letter in '{0}' is:", astrThisOne)
Dim c As Char
For Each c In arr
Console.WriteLine("/" & Asc(c) & "/")
Console.WriteLine("\" & AscW(c) & "\")
Next c

Produces 4 sets of :
\0\
/0/

Seems that listview returns 4 nulls. I'd quess "" is one null

So what to do? Generate a trim that also removes nulls?
Any other suggestions?

Nov 20 '05 #5
Is there somewhere I can read about it?
thanks
Cal

That's a "known" bug in the IDE.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #6
Bug below. Note the (3, 4) bug below.
Anyway, I get 30 pairs not 4. The original data came from a file with 30
characters for that item so I know where to look.

The problem is that the IDE shows the variable as "" when it actually
contains 30 nulls
Thanks
Cal

" active" <ac****@REMOVEa-znet.com> wrote in message
news:OT**************@TK2MSFTNGP10.phx.gbl...
I found something

It get set by:
astrThisOne = Trim(CagListViews1.SelectedItem(alngColumn, alngItem))

which goes to CagListViews1.SelectedItem as follows:

Get

Dim llvwX As ListViewItem

llvwX = lvwSelected.Items(alngIndex)

If alngColumn = 0 Then

SelectedItem = llvwX.Text

Else

SelectedItem = llvwX.SubItems(alngColumn - 1).Text

End If

End Get

I wonder what get returned fo a subitem that is never set?

I tried:

Dim arr() As Char
arr = astrThisOne.ToCharArray(3, 4)
Console.Write("The letters in '{0}' are: '", astrThisOne)
Console.Write(arr)
Console.WriteLine("'")
Console.WriteLine("Each letter in '{0}' is:", astrThisOne)
Dim c As Char
For Each c In arr
Console.WriteLine("/" & Asc(c) & "/")
Console.WriteLine("\" & AscW(c) & "\")
Next c

Produces 4 sets of :
\0\
/0/

Seems that listview returns 4 nulls. I'd quess "" is one null

So what to do? Generate a trim that also removes nulls?
Any other suggestions?

Nov 20 '05 #7
* " active" <ac****@REMOVEa-znet.com> scripsit:
Is there somewhere I can read about it?


I don't know... But it's "known".

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #8
On Sat, 6 Dec 2003 16:18:48 -0500, active wrote:

The problem is that the IDE shows the variable as "" when it actually
contains 30 nulls


That is the "known" bug. (One of them at least). If a string contains a
null, then in the IDE, it displays incorrectly.

Bad news is that it doesn't appear to be fixed in Whidbey, not yet anyway.

--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
Nov 20 '05 #9

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

Similar topics

22
by: Dr Duck | last post by:
GDay all, Something seems odd to me.... I wrote a simple C# function public void bind(ref object a, ref object b, bool atob) { if(atob) b = a; else
1
by: reddy | last post by:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace...
4
by: Rich | last post by:
Hello, Just checking which is more efficient/better/or correct Do While something str1 = dr(i).ToString If Not str1.Equals("xyz") Then .... or
16
by: network-admin | last post by:
We have Problems with Access query on Oracle 10g Database with ODBC Connection. The Query_1 is such as select * from xtable where ycolumn <"S" Result = ODBC Faild...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.