PC Review


Reply
Thread Tools Rate Thread

How to call a function in VB.NET

 
 
Omega Warrior
Guest
Posts: n/a
 
      19th Nov 2005
example:

Public Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

call NameOfTheFunction ' when i do this way i get an error: Argument is
not specified for a parametar?

And the Function is Public!

End Sub







Please help?


 
Reply With Quote
 
 
 
 
Scott M.
Guest
Posts: n/a
 
      19th Nov 2005
What is the function you are calling? Does that function have parameters?
It appears from the message that it does. By the way, you don't use the word
"call" anymore, that was VB 6.0 code.

Public Sub A()
Dim result As Boolean = B("something", 7)
End Sub

Public Function B(x As String, y As Short) As Boolean
...
End Sub



"Omega Warrior" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> example:
>
> Public Sub Form1_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
>
> call NameOfTheFunction ' when i do this way i get an error: Argument is
> not specified for a parametar?
>
> And the Function is Public!
>
> End Sub
>
>
>
>
>
>
>
> Please help?
>
>



 
Reply With Quote
 
pvdg42
Guest
Posts: n/a
 
      19th Nov 2005

"Omega Warrior" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> example:
>
> Public Sub Form1_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
>
> call NameOfTheFunction ' when i do this way i get an error: Argument is
> not specified for a parametar?
>
> And the Function is Public!
>
> End Sub
>

Please post the header of the function you are trying to call. That way, we
can help you with proper syntax. In general, given that VB function
procedures return values, the syntax is:

LocalVariableOfReturnType = NameOfFunctionProcedure(arguments separated by
commas to match the parameter list)


--
Peter [MVP Visual Developer]
Jack of all trades, master of none.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Call javascript function without using any event call cschang Microsoft ADO .NET 3 1st Feb 2005 03:04 AM
Why does a call to a function in a dll take less time if you call it repeatedly? Justin Galzic Microsoft Dot NET Framework 5 23rd Feb 2004 06:09 PM
how do i call a function by using the function name as a string of characters Keith G Hicks Microsoft Access Form Coding 2 11th Feb 2004 05:19 AM
CommandBar function call w/o parens runs function 2-3 times Mark Hammer Microsoft Access Form Coding 0 1st Jan 2004 04:53 AM
How to call a function in a DLL with a function pointer parameter? David Rose Microsoft C# .NET 2 6th Aug 2003 07:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:03 PM.