How do I delete persistent procedure?A persistent procedure is a procedure which stays (ie. 'persists') in memory after it has been initialised, until you explicitly delete it.
DELETE PROCEDURE THIS-PROCEDURE.
hTest = SESSION:FIRST-PROCEDURE.
DO WHILE VALID-HANDLE(hTest):
i = i + 1.
hTest = hTest:NEXT-SIBLING.
END.
RUN test2.w PERSISTENT .
DELETE PROCEDURE THIS-PROCEDURE.
DELETE PROCEDURE THIS-PROCEDURE.
DELETE PROCEDURE THIS-PROCEDURE.
General rule in ABL ... if you create it, you are responsible for deleting it.
I have put
and then doCode:RUN test2.w PERSISTENT . [/quote] I think that's where the problem is... What if you do a [code] DEF VAR myHandle AS HANDLE NO-UNDO. RUN test2.w PERSISTENT SET myHandle.
in the program which called the test2.wCode:IF VALID-HANDLE myHandle THEN DELETE PROCEDURE myHandle.
DEF INPUT PARAM aktion AS CHAR NO-UNDO.
RUN VALUE ( aktion ).
Ok.
But my test2.w is not in the procedure-list after I close it.
Even when test1.w is already running (which runs the test2.w).
The matter is the following:
we have a trigger in a "create menu-item" - statement.
Code:
CREATE MENU-ITEM menu-sub3[i3]
ASSIGN PARENT = menu-sub2[i2]
LABEL = MenueText
TRIGGERS:
ON CHOOSE PERSISTENT RUN ProgStart IN THIS-PROCEDURE (ProgName).
END TRIGGERS.
In ProgStart we call the "ProgName":
If we omit the persistent-parameter in the run-statement, it sometimes happens, that the Menu-Trigger which starts the "ProgStart"-Procedure doesn`t fire.Code:DEF INPUT PARAM aktion AS CHAR NO-UNDO. RUN VALUE ( aktion ).
If we add the persistent-parameter, some procedures stay in memory after they closed.
Yes. At the beginning of the definitions-block.Oh, triggers.
Do you have a "create widget-pool" statement at the beginning of the program?
With:One of the things I think Casper is pointing out to you here, indirectly, is that the other program is not actually run persistently.