Difference between revisions of "PROGRAM()"

From Lianjapedia
Jump to: navigation, search
m (1 revision)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Function to return the currently executing program name
 
Function to return the currently executing program name
 
  
 
==Syntax==
 
==Syntax==
 
PROGRAM([<expN>])
 
PROGRAM([<expN>])
 
  
 
==See Also==
 
==See Also==
[[DEBUG]], [[DO]], [[FUNCTION]], [[MESSAGE]], [[PROCEDURE]], [[RESUME]], [[SUSPEND]], [[DOLEVEL()]], [[LINENO()]], [[MESSAGE()]], [[PATH()]], [[PROCLIBS()]], [[PROCLINE()]], [[PROCNAME()]], [[SYS()]], [[SET DEBUG]], [[SET DOHISTORY]], [[SET ECHO]], [[SET HISTORY]]
+
[[DO]], [[FUNCTION]], [[PROCEDURE]], [[DOLEVEL()]], [[LINENO()]], [[PATH()]], [[PROCLIBS()]], [[PROCLINE()]], [[PROCNAME()]], [[SYS()]]
 
+
  
 
==Description==
 
==Description==
Line 16: Line 13:
 
<expN>
 
<expN>
 
Specifying the optional <expN> causes PROGRAM() to return the name of the procedure or program at the <expN> level.  If there is no program or procedure at the specified level, an empty string is returned.  The name of the master or starting program is returned if <expN> is 0 or 1.
 
Specifying the optional <expN> causes PROGRAM() to return the name of the procedure or program at the <expN> level.  If there is no program or procedure at the specified level, an empty string is returned.  The name of the master or starting program is returned if <expN> is 0 or 1.
 
  
 
==Example==
 
==Example==
Line 24: Line 20:
 
</code>
 
</code>
  
 
==Products==
 
Recital, Recital Server
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]

Revision as of 06:24, 10 February 2012

Purpose

Function to return the currently executing program name

Syntax

PROGRAM([<expN>])

See Also

DO, FUNCTION, PROCEDURE, DOLEVEL(), LINENO(), PATH(), PROCLIBS(), PROCLINE(), PROCNAME(), SYS()

Description

The PROGRAM() function returns the name of the currently executing program or procedure. This function is particularly useful when used with the SET KEY TO command or ON ERROR routines. The PROGRAM() function always returns a character string in upper case. If a program is currently being executed, the full path and the file extension, ".PRG" for program or ".DBO" for compiled program, will be returned with the name of the program. If a procedure or user defined function (UDF) is being executed, only the name will be returned.

<expN> Specifying the optional <expN> causes PROGRAM() to return the name of the procedure or program at the <expN> level. If there is no program or procedure at the specified level, an empty string is returned. The name of the master or starting program is returned if <expN> is 0 or 1.

Example

m_program = program()
dialog message "The error occurred in the program; &m_program."