VB.NET and functions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
Can any one tell me a simple way to make a function that returning structure and returning an array?
and if u please tell me about a web site that interduce lessons in vb.net that cover my points
thanks...
 
river said:
Can any one tell me a simple way to make a function that returning
structure and returning an array?

Just like any other type: Choose any data type you want after the " As "
keyword. Ex.:

function test1() as mystructure

function test2() as Integer() 'returns an integer array

Use the Return statement to return the structure or array.

and if u please tell me about a web
site that interduce lessons in vb.net that cover my points
thanks...

Why not press <F1>? There's everything you need.
 
* "=?Utf-8?B?cml2ZXI=?= said:
Can any one tell me a simple way to make a function that returning structure and returning an array?

\\\
Public Function Foo() As String()
Return New String() {"Foo", "Bar", "Baz"}
End Function

Public Function Goo() As MyStruct
Dim x As New MyStruct
x.Name = "Foo"
x.Age = 2
Return x
End Function
///
and if u please tell me about a web site that interduce lessons in vb.net that cover my points
thanks...

If you have MSDN documentation installed, just press F1 within your IDE.

;-)
 
Back
Top