GetScriptName Function

Action

Returns the name of the currently executing BDL script with the path and the extension.

Include file

Kernel.bdh

Syntax

GetScriptName( in uOptions : number optional ): string;

Return value

The name of the currently executing BDL script.

Parameter Description
uOptions

(optional)

  • FILENAME_FULL: (default) Returns expanded absolute filename of the script.

  • FILENAME_NOPATH: Returns script filename without path.

  • FILENAME_NOEXTENSION: Returns absolute filename without the BDF extension.

  • FILENAME_SIMPLE: Returns script filename without path and extension.

Example

dclevent
  handler ErrorHandler <EVENT_RAISE_ERROR>
  var
    sTrac   : string;
    sFunc   : string;
    sScript : string;
  begin
    sTrac   := GetTransactionName();
    sFunc   := GetFunctionName();
    sScript := GetScriptName();
    print("error raised in transaction " + sTrac + " in function " + sFunc + " in script " + sScript);
    throw;
  end ErrorHandler;

dclfunc
  function f1
  begin
    //WebPageUrl will raise an error
    WebPageUrl("http://Does.not.exist");
  end f1;

dcltrans
  transaction TRaiseError
  begin
    f1();
  end TRaiseError;

Output

error raised in transaction TRaiseError in function f1 in script c:\tests\ScriptName\ScriptName.bdf