Menu

#186 3.3B3 REPEAT not working in macro

open
nobody
None
5
2010-07-21
2010-07-21
Tony T
No

The REPEAT command does 'nothing' within a REXX macro. No error is returned. I used the following formats:
'repeat 3'
'repeat :10'

Discussion

  • LesK

    LesK - 2010-07-21

    I think you misunderstand what Repeat does. Read the pdf file a little more closely.

     
  • Tony T

    Tony T - 2010-07-21

    I FULLY undestand how it works in xedit and verified that the THE doc indicates it is comparable.

    The 'repeat' command works fine as a command in THE when entered in the command area. But it seems to be ignored when used in a macro. Or, it maybe it is just not be advancing the record pointer correctly when used within a macro. Either way, it fails while the same code on VM works correctly.

     
  • Tony T

    Tony T - 2010-07-21

    example that is not working:
    54 *-* do
    55 *-* 'locate :'pline
    >L> "locate :"
    >V> "21"
    >O> "locate :21"
    56 *-* 'clocate :62'
    >L> "clocate :62"
    57 *-* 'creplace '||who when
    >L> "creplace "
    >V> "TT"
    >O> "creplace TT"
    >V> "072110"
    >O> "creplace TT 072110"
    58 *-* if op > 1
    >V> "3"
    >L> "1"
    >O> "1"
    59 *-* do
    60 *-* 'repeat' op-1
    >L> "repeat"
    >V> "3"
    >L> "1"
    >O> "2"
    >O> "repeat 2"

    yet, the following test macro works:
    op = 9

    'DOWN 20'
    'clocate :20'
    'creplace ddddd'
    if op > 2
    then do
    'repeat' op-1
    'top'
    end

    I am stumped. :-(

     

Log in to post a comment.