On 17 Feb 2013 06:13, paul.roy@xxxxxxx wrote:
My today concern is that I am preparing a ILE CL presentation and I
am not sure that I will present this rather complicated sample as a
good representation of what ILE is.
hopefully I have other example using IFS or HTTP API's...
I am still dreaming of future CL enhancement with *FLOAT data
type...

pgm
DCL VAR(&A) TYPE(*FLOAT) LEN(8) value(300)
DCL VAR(&B) TYPE(*FLOAT) LEN(8) VALUE(400)
DCL VAR(&C) TYPE(*FLOAT) LEN(8) value(0)
CALLPRC PRC('hypot') PARM(&A &B) RTNVAL(&C)
endpgm

would it not be simple, nice, easier, more readable ?

Certainly that would be all those things. However at some point the question becomes... Why must the ILE variant of the Control Language need to do everything that the other ILE HLLs can do?

One can just choose to write in another ILE Language to make either a wrapper of the 'hypot' routine or write the code to perform the work of the 'hypot' routine. The system I have used lately, does not even have the C++ routines, so I would not even have the option to call them from _any_ language; creating a wrapper is not even an option. There is little reason an example for educational purposes should have to use FLOAT. Just call a routine to do the Square Root in any language that has that instruction\operator, plus the capability to accept the Packed Decimal as input; the RPG has /native/ handling for Packed Decimal and has a builtin for Square Root.

The following RPG source, for example, could be used to create the module for the procedure 'hypot' [no error handling], to provide the simple, nice, easy, and readable CL invocation to an ILE routine:

0001.00 hnomain
0002.00 d hypot pr 15p05
0003.00 d len1 15p05
0004.00 d len2 15p05
0005.00 p hypot b export
0006.00 d pi 15p05
0007.00 d len1 15p05
0008.00 d len2 15p05
0009.00 d*
0010.00 d rtn15p05 s 15p05
0011.00 /free
0012.00 rtn15p05 = %SQRT( len1 ** 2 + len2 ** 2 ) ;
0013.00 return rtn15p05;
0014.00 /end-free
0015.00 p e


This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].