× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Okay, but how many of those people who only have access to CL need to know the hypotenuse of something?

Seems to me that function is really only useful for graphics programming -- and if CL is the only language you have access to, you probably aren't doing much graphics.

Are there any of the math functions that would make sense in business programming?

That's why my example focused on dates rather than the math functions -- it just made more sense for business programming, IMHO.


On 2/17/2013 3:35 PM, Bruce Vining wrote:
I personally agree with the view that using the math functions from CL,
though certainly possible, is generally more work than it's worth. But over
the years I have also met quite a few developers who only have CL available
to them. So documenting how to do it in CL, even though I would most likely
call some RPG or C code if doing it myself, is certainly a worthwhile
discussion. Doing it in another ILE language just isn't an option for some
users.

Bruce

On Sun, Feb 17, 2013 at 2:23 PM, Rory Hewitt <rory.hewitt@xxxxxxxxx> wrote:

Paul,

Chuck makes a good point. One huge benefit of ILE is the 'I' bit - *
Integrated*. Using ILE, we can create a single program which includes
multiple modules written in different languages - CL, RPG, COBOL, C... Even
though CL includes lots of new features, I still pretty much use
it only for the same stuff I used it for 10 or 15 years ago - top-level
control processing. Sure, I'll make use of subroutines and some of that
flow-related stuff, but for instance, I've never touched the new
pointer-based variables in CL - why bother, when it's so much easier in
RPG?

Rory


On Sun, Feb 17, 2013 at 12:09 PM, CRPence <CRPbottle@xxxxxxxxx> wrote:

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

--
Regards, Chuck
--
This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L)
mailing list
To post a message email: C400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.




--
Rory Hewitt

http://www.linkedin.com/in/roryhewitt
--
This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L)
mailing list
To post a message email: C400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.






As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2024 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].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.