× 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: Passing Parms to an RPG Program
  • From: bmorris@xxxxxxxxxx
  • Date: Thu, 23 Mar 2000 14:43:58 -0500




This is definitely a FAQ, but it sure doesn't have a
FGGA (frequently given good answer).

Why is it better to pass numeric parameters as character
and convert them within the program?  Is it easier to
code '9' or '0000000009' than 9?  Is it easier to parse
'-1.5    ' than code a packed(15,5) parameter to receive
-1.5 directly?

Knowing how to code the hexadecimal representation of a
numeric value is important, but surely not required for
a beginner who just wants to know how to call a program
successfully.

Does anyone actually have production programs that are
called with CALL from the command line?  Aren't programs
called from the command line only for testing?  And for
testing, it's surely easier to temporarily change parameters
to packed(15,5) and copy the values to the "real" parameters,
or possibly write another program to receive the packed(15,5)
and pass them on to the tested program.

Why not just accept the fact that numeric parms are passed
from the command line as packed(15,5) and when a simple
question is asked, give a simple answer: "define the parm
as packed(15,5) and copy it to the program variable".

Certainly don't give an answer that is either incomplete
(e.g. "put quotes around the number") or wrong (e.g. "define
the parameter as zoned").

Barbara Morris


+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-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.