21. 4GL Statement Glossary : Callproc : Coding ADA Procedures (VMS only) : Create an ADA Procedure
 
Share this page                  
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