Command: FUNCTION

Purpose: Executes the specified GT.M or Caché function and returns its returnValue. This command allows you to include legacy back-end GT.M or Caché code within your M/Wire-interfaced application.

Both GT.M-style extrinsic functions and Caché class methods can be invoked, provided that:

As a result, you may need to wrapper existing legacy code in order to present it to M/Wire in a suitable function format.

Arguments:

Argument No Description
1 The function or class method reference. If you are invoking a GT.M-style extrinsic function, the $$ prefix is optional. If you are invoking a Caché class method, the ## prefix is optional.

You cannot pass client variables into this argument. The values of any parameters used by the function that you are calling must be set to actual literal or numeric values.

Response

Two-line response

Server Line 1: $[no of bytes in the returnValue]
Server Line 2: returnValue

Examples

GT.M-style extrinsic function:

Client: FUNCTION inetDate^%zewdAPI($h)
Server: $25
Server: Sun, 21 Feb 2010 15:27:13

Caché class method:

Client: FUNCTION class(rob.test).Example("hello")
Server: $5
Server: world