Re: How is this conditional able to execute?
- From: "Brett" <no@xxxxxxxx>
- Date: Sat, 16 Apr 2005 23:02:01 -0400
I only put the values that way to show what they are. I wasn't actually
assigning anything.
This code is in a loop. Most of the time, returndata is the empty string.
networkStream = tcpClient.GetStream()
Dim bytes(tcpClient.ReceiveBufferSize) As Byte
networkStream.Read(bytes, 0,
tcpClient.ReceiveBufferSize)
Dim returndata As String =
Trim(Encoding.UTF8.GetString(bytes))
If returndata.ToString <> "" And returndata.ToString
<> ClientForm.ReturnData Then
ClientForm.ReturnData = returndata
returndata = Nothing
Else
End If
End If
bytes always has a length of 8193. Up until about the 35th element of its
array, the values are non zero. After that they are all zero. Possibly I'm
not seeing something that is kept in bytes when I assign it to returndata?
Although returndata appears to be the empty string, it may have some other
value.
"Stephany Young" <noone@localhost> wrote in message
news:e6sPJevQFHA.576@xxxxxxxxxxxxxxxxxxxxxxx
> Did you forget to include the values?
>
> Your code cannot possiblity work because
>
> returndata.ToString = ""
>
> gives a compile-time error:
>
> error BC30068: Expression is a value and therefore cannot be the target
> of an assignment.
>
> It would pay to show the ACTUAL code including the declarations of and
> assignments to variables returndata and ClientForm.ReturnData.
>
>
> "Brett" <no@xxxxxxxx> wrote in message
> news:%23HIUlxuQFHA.1476@xxxxxxxxxxxxxxxxxxxxxxx
>> The following conditional executes given the values listed. I've listed
>> the values below for each of these variables. How is it that the
>> conditional still executes:
>>
>> If (returndata.ToString <> "") And (returndata.ToString <>
>> ClientForm.ReturnData) Then
>>
>> returndata.ToString = ""
>> ClientForm.ReturnData = Nothing
>>
>> The first test fails and the second passes. The AND should then fail
>> correct?
>>
>> Thanks,
>> Brett
>>
>
>
.
- Follow-Ups:
- Re: How is this conditional able to execute?
- From: Stephany Young
- Re: How is this conditional able to execute?
- References:
- How is this conditional able to execute?
- From: Brett
- Re: How is this conditional able to execute?
- From: Stephany Young
- How is this conditional able to execute?
- Prev by Date: "Too many automatic redirections attempted" exception
- Next by Date: Re: How is this conditional able to execute?
- Previous by thread: Re: How is this conditional able to execute?
- Next by thread: Re: How is this conditional able to execute?
- Index(es):
Relevant Pages
|