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



About two kinds of macros:

(1)  complicated ones
(2)  simple ones (as:  %Define CARRIAGE-RETURN = X'0D'  /* In Ascii */

The second kind is really just a named constant, right?  I guess we have
the

                DD  CON  NAMED-CONSTANT  CHAR(10)  INIT('ANYTHING');

Definition type for that.

And why is (1) a bad idea?  It seems rather interesting to me (that's
why I wanted to look it up in the System/36 Assembler manual).  I do
have a friend who is a C programmer who doesn't like them either (that
is ,(1) defines)).  It can make the code harder to follow, I suppose.

-----Original Message-----
From: Leif Svalgaard [mailto:leif@leif.org]
Sent: Tuesday, October 22, 2002 3:47 PM
To: mi400@midrange.com
Subject: Re: [MI400] A Blast from the Past

From: Richard Hart <rhart@ATCDG.COM>
> It would be interesting to implement a simple macro
> pre-processor on the MI front-end (CRTMIPGM) that Leif has kindly
> provided.  However, I am not quite that advanced yet!
>

if what you want to do is just a simple macro facility, you don't need
the S/36 manual.
There are two kinds of macros:
1) complicated ones, like
%DEFINE  INCR $1
    ADDN(S)    $1, 1
%END

and used like:  INCR MY-VAR;
to produce
          ADDN(s) MYVAR,1;

2) simple ones, like
%DEFINE NN=128

and used like:
DCL DD MYDATA CHAR(#NN);
to produce
DCL DD MYDATA CHAR(128);

----

1) is usually a bad idea
2) is really useful

------

2) is also easy to make.




_______________________________________________
This is the MI Programming on the AS400 / iSeries (MI400) mailing list
To post a message email: MI400@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/mi400
or email: MI400-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/mi400.



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.