M
Maxwell_Smart
Is there a way for a function to refer to itself generically? I'd like
to use such a thing (should it exist) for convenience and consistency,
not functionality.
For example:
Function Common(Some_String as String) As String
...
End Function
Function Go() As String
Dim Some_String = New String
Common(Go)
....
End Function
Function Stop() As String
Dim Some_String = New String
Common(Stop)
....
End Function
In this example, both Go() and Stop() want to call Common() to take
care of some common code. Being Go() an Stop() are instantiated
objects, they pass themselves as the argument. The question is, is
there a way for the code to be the same, something like Common(Me),
where Me is a reference to the function itself. Dimming a new object
(of common name) defeats the purpose, however.
-----
Is there a way of refering to the functions arguments? For example,
this would be what i would want to do:
Sub Reset(Obj As Object, First_Name As String, Last_Name as String,
Address As String)
Dim Counter As Integer
For Counter = 1 to Reset.Arguments.Count -1
Set Obj.Parameters(Reset.Arguments(Counter).Name).Value =
Reset.Arguments(Counter).Name
Next Counter
End Function
B.
to use such a thing (should it exist) for convenience and consistency,
not functionality.
For example:
Function Common(Some_String as String) As String
...
End Function
Function Go() As String
Dim Some_String = New String
Common(Go)
....
End Function
Function Stop() As String
Dim Some_String = New String
Common(Stop)
....
End Function
In this example, both Go() and Stop() want to call Common() to take
care of some common code. Being Go() an Stop() are instantiated
objects, they pass themselves as the argument. The question is, is
there a way for the code to be the same, something like Common(Me),
where Me is a reference to the function itself. Dimming a new object
(of common name) defeats the purpose, however.
-----
Is there a way of refering to the functions arguments? For example,
this would be what i would want to do:
Sub Reset(Obj As Object, First_Name As String, Last_Name as String,
Address As String)
Dim Counter As Integer
For Counter = 1 to Reset.Arguments.Count -1
Set Obj.Parameters(Reset.Arguments(Counter).Name).Value =
Reset.Arguments(Counter).Name
Next Counter
End Function
B.