Re: Calling functions dynamically



<hardieca@xxxxxxxxxxx> skrev i melding
news:1143825702.583974.83070@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Thanks for that! But I'm surprised there is a way to invoke a method
via a string but there is no way to check for its existence
beforehand...


You do something like this...:
Sub yourSub()

...

On Error Goto NotExist:
result = myObj.maybeMethod(...)

' continues here if method existed...
...


ContinuePoint:
' The rest of the code that don't use the method
...

Exit Sub

NotExist:
Resume ContinuePoint:

End Sub

--
Dag.


.



Relevant Pages

  • Project Error
    ... Private Declare Sub Sleep Lib "Kernel32" ... Dim strDataSrc As String ...
    (microsoft.public.vb.bugs)
  • Re: FTP CD command
    ... My code connects to a ftp site and the enumerates all content on that place ... Public Property UriAs String ... End Sub ... Dim listRequest As FtpWebRequest = CType, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: FTP CD command
    ... Private _Uri As String ... End Sub ... Dim listRequest As FtpWebRequest = CType, ... Public Sub UploadAsynch(ByVal fileName As String, ByVal uploadUrl As ...
    (microsoft.public.dotnet.languages.vb)
  • Re: FTP CD command
    ... i remember to have seen a socket level FTP ... Private _Uri As String ... End Sub ... Dim listRequest As FtpWebRequest = CType, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: FTP CD command
    ... Private _Uri As String ... Public Sub New(ByVal Uri As String, ... Dim listRequest As FtpWebRequest = CType, ... Public Sub UploadAsynch(ByVal fileName As String, ByVal uploadUrl As ...
    (microsoft.public.dotnet.languages.vb)