>>Hi,
>>
>>I have a function GetGlobal(2) in my application that shows the name of the DATA folder. But some code runs before this function is defined. And in this cases, I need to use the default application folder.
>
>What does you mean by "before this function is defined"? Sounds like a problem that exists only when relying on procedure files. If there's a PRG named GetGlobal() in the project, it's always available.
I can see several scenarios where an out-of-project code may come into play - dynamically loaded libraries, scripts coming from various tables etc. So some checking whether some of that code is available or not (perhaps code not generated yet?) may be required. Not so outlandish a requirement, I've seen it done (by myself, at times :).
Okay now re-reading the original post... I think he asked the wrong question. The function will be there because it's in the application. But the value it returns may depend on some initialization (reading config or whatever), so the function may return different results, depending on when it is called, before or after that configuration. If that's the case, checking for function's existence is irrelevant - always .t. - some other check is required.