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



This sounds like an easy an easy thing to check for, but here's what is going on:

I'm studying (on my own) RPG IV using Stanley Myers' book, "RPG IV Programming on the AS/400". I'm doing the programming assignments at the end of Chapter 5, and assignment 5-2 wants "Include the control that prevents a divide-by-zero error". As far as I can tell, this hasn't been discussed in the book yet; so I don't want to jump ahead with a solution that isn't what they are really looking for.

This is what the line in question could be something like:

C EVAL GRPFT = NETPRICE / GROSSPRFT

Is there some EVAL option I'm missing for this? Setting indicators is discussed, but for the life of me I don't see anything related to divide by zero.

I did some searching, but I found what I would logically do to check for a zero in the variable before doing the math. That hasn't been covered in this book yet, so I'm guessing there is something else to it.

Thanks,
Clay Carley
Sonic.net/ Sonic Telecom

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.