 |
 |

06-22-2002, 09:50 PM
|
|
Centurion
|
|
Join Date: Apr 2002
Location: Newfoundland
Posts: 123
|
|
Optional Keyword ?
|
Can someone tell me what is wrong here?
I am useing the optional keyword in my args list and since i have inserted them i am getting a Compile Error, it is saying that -->
Procedure declaration does not match description of event or procedure having the same name
Here is the code on form1 -- (this is the one that gets highlighted)
---------------------------------------------------------------------------------
Private Sub Sockets_OpenAdbConnection(intWhichInfo, Optional intIndex As Integer, Optional sUserN As String, Optional sUserP As String, Optional sUfriends As String)
Here is the code on form2
--------------------------------------------------------------------------------
Public Event OpenAdbConnection(ByVal intWhichInfo, ByVal intIndex As Integer, ByVal sUserN As String, ByVal sUserP As String, ByVal sUfriends As String)
*(Different calls to this procedure use different args)
|
__________________
- - Renidragd - -
|

06-22-2002, 10:19 PM
|
 |
Paranoid Coder
Retired Leader
|
|
Join Date: Mar 2001
Location: Canada
Posts: 2,716
|
|
|
You cannot change the arguement list of an event.
|
|

06-22-2002, 10:27 PM
|
|
Centurion
|
|
Join Date: Apr 2002
Location: Newfoundland
Posts: 123
|
|
|
do you mean where i left out the optional keyword in the event?
if so when i had it in there it gave me a Syntax Error
|
__________________
- - Renidragd - -
|

06-23-2002, 09:01 AM
|
|
Centurion
|
|
Join Date: Apr 2002
Location: Newfoundland
Posts: 123
|
|
|
Can anyone tell me if i can use the *Optional Keyword* in an event argument parameter list?
|
__________________
- - Renidragd - -
|

06-23-2002, 09:24 AM
|
 |
ISearchGoogle
Retired Moderator * Expert *
|
|
Join Date: May 2001
Location: england
Posts: 6,321
|
|
|
As orufet stated above, you cannot change objects event parameters. You have to go with the default ones that the object provides. If you change it, VB will complain. If you somehow managed to compile, it would crash.
Delete your sub declaration and select it from the combo boxes at the top of the code window in order to get the correct parameters.
In your own sub or functions, then yes it is perfectly ok to use the Optional keyword.
|
__________________
Chuck Norris ordered a Big Mac at Burger King, and got one.
|

06-23-2002, 09:28 AM
|
 |
Political Coder
Retired Moderator * Guru *
|
|
Join Date: Mar 2001
Location: London, England
Posts: 8,037
|
|
|
No, you cannot use Optional with event subs.
|
|

06-23-2002, 09:33 AM
|
|
Centurion
|
|
Join Date: Apr 2002
Location: Newfoundland
Posts: 123
|
|
|
how can i have an event except different arguments?
|
__________________
- - Renidragd - -
|

06-23-2002, 09:37 AM
|
 |
Political Coder
Retired Moderator * Guru *
|
|
Join Date: Mar 2001
Location: London, England
Posts: 8,037
|
|
|
When have you ever seen events that do?
(except control array vs single control)
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
 |
|