Title: | VAX/DEC COBOL |
Notice: | Kit,doc,performance talk info-->DIR/KEY=KIT or DOC or PERF_TALK |
Moderator: | PACKED::BRAFFITT |
Created: | Mon Feb 03 1986 |
Last Modified: | Fri Jun 06 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 3250 |
Total number of notes: | 13077 |
Is it possible in COBOL to call a function (written, say, in C) that returns a double? For example, could you call the following? double test() { return 1234.567; } Or do I have to wrap this in another piece of C which puts the result into an argument which gets passed by reference, e.g.: void wrapper(double *d) { *d = test(); } and then use call "wrapper" using by reference double-result where double-result is COMP-2 ? nick
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
3241.1 | Easy | QUARRY::neth | Craig Neth | Tue May 13 1997 14:05 | 26 |
>Is it possible in COBOL to call a function (written, say, in C) that returns >a double? Sure. granda.zk3.dec.com> cat doub.cob IDENTIFICATION DIVISION. PROGRAM-ID. double. ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01 double-var comp-2. PROCEDURE DIVISION. a. call "test" giving double-var. display "double var = " double-var conversion. granda.zk3.dec.com> cat test.c double test() { return 1234.567; } granda.zk3.dec.com> !cobol granda.zk3.dec.com> cobol doub.cob test.c granda.zk3.dec.com> a.out double var = 1.23456700000000E+003 | |||||
3241.2 | KZIN::HUDSON | That's what I think | Wed May 14 1997 05:57 | 7 | |
re: .1 duh! (strikes himself on forehead) thanks! nick |