Re: Functions using variables values
Posted in 1997
ADALBERTO ALTAMIRANO wrote: > > Hi everybody!! > > My question is in regard to the use of functions, specially in running any > function by using variables values; for example : > > FUNCTION name_function() > LET var_name = "action" > CALL var_name > > Well, that's the main idea. > Does anybody have any algorithm to this situation or another idea > to find out my problem ? > Can't do it within 4GL. Its a simple problem. It has been about 10 years since I have taken a language theory or compiler theory course so lets see if I can explain it.... 4GL is a compiled time bound language. (Pcode or C code). So, you have to know the function you are calling. In C, you could do a void function pointer and do something close to what you want, however the 4GL has to be compiled to C, and the parser doesn't know how to handle this. The variable must have a specific value at compile time. If you want to do dynamic binding, chose another language. Hope this helps. -Mikey. BTW, if this post seems terse, I just got PRK done and I can't see out of my left eye yet. -- #include <std_disclaimer.h> /* Mike Segel (MS385) */ #include <No_Spam.h> #ifdef OFFENDED_BY_CONTENT The author takes no responsibility for this post. Any resemblence to a coherent rational thought is purely coincidence. -The Management. #endif