× 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: An introduction to MI by example II (part B)...
  • From: "Brendan Bispham" <mi400l@xxxxxxxxxxxxxxxxxx>
  • Date: Thu, 18 Nov 1999 20:31:22 -0000
  • Importance: Normal

~ Actually, I'm enjoying just watching the traffic and wondering what some
~ of the lurkers (since I know who all is on the list) must be thinking...:)

Well I'm too busy trying to take it all in (and wondering how I can justify
the time spent).
I have to thank Leif and Phil especially for putting code up and explaining
it.

I liked the idea of the list producing a useful program (re the disk space
utility), even if it can be done in other ways. But I'm not sure what I can
contribute.

I will throw in this suggestion, in the hope it will encourage others to
experiment. It will also need suggestions from those in the know to explain
how this can be improved.

If I want to know how to do a simple MI program, I can do it in RPG. For
instance:

To add two numbers together:

C           *ENTRY    PLIST
C                     PARM           NBR1    30
C                     PARM           NBR2    30
C                     PARM           SUM     50
C           NBR1      ADD  NBR2      SUM
C                     RETRN

Then if you compile with GENOPT(*LIST), you get a 20 page listing of the MI
instructions. Most of them seem to be part of a general template (looking
for INZSR, TOTC, TOTL etc) but there is commenting to identify these.

When I search the listing for NBR1 I get this:

DCL DD NBR1 PKD (03,0) BAS(NBR1.P )
DCL DD NBR2 PKD (03,0) BAS(NBR2.P )
DCL DD SUM PKD (05,0) BAS(SUM.P )
DCL DD .PKDWORK PKD(26,10)

ADDN .PKDWORK,NBR1,NBR2
CPYNV SUM,.PKDWORK
DCL SPCPTR NBR1.P PARM
DCL SPCPTR NBR2.P PARM
DCL SPCPTR SUM.P PARM
 DCL OL *ENTRY
 (NBR1.P ,NBR2.P ,SUM.P ) EXT PARM MIN(0)

This list has taught me about parameters, DCLs, the *ENTRY, etc. so I'm
guessing that I can do this:

DCL DD NBR1 PKD (03,0) BAS(NBR1.P );
DCL DD NBR2 PKD (03,0) BAS(NBR2.P );
DCL DD SUM PKD (05,0) BAS(SUM.P );
DCL DD .PKDWORK PKD(26,10);
DCL SPCPTR NBR1.P PARM;
DCL SPCPTR NBR2.P PARM;
DCL SPCPTR SUM.P PARM;
DCL OL *ENTRY
(NBR1.P ,NBR2.P ,SUM.P ) EXT PARM MIN(0);

ENTRY * (PARMS) EXT;
ADDN .PKDWORK,NBR1,NBR2;
CPYNV SUM,.PKDWORK;
RTX *;
PEND;

Well this didnt work, so I tweaked everything (the compiler doesnt tell you
why the program wont compile), and ended up with one change that is now
obvious, the ENTRY should be:
ENTRY * (*ENTRY) EXT;

I've run it and it works.

I think that this technique has potential... but a little help is needed. I
shall try something more ambitious, but I shall get in trouble when the
compiler fails - is there a way of determining which line is causing a
problem?

Brendan Bispham

Black and Blue Software Engineering
http://www.black-and-blue.com




+---
| This is the MI Programmers Mailing List!
| To submit a new message, send your mail to MI400@midrange.com.
| To subscribe to this list send email to MI400-SUB@midrange.com.
| To unsubscribe from this list send email to MI400-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: dr2@cssas400.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.