Heya guys,

I have a very small snippet that drives me crazy right now.

int arg1;
int expr1 = arg1 = 16;

That silly online translators giving me the following output

Dim arg1 As Integer
Dim expr1 As Integer = InlineAssignHelper(arg1, 16)

Great but what should i write in the "InlineAssignHelper" function? What should that function return?

what should i write in the "InlineAssignHelper" function?

Nothing. Don't use it.

int arg1;
int expr1 = arg1 = 16;

is a very stupid way to set initial values to variables. It's the same as:

int arg1 = 16;
int expr1 = 16;

and now the code is trivial to translate:

Dim arg1 As Integer = 16
Dim expr1 As Integer = 16

HTH

Knew C#'ers are weird :p
Thank you, couldn't really see any sense in that snippet at all.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.