return a string from function?

C

Clarke

Hey all,
I would like to return a string from a function in vb. Although this is
incredibly simple in c/c++, I can't find the syntax for it in vb.

Can anyone help me out? Thanks!
 
J

Jonathan West

Hi Clarke

Something like this

Function Foo(inputstring as string) As String
'your code goes here
Foo = "value to be returned"
End Function
 
A

Andi Mayer

Hey all,
I would like to return a string from a function in vb. Although this is
incredibly simple in c/c++, I can't find the syntax for it in vb.

Can anyone help me out? Thanks!

function test(input1 as long, input2 as string) as string

'do your calculation here like:
test=left(input2,input1)



end function
If you expect an answer to a personal mail, add the word "manfred" to the first 10 lines in the message
MW
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top