PHP :
if(($a = $toto) == 'test') echo $a;
VB.net
Dim a as string = toto
if a.equals("test") then console.writeline(a)
I like the "one line" code design, so, is it possible to do that in vb.net ?
It would be multi-liners instead like this instead
Dim a As String = "test"
Dim b As String = a
if (b.equals("test")) then console.writeline(b)
Or as Alexander suggested you could use one liner like this (which actually not really one liner in the compiler most likely)
Dim a As String = "test", b As String = a
if (b.equals("test")) then console.writeline(b)
You Can use the following......
I haven't done it but I hope it will help u ..
Option Explicit Off
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If ((ss = "test") = "test") Then MessageBox.Show("hi")
End Sub
End Class
$a) inside the body of if block, and the variable continues to exist after the block ends. vb doesn't. vb also does not allow you to declare variable in the conditional. in vb it is invalid to say:If (Dim a = toto) Then doSomething(). No shortcuts here.