Hi,
Is there an official method other than Eval and a Code Block, or Macro Expansion "&", to call a function name contained in a variable?
So if you have a function defined with 2 parameters like
Function ThisProc( sParameter_01, sParameter_02 )
Local bReturnCode := .F.
If (condition)
bReturnCode := .T.
EndIf
Return bReturnCode
, and you place the function name and array of parameters into variables like this:
sProc := "ThisProc"
aParameters := { sParameter_01, sParameter_02 }
, what is the recommended way to call the function using these 2 variables sProc and aParameters?
Do you have to use Eval() to call a function name contained in a variable?
Moderator: Rathinagiri
-
- Posts: 197
- Joined: Thu Jul 16, 2020 5:42 pm
- DBs Used: DBF
-
- Posts: 197
- Joined: Thu Jul 16, 2020 5:42 pm
- DBs Used: DBF
Re: Do you have to use Eval() to call a function name contained in a variable?
The answer is HB_ExecFromArray.