|
Jim, >It won't return a decimal number, only integers!! The RETURN and EXIT expressions must be a whole number in the range -2**15+1 to 2**15-1, but you probably don't want to use it this way. When the value is other than 0, you end up with a severity 30 escape message (which is where you are reading the whole number). A better idea would be to replace the SAY with PUSH than leave the EXIT or RETURN without an expression. This will write the result to a data queue, where you can extract it programmatically. Note that if you just do PUSH I then the result is trimmed to just the significant digits, including decimal values. If you prefer a fixed format result on the dataq, then do something like PUSH FORMAT(I,16,9) which gives you 16 characters to the left of the decimal and 9 decimal positions (e.g. a 25 digit result field with 9 decimals). You would also need to add the statement NUMERIC DIGITS 25 prior to the INTERPRET statement in order to get more than the default 9 digits of precision. After calling the routine with PUSH, the result will now be on the REXX external data queue. Then you can call QREXQ to read an entry from the queue and return it to your program. This program is documented in chapter 9 of the REXX/400 Reference Manual (or at least it is chapter 9 in the V3R7 softcopy). Doug +--- | 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.