Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / December 2004

Tip: Looking for answers? Try searching our database.

return a string from function?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Clarke - 17 Dec 2004 16:31 GMT
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!
Jonathan West - 17 Dec 2004 16:50 GMT
Hi Clarke

Something like this

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

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

> 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!
Clarke - 17 Dec 2004 18:27 GMT
Thanks Jon!

> Hi Clarke
>
[quoted text clipped - 10 lines]
> >
> > Can anyone help me out? Thanks!
Andi Mayer - 17 Dec 2004 16:53 GMT
>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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.