/*-------------------------------------------------------------------+
| Copyright (c) 1995, SAS Institute Inc. |
| Unpublished - All Rights Reserved |
| S A S / C S A M P L E |
| |
| NAME: CXXPASCC |
| LANGUAGE: C++ |
| PURPOSE: THIS EXAMPLE DEMONSTRATES A C++ MAIN CALLING A |
| PASCAL ROUTINE. |
| IT CONSISTS OF SAMPLE LIBRARY MEMBERS |
| CXXPASCC, CXXPASCP, AND CXXPASCC. |
| MVS - |
| COMPILE: USE JCL PROVIDED IN SAMPLE.AUX(CXXPASCC). |
| LINK: USE JCL PROVIDED IN SAMPLE.AUX(CXXPASCC). |
| EXECUTE: USE JCL PROVIDED IN SAMPLE.AUX(CXXPASCC). |
| TSO - |
| COMPILE: PASCAL - USE PASCAL COMPILER. |
| C++ - LCXXC CXXPASCC |
| LINK: ILCLINK, USING CONTROL CARDS IN SAMPLE.AUX(CXXPASCC). |
| EXECUTE: CALL .LOAD(CXXPASCC) |
| CMS - |
| COMPILE: PASCAL - USE PASCAL COMPILER. |
| C++ - LCXX CXXPASCC |
| LINK: ILCLINK, USING CONTROL CARDS IN SAMPLE.AUX(CXXPASCC). |
| EXECUTE: CALL CXXPASCC |
| MISC NOTES: THE FOLLOWING LSCL102 MESSAGES CAN BE IGNORED: |
| WARNING: CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(AMPXRETC) |
| WARNING: CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(AMPXHALT) |
| WARNING: CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(AMPXSEGE) |
| WARNING: CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(AMPXSTRT) |
| WARNING: CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(AMPXPARM) |
| WARNING: CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(PASCPROC) |
+-------------------------------------------------------------------*/
#include
#include
void __pascal pascproc();
main()
{
void* token;
cout << "Hello, from the C++ program!" << endl;
token = mkfmwk("PASCAL","");
if (!token)
{
cout << "Can't create the Pascal framework" << endl;
return(12);
}
cout << "Calling PASCAL routine!" << endl;
pascproc();
cout << "Returned back from PASCAL!" << endl;
dlfmwk(token);
return(0);
}