Mystery code

StevenT

New member
Joined
Jun 16, 2004
Messages
2
Programming Experience
1-3
I have been given a webservice to troubleshoot and have come across this line...

BooleanVariable1 = Len(StringVariable1) = 0

It does not cause a problem but I don't know what it is doing...help

Thanks
Steve
 

tlkerns

Member
Joined
Jun 3, 2004
Messages
19
Programming Experience
3-5
Think of it this way:

If Len(StringVariable1) = 0 Then
BooleanVariable1 = True
Else
BooleanVariable1 =False
EndIf

Tony
 

Jonatan

Member
Joined
Jun 8, 2004
Messages
11
Location
Cuba
Programming Experience
3-5
A better approach

I think VB.NET syntax has been laughing at us.
You should replace

BooleanVariable1 = Len(StringVariable1) = 0

with

BooleanVariable1 = (Len(StringVariable1) = 0)

Just works!
 
Top Bottom