Coding ADA Procedures (VMS only)
To call an ADA procedure from 4GL, use the following steps:
1. Create the procedure from the operating system as described below.
2. Declare the procedure to ABF as a library procedure.
3. Declare the link options file to ABF in the Defaults window.
4. Access ABF and run the application.
If there are changes to be made to the procedure, you have to compile it at the operating system level using 'ada adaproc', where adaproc is the name of the procedure.
Create an ADA Procedure
To create an ADA procedure
1. At the operating system level, create a file containing the procedure. For example, the following procedure is in a file called adaproc.ada.
with system, lib, text_io;
use text_io;
function adaproc (int_val : in integer;
float_val : in long_float) return integer is
ret_val : integer;
begin
ret_val := int_val;
return ret_val;
end adaproc;
pragma export_function(adaproc);
2. Create and run a command file that creates the library directory, compiles the procedure and stores the object file in the library directory.
For example, the following procedure is named adaproc.
$ acs create library [.adalib]
$ acs set library [.adalib]
$ acs set pragma/long_float=d_float
$ ada adaproc.ada
$ acs export adaproc
3. Create a linkoptions file that points to the object code in the library directory. For example, put the following line in a file called linkfile.opt:
$2$DUA18:[directory_path.ADALIB]adaproc.obj
Last modified date: 01/30/2023