Is it possible to do in VB.NET a statement like this C statement?
Code:if ((x=MyFunction())==0)...
Printable View
Is it possible to do in VB.NET a statement like this C statement?
Code:if ((x=MyFunction())==0)...
not in one line. You could either do this:Quote:
Originally posted by Xmas79
Is it possible to do in VB.NET a statement like this C statement?
Code:if ((x=MyFunction())==0)...
If MyFunction() = 0 then...
or
x = MyFunction()
if x = 0 then
Yes, I supposed it... I was asking because I wanted to put it on loop like this:I solved with:VB Code:
While ((x=myfuct())<>0) 'code here end whileVB Code:
do x=myfunct() 'code here loop while x<>0
Why not:Quote:
Originally posted by Xmas79
Yes, I supposed it... I was asking because I wanted to put it on loop like this:I solved with:VB Code:
While ((x=myfuct())<>0) 'code here end whileVB Code:
do x=myfunct() 'code here loop while x<>0
VB Code:
Do 'code here Loop While MyFunct() <> 0
??
because he probably wants to use x in the loop :)Quote:
Originally posted by The Hobo
Why not:
VB Code:
Do 'code here Loop While MyFunct() <> 0
??
Yes, I want to use x :D
But why...?
but why are you wondering why:rolleyes:Quote:
Originally posted by The Hobo
But why...?