1
Hello, normally I program on the web I am venturing into VB.net (by free and spontaneous pressure...) and both in Typescript and Javascript and even in PHP, I have the habit of making a multiple definition of variables. Example:
var a, b, c;
// definição singular de dados
a = '';
b = '';
c = '';
// definição múltipla de dados
a = b = c = '';
I understand that I can not directly compare Javascript with VB.net because JS is not a strongly typed language but, such a definition also works in VB. My problem is that when I have a component that an attribute of it of type string, and I make such a statement, it presents me a boleano value, like this:
Public Class Foo
Public text As String
End Class
Dim a, b, c As New Foo
' definição singular de dados
a.text = ""
b.text = ""
c.text = ""
' definição múltipla de dados
a.text = b.text = c.text = ""
In my opinion (logically speaking) the language should define the c.text
as an empty string, then the b.text
as the value of c.text
and at the end do the same with a.text
, thus, how can I make a multiple set as in the example above, having the same value for the three variables?
got it... well I use it in cases that in 1 action I have to change several components at the same time, ex: 3 inputbox that when a checkbox is marked, it will enable the 3 (ie
inputbox.Enable = true
and if uncheck it already removes the 3.– LeandroLuk
@Leandroluk correct, but, VB.NET does not do this, maybe you need to create methods or auxiliary codes to assign this way, just like this in the question is not really language. Who knows one day, they’ve put so many things they don’t need ... !!! kkkk
– novic