/*-------------------------------------------------------------------+
|                Copyright (c) 1995, SAS Institute Inc.              |
|                  Unpublished - All Rights Reserved                 |
|                    S A S / C   S A M P L E                         |
|                                                                    |
|       NAME: CXFORTPC                                               |
|   LANGUAGE: C++                                                    |
|    PURPOSE: THIS EXAMPLE DEMONSTRATES A C++ MAIN CALLING A         |
|             FORTRAN ROUTINE, WHICH TAKES A PARAMETER LIST.         |
|             IT CONSISTS OF SAMPLE LIBRARY MEMBERS                  |
|             CXXFORPC, CXXFORPF, AND CXXFORPM.                      |
| MVS -                                                              |
|    COMPILE: USE JCL PROVIDED IN SAMPLE.AUX(CXXFORPM).              |
|       LINK: USE JCL PROVIDED IN SAMPLE.AUX(CXXFORPM).              |
|    EXECUTE: USE JCL PROVIDED IN SAMPLE.AUX(CXXFORPM).              |
| TSO -                                                              |
|    COMPILE: FORTRAN - USE FORTRAN COMPILER.                        |
|             C++ - LCXX  CXXFORPC                                   |
|       LINK: ILCLINK, USING CONTROL CARDS IN SAMPLE.AUX(CXXFORPM).  |
|    EXECUTE: CALL .LOAD(CXXFORPM)                           |
| CMS -                                                              |
|    COMPILE: FORTRAN - USE FORTRAN COMPILER.                        |
|             C++ - LCXX CXXFORPC                                    |
|        LINK: ILCLINK, USING CONTROL CARDS IN SAMPLE.AUX(CXXFORPM). |
|     EXECUTE: CALL CXXFORPM                                         |
| MISC NOTES: THE FOLLOWING LSCL102 MESSAGES CAN BE IGNORED:         |
|    WARNING: CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(IFYVINTE)  |
|    WARNING: CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(VFEE#)     |
|    WARNING: CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(VFES#)     |
|    WARNING: CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(VFEIM#)    |
|    WARNING: CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(FORPGM)    |
+-------------------------------------------------------------------*/
#include 
#include 
#include 
#include 
#include 

main()
{

   __fortran void forpgm();
   void *token;
   char *comment = " Fortran parameter passed...";

   if(!(token = mkfmwk("fortran","")))
     exit(16);

   else
     {
     cout << "before calling forpgm" << endl;
     cout << comment << endl;
     forpgm(comment);
     cout << "after calling forpgm" << endl;
     if (dlfmwk(token))
        exit(8);
     else
        exit(0);
     }

 return 1;
}