RE: Code Learning Tools

"John Larimer" <[email protected]>
Newsgroups gmane.comp.systems.as400.code
Message-ID <[email protected]>
Don:

I like to have macros do the formatting for me.  I use the macro below to 
convert MOVEs to EVAL.  This example is fixed format but converting to free 
should be a fairly simple change.

Over time, I've built similar macros for converting Z-ADDs and for other 
RPGIV formatting tasks.

When assigned to a keystroke, I find it much faster than cut and paste.

John


/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
*/
/*                                                                           
*/
/*  MACRO NAME      -  move_to_eval.lx                                       
*/
/*  PROGRAM TITLE -  Convert from move to eval                               
*/
/*  DATE WRITTEN  -  01/30/03                                                
*/
/*  AUTHOR        -  John Larimer                                            
*/
/*  NARRATIVE     -  Reads source file and converts classic opcodes MOVEx    
*/
/*                   to mixed case extended factor 2 opcodes.  Good          
*/
/*                   RPGIV only.                                             
*/
/*  PARMS         -  none                                                    
*/
/*                                                                           
*/
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
*/
/*                                                                           
*/
/*  MODIFIED  LOG #  PGMR  DESCRIPTION                                       
*/
/*  --------  -----  ----  ------------------------------------------------  
*/
/*  01/30/03         JKL   Original Version                                  
*/
/*  -----------------------------------------------------------------------  
*/
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
*/

  extract 'content'     /* get contents of the line */
  text = content        /* move contents into variable named text */
  text = text~translate /* force upper */

  Factor1 = space(substr(text,12,10))
  Factor2 = space(substr(text,36,10))
  Result = space(substr(text,50,10))
  Output = content
  processed = 'Y'      /* default = 'Y' */
  opcode = space(substr(text,26,10))

  select
    when opcode = 'MOVE ' then
    call opmove

    when opcode = 'MOVEL' then
    call opmovel

    when opcode = 'MOVEL(P)' then
    call opmovel

  otherwise
    processed = 'N'
  end /*Select*/



  if processed = 'Y' then do
    'set content' (output)
  end
  next element
exit


/*  ***********************************************************************  
*/
/*  Subroutines                                                              
*/
/*  ***********************************************************************  
*/

opmove: /* Subroutine */
output = overlay('Eval',output,26)
output = overlay(Result ' = ' Factor2, output, 36,40)
return

opmovel: /* Subroutine */
output = overlay('Eval     ',output,26)
output = overlay(Result ' = ' Factor2, output, 36,40)
return



>From: "Don Freeman" <[email protected]>
>Reply-To: CODE/400 Discussion & Support <code400-l-Zwy7GipZuJhWk0Htik3J/[email protected]>
>To: "CODE/400 Discussion & Support" <code400-l-Zwy7GipZuJhWk0Htik3J/[email protected]>
>Subject: RE: Code Learning Tools
>Date: Thu, 14 Aug 2003 10:38:42 -0700
>
>I know that there is one thing that I have to use SEU for but it is pretty 
>minor.  It comes in handy when converting MOVE statements to EVAL 
>statements in Free-Form.  I can cut out a rectangular area in SEU so that I 
>can move it to the other side of the '=' operator, and if there are pages 
>of contiguous MOVE statements (and there frequently are) it's a real time 
>saver.  I can not do this in CODE due to the way the Window's selection 
>works. Other then that I would never go back to SEU except maybe for quick 
>browsing.
>
> > -----Original Message-----
> > From: Buck [mailto:[email protected]]
> > Sent: Thursday, August 14, 2003 10:22 AM
> > To: code400-l-Zwy7GipZuJhWk0Htik3J/[email protected]
> > Subject: Re: Code Learning Tools
> >
> >
> > My only advice is to abandon the SEU mindset.  That is, when
> > using Code,
> > don't try to do the same tasks the same as you would have in
> > SEU.  If you
> > get really stuck trying to do something in Code and
> > absolutely have to do it
> > NOW, try SEU mode.  Options, Key Behaviour, SEU.  At least
> > you won't have to
> > close Code and open SEU...
> >
> > This is a fairly low traffic list, so I think we'll get some
> > leeway when it
> > comes to non-technical postings.  Could you describe one of
> > the things you
> > couldn't get done in Code that you manage with SEU?
> >   --buck
> >
>
>_______________________________________________
>This is the CODE/400 Discussion & Support (CODE400-L) mailing list
>To post a message email: CODE400-L-Zwy7GipZuJhWk0Htik3J/[email protected]
>To subscribe, unsubscribe, or change list options,
>visit: http://lists.midrange.com/mailman/listinfo/code400-l
>or email: CODE400-L-request-Zwy7GipZuJhWk0Htik3J/[email protected]
>Before posting, please take a moment to review the archives
>at http://archive.midrange.com/code400-l.
>
>NOTE: WDSc for iSeries disucssion has it's own mailing list.
>Information can be found at 
>http://lists.midrange.com/cgi-bin/listinfo/wdsc-l
>

_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail

_______________________________________________
This is the CODE/400 Discussion & Support (CODE400-L) mailing list
To post a message email: CODE400-L-Zwy7GipZuJhWk0Htik3J/[email protected]
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/code400-l
or email: CODE400-L-request-Zwy7GipZuJhWk0Htik3J/[email protected]
Before posting, please take a moment to review the archives
at http://archive.midrange.com/code400-l.

NOTE: WDSc for iSeries disucssion has it's own mailing list.
Information can be found at http://lists.midrange.com/cgi-bin/listinfo/wdsc-l
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.