PERSISTENT & SUPER procedure in practice...

Posted by Admin on 31-Jul-2008 06:18

"called.p"

DEF VAR vcStringa AS CHAR INIT "Questa è la stringa di inizializzazione" FORMAT "X(40)" NO-UNDO.

DEF VAR vcFrameStampa AS CHAR NO-UNDO.

DEF VAR vcFrameTitolo AS CHAR NO-UNDO.

DEF VAR i AS INT NO-UNDO.

DO i=0 TO 5

:

vcFrameStampa = SUBSTITUTE ("fStampa&1", i).

vcFrameTitolo = SUBSTITUTE ("Procedura di stampa &1", i).

DEFINE FRAME vcFrameStampa WITH CENTERED TITLE vcFrameTitolo.

DISPLAY vcStringa LABEL "Stampa"

i LABEL "indice"

vcFrameTitolo FORMAT "X(40)"

vcFrameStampa FORMAT "X(40)"

WITH FRAME vcFrameStampa

.

PAUSE.

END.

"calling.p"

DEF VAR h AS HANDLE.

RUN called.p PERSISTENT SET h.

But when i refer with, for example, a "editor buffer" i can't access to these PERSISTENT function:

"editor buffer"

http://img165.imageshack.us/img165/6334/dontno0.jpg

All Replies

Posted by Admin on 31-Jul-2008 06:21

All the time i think that i don't understand nothing about ABL ...

In theory i study that the advantage of a procedure PERSISTENT is the most quickly access at the procedure.

And the difference between PERSISTENT & SUPER is that the PERSISTENT remain in stack memory (RAM?) after the end program. It's true?

Posted by Thomas Mercer-Hursh on 31-Jul-2008 11:02

An SP is also a PP. The difference is that if you create a PP, you have to access the internal procedures in the PP using a handle, but if you make that PP an SP, then you have "extended the name space" and can refer to internal procedures of the PP without using a handle.

If you only have two programs, say a main program and a routine which has various library functions, it is sufficient and straightforward to simply make the second one a PP and include the handle in all RUN statements. If you have multiple interacting programs along with a library, then it can get a little messy because you need to pass along the handle to each of the programs which did not start the PP. But, you can do that too, it is just that the SP is a little more convenient.

An SP really gets handy when it is a session SP since then it can be started by a top level procedure such as a menu and every program everywhere can access it without having to get a handle. This is particularly useful for context information, like current fiscal period or current company, and for manager procedures.

Posted by Tim Kuehn on 01-Aug-2008 14:29

Bob -

have you considered retaining a mentor to help you along with these language questions you've been having?

Posted by Admin on 08-Aug-2008 07:26

Who?

Return to the 3D, i try to create a "virtual" room with 4 guy that come in, talk, and go out:

http://img353.imageshack.us/img353/1627/asd1jf0.png

http://img205.imageshack.us/img205/7523/asd2kj0.png

, but the indipendent procedure that i read at Chap. 13 of handbook there isn't because it loop for the ethernity and the main don't go ahead...

Posted by Admin on 08-Aug-2008 10:53

A side node: Publishing code samples with english comments might make it easier for us to understand the purpose of the sample.

Who?

Progress Italy or Wim van der Ham. Other trainers/consultants from around the globe would not mind travelling to Italy as well

, but the indipendent procedure that i read at Chap.

13 of handbook there isn't because it loop for the

ethernity and the main don't go ahead...

Well before you terminate (delete) all persistent procedures there's a line

DO WILHE (circa = TRUE): END.

That's causing the endless loop. No code inbetween that sets circa to FALSE.

I don't understand from your code, how you'd like the 4 guys be in the room and talk to each other. PUBLISH/SUBSRIBE is a common way of communicating in an event driven fashion between procedures.

Posted by Admin on 28-Aug-2008 09:50

OKOK i understand now.

This thread is closed