VB.NET - function in VB.net
Asked By san san
11-Sep-08 07: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
see this
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.
solution
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
That is the return result not the declaration
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.

member > < member > < name > field_list< / name > < value > < array > < data > < value > < struct > < member > < name > name< / name > < value > < string > id< / string > < / value > < / member > < member > < name > type< / name > < value > < string > id< / string > < / value > < / member > < member > < name > label< / name > < value > < string > ID< / string > < / value > < / member > < member > < name > required< / name > < value > < int > 1< / int > < / value > < / member > < member > < name > options value > < array > < data / > < / array > < / value > < / member > < / struct > < / value > < value > < struct > < member > < name > name< / name > < value > < string > name< / string > < / value > < / member > < member > < name > type< / name > < value > < string > name< / string > < / value > < / member > < member > < name > label
Difference between vb and vb.net Hai, I want to know about the main difference between vb and vb.net. • The greatest change in VB6 and VB.NET is of runtime environment. VB6 used the VB-Runtime while VB.NET uses the .Net
types? (B) What is concept of Boxing and Unboxing ? (B) What is the difference between VB.NET and C#? (I) what is the difference between System exceptions and Application exceptions? (I)What Hidden frames? (I) What are benefits and limitations of using Cookies? (I) What is Query String and What are benefits and limitations of using Query Strings? (I) What is Absolute and are different properties provided by Object-oriented systems? (B) How can we achieve inheritance in VB.NET? (I) what are abstract classes? (B) What is a Interface? (A) What is difference between prevent a class from overriding? (I) what is the use of “Must inherit” keyword in VB.NET? (I) Do interface have accessibility modifier. (A) What are similarities between Class and structure? (A between Class and structure’s? (B) What does virtual keyword mean? (B) What are shared (VB.NET) / Static(C#) variables? (B) What is Dispose method in .NET? (B) What is the
Differences for vb.net and c# with Example Dear all Differences for vb.net and c# with Example., plz give the solutions Thanks to all Hi See the bellow comparission :: This comparission is with syntax and example. . . Comments VB.NET 'Single line only Rem Single line only C# / / Single line / * Multiple line * / / / / XML comments on single line / * * XML comments on multiple lines * / Program Structure VB.NET Imports System Namespace MyNameSpace Class HelloWorld 'Entry point which delegates to C-style main Private