Search EggHeadCafe's Job Board
EggHeadCafe Silverlight WPF ASP.NET VB.NET C# Excel SQL Server SharePoint
search
MicrosoftArticlesForumsFAQs
C# .NET
VB.NET
Visual Studio .NET
ADO.NET
Xml / Xslt
VB 6.0
.NET CF
GDI+
LINQ
Deployment
Security
FoxPro
Silverlight / WPF
Entity Framework
RIA Services

WebArticlesForumsFAQs
JavaScript
ASP
ASP.NET
WCF

DatabasesArticlesForumsFAQs
SQL Server
Access
Oracle
MySQL
Other Databases

OfficeArticlesForumsFAQs
Excel
Word
Powerpoint
Outlook
Publisher
Money

Non-MicrosoftArticlesForumsFAQs
NHibernate
Perl
PHP
Ruby
Java
Linux / Unix
Apple
Open Source

Operating SysArticlesForumsFAQs
Windows 7
Windows Server
Windows Vista
Windows XP
Windows Update
MAC
Linux / UNIX

Server PlatformsArticlesForumsFAQs
BizTalk
Site Server
Exhange Server
IIS

Graphic DesignArticlesForumsFAQs
Macromedia Flash
Adobe PhotoShop
Expression Blend
Expression Design
Expression Web

OtherArticlesForumsFAQs
Lounge
Subversion / CVS
Ask Dr. Dotnetsky
Active Directory
Networking
Uninstall Virus
Job Openings
Product Reviews
Search Engines
Resumes

 

  View Other VB.NET Posts   Ask New Question  Ask New Question With Power Editor

function in VB.net
san san posted at Thursday, September 11, 2008 7:41 AM

Hi all
I am new to VB.NET.
In some code somewhere I found that

FunctionReadData = "Successfull"

here FubctionReadData is a method/function.
In C# assigning strings to functions like this is not possible.. But in VB.net it's possible..
What is this..? why we r assigning string to function names?

Thanks

Reply    Reply Using Power Editor
  Rank Winnings Points
November 0 $0.00 0
October 0 $0.00 0
see this
Sujit Patil replied to san san on Thursday, September 11, 2008 7:51 AM


I dont think its possible in VB.net also. I am not sure but i think we cant use function like this.

May be something is going wrong.

Can you paste the code where you found this.

Best Luck!!!!!!!!!!!!!
Sujit.

Reply    Reply Using Power Editor
  Rank Winnings Points
November 27 $0.00 7
October 9 $30.00 102

solution
Raj Cool... replied to san san on Thursday, September 11, 2008 7:53 AM

Hi,

Sometimes it is required based on your logic in the program. The FunctionReadData function must have returns some variable reference that will be used in the program in further steps. If you put the code for FunctionReadData and the some line after FunctionReadData = "Sucessfull" then I can tell you the exact things.

-Paresh

Reply    Reply Using Power Editor
  Rank Winnings Points
November 28 $0.00 6
October 0 $0.00 0

That is the return result not the declaration
Minhajul Shaoun replied to san san on Tuesday, September 23, 2008 5:25 PM

Hello,
I am writing a code so that you can understand. Through this code we will determine whether a number is greater that 5 or not. We will pass number into the function. The function will return "Successfull" if our passed number is greater than 5.

'Code begins here
sub determine()
Dim str as string
str = determineresult(7)
msgbox (str)
end sub

Function determineresult (num1 as integer)
dim returnresult as string
if num1>5 then
returnresult="Successfull"
else
returnresult="Unsuccessfull"
End if
Retrun returnresult
End Function
'Code ends here

So, if the provided number is greater than 5 then the function will return a string value "Successfull". That value is not a function. That is only string variable. But it is rate to return string value from a function. The most common return value is Boolean.
Reply    Reply Using Power Editor
  Rank Winnings Points
November 0 $0.00 0
October 0 $0.00 0