If you have been struggling with how best to make use of TRIMpl portability, you'll welcome the Remote TRIMpl enhancement to DesignVision functionality, called DVremote.
Now you can access TRIMpl application code (the RPC-- remote procedure call) from any machine on the network. Any programs you created with TRIMpl, including calculations, text manipulation, and access programs, for example, become transparently available to any other TRIMpl "client" on the same network.
Maintaining multiple versions for platform compatibility, moving and updating files are activities of the past. Simply connect through the new driver and call the code. Reuse gets a new meaning for TRIMpl programmers and the systems on which they work.
vtxhost.trm is a complete TRIM runtime. Because the variables are kept in a static variable space, they remain the same for all calls. You can use persistent stored procedure calls and be confident that they will run the same on all platforms with all development languages.
To access your useful TRIMpl applications that do not require screen input and output (reading values from a screen or writing to a screen is not currently available through DVremote), you must include the following new #defines in the trim.h file when you create the executable runtime:
#define db_connect 1 /* connect to data base */
#define db_release 2 /* release database */
#define db_commit 3 /* commit work */
#define db_rollback 4 /* rollback work */
DVremote works like VORTEX drivers in your enterprise. Your client issues a connect, this time to a TRIMpl application on a networked machine and calls the RPC when it needs the stand-alone application's functionality.
The client can issue one of five TRIMpl functions (which are completely documented in the TRIMpl Reference Manual) which are translated to one of six new #defines for the RPC. The RPC performs its tasks and returns requested information to the client. In this process, either the client or the RPC application can use any database on the network for which it has access and authority.
From the client, you can issue five TRIMpl functions. Releasing the database is implicit when a client exits or when it reuses an existing connect ID for a new connection. You can pass up to two parameters (depending on the function) in your call.
connect(0, "net:mypltrim@hawk!/usr2/bin/vtxhost.trm");
The protocol must be "net" since the RPC is on a remote machine. The second element in the connect string is the RPC application name without the . RUN extention. Following the exclamation mark, put the fully-qualified path to the executable.
When you write the TRIMpl stand-alone application, use the #define s according to their purpose. The RPC receives the calls as a series of four parameters.
This function translates into the following four parameters:
parm[1] -- A command string that must begin with SELECT.
parm[2] -- This (optional) parameter contains a list of parameters.
parm[3] -- If the function doesn't return an error, the RPC returns a list to the client. The list must have at least one row.
parm[2] -- This (optional) parameter contains a list (which could be multi-row) of parameters passed from the client's e xec_sql() call.
parm[3] -- If the function doesn't return an error, the RPC returns an integer. You control the integer's meaning in the RPC.
parm[1] -- An integer that indicates if a write transaction should follow a commit/rollback.