Navigation:  Reference > Functions >

CallProgram()

Print this Topic Previous pageReturn to chapter overviewNext page

 

CALL_PRG(1,2)

 

PURPOSE

This function will execute a routine in a program previously loaded with the LOAD_PRG() function.

 

PARTS

 

1 f/c/eRequired - The program number returned in the LOAD_PRG() function.

 

2 f/c/eRequired - The name of the routine you want to run.

 

RETURN TYPE - L

If the program is found and the routine exists the function will return .T., if not, it will return .F.

 

COMMENTS

This is the way you will call routines in TLLs that have been loaded with the LOAD_PRG() function.  The name of the routine is the label you have placed at the beginning of the routine.  See the EXAMPLE below.

 

EXAMPLE

(* This assumes you have loaded this program that

contains this routine.  Obviously your TLLs would

be different, this is only for an example.  It also

assumes that you have stored the program

number in the field PrgNum, a type R field. *)

 

// A simple TLL routine:

ShowMessage:

msg 'We are in the ShowMessage routine.'

ret

 

 

(* The following would be in a different program *)

 

define x type l

 x = CALL_PRG(PrgNum, 'ShowMessage')

// If you had the correct value in PrgNum

 // x would be .T.

 

SEE ALSO

REMOVE_PRG(), IS_PRG_LOADED(), TLLFC()

 


Page url: http://www.cassoftware.com/tas/manual/callprogram().htm