Link to home
Start Free TrialLog in
Avatar of Mark_FreeSoftware
Mark_FreeSoftwareFlag for Netherlands

asked on

call function by name

what i want is this:

when i type:
Execute "Clear 16777215"



this function should be called:

private sub Clear(lColor as long)
'some code
end sub


how can i do this without having to hard-code it, and without using the ms scriptcontrol ?

Avatar of Jim Horn
Jim Horn
Flag of United States of America image

(Potentially stupid answer)

Call Clear(16777215)
Avatar of Mark_FreeSoftware

ASKER


i am trying to execute a string (notice the quotes " ")
not just to call a sub


when i follow your advice (assuming you "forgot" the quotes)
i should use this sub:

Public Sub Execute(str As String)
   Call str
End Sub

that doesnt work....
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

that is really awesome!
thank you so much!!!!


i have been searching this function for ages!





// when you don't know where to search, the internet is really too big
however when you have a start, it can't be big enough!