Go Back  Xtreme Visual Basic Talk > Visual Basic .NET (2002/2003/2005/2008, including Express editions) > .NET General > Function warnings in vb.net 2005


Reply
 
Thread Tools Display Modes
  #1  
Old 03-08-2006, 09:24 PM
gnappi gnappi is offline
Freshman
 
Join Date: Mar 2006
Posts: 33
Default Function warnings in vb.net 2005


I use some functions in a program I designed in VB.net 2003 and now I get errors like Function without an AS clause return of type of object assumed.
or "Function doesn't return a value on all code paths"

Function ResetForm ()

button1.visible = true
textbox1.text = "reset"

end function

Where can I get information on types? Type was optional in 2003 as stated in O'reilley's "Nutshell" book.

Finally the "end function" is underlined with green giving me the last warning
What would a textbox write or button visible return?



Thanks,

Gary
Reply With Quote
  #2  
Old 03-09-2006, 05:18 AM
Iceplug's Avatar
Iceplug Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: California, USA
Posts: 16,583
Default

Unless you are going to return something from a function, you need to declare it as a Sub (Subroutine). You would know for a fact if your function returns something.
A function is typically something like this
Code:
Function DoSomething() [b]As SomeType[/b] Dim Ret As SomeType 'code [B]Return Ret[/B] End Function
The function "Returns" the value of "Ret".
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->