|
Bob wrote:
>I've posted a short article on how to use the built-in CharToNum
>procedure that is on all AS/400 systems, rather than trying to use
>the user-written C2N or my CharToNum procedures.
>
>Basically, you use the following prototypes, and bind to QC2LE
>binding directory with BNDDIR(QC2LE)
>The article gives more information and context, but here's the code
>in case you don't need the text:
>Article is posted at: www.rpgiv.com/rpgnews
>
> ** RPG IV Prototypes for C runtime library Math functions.
> ** If NUMVAL is Pkd(7,2), then:
> ** NumVal = atof('1234.56') // result is NumVal=1234.56
> ** NumVal = atoi('1234') // result is NumVal=1234
> D atof PR 8F Extproc('atof')
> D dValue * VALUE Options(*STRING)
> D atoi PR 10i 0 Extproc('atoi')
> D iValue * VALUE Options(*STRING)
Bob: I don't mean to nitpick, but the statement
"NumVal = atof('1234.56')" returns the value 1234.55, not
1234.56.
Cheers! Hans
Hans Boldt, ILE RPG Development, IBM Toronto Lab, boldt@ca.ibm.com
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@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 mailing list archive is Copyright 1997-2025 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.