Re: Replace Variable with value in a statement?

Tech-Archive recommends: Fix windows errors by optimizing your registry



agnus wrote:
> Can I replace a varibale with its value in a statement?
>
> Dim strFunction
> strFunction = "TESTFUNC"
>
> CALL strFunction ==) This one should be on runtime 'CALL TESTFUNC'
>
> Function TESTFUNC ()
> WScript.ECHO "HALLO"
> End Function


Dim strFunction
Set strFunction = GetRef("TESTFUNC")

CALL strFunction

Function TESTFUNC ()
WScript.ECHO "HALLO"
End Function

--
Michael Harris
Microsoft MVP Scripting




.



Relevant Pages

  • Replace Variable with value in a statement?
    ... Can I replace a varibale with its value in a statement? ... Dim strFunction ... Function TESTFUNC ... Prev by Date: ...
    (microsoft.public.scripting.vbscript)
  • Re: Replace Variable with value in a statement?
    ... > agnus wrote: ... >> Can I replace a varibale with its value in a statement? ... >> Dim strFunction ... >> Function TESTFUNC ...
    (microsoft.public.scripting.vbscript)
  • Execute function
    ... Is there a way to execute a function from a text representation of the ... Dim strFunction as String ...
    (microsoft.public.dotnet.languages.vb)