S sureshp Member Oct 11, 2007 #1 can i call a function whose name is stored as a value in another variable. for instance FUNCTION funName RETURNS CHAR(): RETURN "Hai". END FUNCTION. DEV VAR c AS CHAR. c = "funName".
can i call a function whose name is stored as a value in another variable. for instance FUNCTION funName RETURNS CHAR(): RETURN "Hai". END FUNCTION. DEV VAR c AS CHAR. c = "funName".
R RKR Member Oct 11, 2007 #2 sureshp said: can i call a function whose name is stored as a value in another variable. for instance FUNCTION funName RETURNS CHAR(): RETURN "Hai". END FUNCTION. DEV VAR c AS CHAR. c = "funName". Click to expand... Yes it can be done without a problem using the dynamic-function statement. /* sample */ FUNCTION test RETURNS LOGICAL (ilValue AS LOGICAL): RETURN ilvalue = TRUE. END FUNCTION. DEFINE VARIABLE cFunction AS CHARACTER NO-UNDO INITIAL "test". MESSAGE DYNAMIC-FUNCTION(cFunction,FALSE) VIEW-AS ALERT-BOX. MESSAGE DYNAMIC-FUNCTION(cFunction,TRUE) VIEW-AS ALERT-BOX.
sureshp said: can i call a function whose name is stored as a value in another variable. for instance FUNCTION funName RETURNS CHAR(): RETURN "Hai". END FUNCTION. DEV VAR c AS CHAR. c = "funName". Click to expand... Yes it can be done without a problem using the dynamic-function statement. /* sample */ FUNCTION test RETURNS LOGICAL (ilValue AS LOGICAL): RETURN ilvalue = TRUE. END FUNCTION. DEFINE VARIABLE cFunction AS CHARACTER NO-UNDO INITIAL "test". MESSAGE DYNAMIC-FUNCTION(cFunction,FALSE) VIEW-AS ALERT-BOX. MESSAGE DYNAMIC-FUNCTION(cFunction,TRUE) VIEW-AS ALERT-BOX.