View previous topic :: View next topic
|
Author |
Message |
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
My macro can be run in two ways:
From the command line:
Code: |
Command ===> MYMACRO |
From a REXX program:
Code: |
"VIEW DATASET("ds") MACRO(MYMACRO)" |
In the first case, everything work fine,
in the second case I receive message ISRE310:
Code: |
COMMAND IN ERROR . : UP MAX
Initial macro error
The macro command entered is not allowed from an initial macro. |
One way to fix this is to pass a "hidden" parameter in my REXX program:
no parameter: command line, parameter found: initial macro.
Another way would be for the macro to ask "do I run as an initial macro?"
However I haven't found any Edit Macro statement that answers that (IMACRO tells me NONE in both cases)
Did I miss it ? |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1315 Location: Vilnius, Lithuania
|
|
|
|
In what context do you issue the "UP MAX"? Wouldn't it be possible to replace it by a "locate .zf"? |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
The macro adds a few notelines at the top of the file with "LINE_BEFORE .ZF = NOTELINE (MyNote)"
Doing LOCATE .ZF places me on line 1 and the notelines are hidden.
Another way to solve my little problem would be to do UP MAX only if cursor line is not 1.
(funnily, it doesn't help if line 1 is actually the cursor line...) |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1315 Location: Vilnius, Lithuania
|
|
|
|
And what about a "locate 0"? In normal edit it does work, right now I cannot test it from a macro. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
"LOCATE 0" works in both cases.
Thanks Robert! Good thinking! |
|
Back to top |
|
|
|