× 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.


  • Subject: Re:re: Random Number generator
  • From: Jon Paris <paris@xxxxxxxxxx>
  • Date: Fri, 19 Dec 1997 15:57:36 -0500

>> "But I have always wondered why RPG, a business oriented program, would have
an opcode
for square root but not an rng." <<

While random number generation is useful, I don't think it's as prevalent in
business apps as square root.  Also, as you may have noted in other posts -
there is no single "correct" way to generate random numbers and even when the
language provides such a function, it may still be necessary to code it
yourself.  As far as I know, we have never received a significant number of
requests for random number generation in the language.

>> "btw, you said "we can create OUR OWN opcodes."  As Tonto said "Where'd you
get 'we' Kemo Sabe?"  I can't yet bind a program, let alone write a C++
program.  It is not a viable choice for me and never will be." <<

C++ doesn't enter into the picture.  You can "create an op-code" from any piece
of RPG code that you care to write, or any pre-existing C function or other
bindable routine that you can write/obtain a prototype for.  What I suspect
John has done is to blend the two - writing an RPG procedure "wrapper" for the
IFS APIs so that he can handle IFS files easily using his own op-codes.  In the
example I gave earlier using the "rand" routine, the only thing you need to
know about binding is to specify *NO to the Default Activation Group parameter
on CTRBNDRPG and QC2LE as the Binding Directory.  That's it!  With luck there
will be an increasing number of vendors offering "libraries" of useful
functions in the future - I've talked to several software vendors who are
making their user exits bindable APIs in future releases.

Even if you can't convert your main apps to RPG IV for some reason, you can
still use this kind of technique (and use RPG IV to do it) to create your own
APIs or to "wrapper" bindable functions like the C library ones.

Jon Paris - AS/400 AD Market Support - paris@ca.ibm.com
Phone: (416) 448-4019   -   Fax: (416) 448-4414
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to "MIDRANGE-L@midrange.com".
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.