Resolved Running mf.p more than once in the same procedure (QADSE)

kjakubus

New Member
Hello, did anyone run into the issue of running mf.p more than once in the procedure? It seems mf.p does not actually execute the second occurence of mf.p, only the first one, does anyone have a fix/workaround for that?. I'm running into this issue on QADSE, QADEE seems to actually allow you to run mf.p multiple times and the code works properly.

Sample code:

Code:
OUTPUT TO VALUE(CIM1).
  /* CIM 1 */
OUTPUT CLOSE.

/* First CIM - Works */
INPUT FROM VALUE(CIM1).
OUTPUT TO VALUE(OUT1).
DO ON QUIT, LEAVE:
  RUN mf.p.
END.
INPUT CLOSE.
OUTPUT CLOSE.

/* File is created */
OUTPUT TO VALUE(CIM2).
  /* CIM 2 */
OUTPUT CLOSE.

/* Second CIM - Does not work and does not output anything */
INPUT FROM VALUE(CIM2).
OUTPUT TO VALUE(OUT2).
  RUN mf.p.
INPUT CLOSE.
OUTPUT CLOSE.
 

kjakubus

New Member
Answer after some help from the consultant (thanks krzysztof) and experimenting:
It seems it's not possible to do it using mf.p method, to execute multiple cim's inside one procedure on QADSE you should use mfaicon.r then just RUN your procedures directly, this resolves this issue and allows to execute multiple cim's but comes with some caveats like ICT not working which can be worked around (ugly hack) by executing and undoing mf.p (do not even log in, just immediately F4 to exit loging page) once at the start of your procedure (to remove 5 second timeout you can execute mf1.p instead) but this method might result in bugs in some procedures so please be careful (some procedures undo some global things which were undone inside undo'ed mf1.p call).

If you're using QADEE then it does not affect you and you can use multiple mf.p and you can also use mfaicon.r safely.
 
Last edited:
Top