The ibec_GetRunDir function returns the path of the currently executing program (IBExpert.exe or IBEScript.exe).
function ibec_GetRunDir : string;
execute IBEBlock returns (CurrDir varchar(100)) as begin CurrDir = ibec_GetCurrentDir(); suspend; end