Recursive Procedure

griftou

New Member
Hi everyone,

I have a database with a table named "DossTask".

In my recursive procedure, I write "define buffer bDossTask for Dosstask".

Is Progress going to create a new buffer for each occurence ?

Thanks.
 
Ok, I was asking because I made a "FIND DossTask WHERE ..." in the main block and anotherone in my procedure but that generate errors.
I thought that Progress would create another "DossTask" for the procedure but obviously, it is not.
So, I was wondering if it was with a recursieve procedure.
 
Progress -OpenEdge- will create a buffer (bDossTask) for the origional db - Dosstask.
This is an exact copy of ALL the rows situated in Dosstask. Hence the reason it is called a buffer. Which when realized will perform exactly like the origional to ensure data integrity is realized.
 
Ok, I was asking because I made a "FIND DossTask WHERE ..." in the main block and anotherone in my procedure but that generate errors.

What errors?

I thought that Progress would create another "DossTask" for the procedure but obviously, it is not.

It will if you create a buffer for it like your first post, or

Code:
define buffer DossTask for Dosstask.

Once you have created the buffer, you have to fill it using a find - it is a placeholder for a record, not a copy of an existing record.

It sounds like this is to do with record scoping - it can be confusing, but there is a lot of info out there (manuals, knowledgebase, peg, etc.) if you search on 'scope'.
 
Progress -OpenEdge- will create a buffer (bDossTask) for the origional db - Dosstask.
This is an exact copy of ALL the rows situated in Dosstask. Hence the reason it is called a buffer. Which when realized will perform exactly like the origional to ensure data integrity is realized.

Lord_Icon is a buffer for mpowell.

when realized he will perform exactly like the original.
 
Perhaps you should post a little more of your code. I does seem as if the issue here has more to do with appropriate scoping than whether or not you are using up extra memory.
 
What errors?[/quiote]

In the main block, I do :
Find DossTask where ...
if avail DossTask then
run deadline. /*this is the procedure*/
assign MyVar = DossTask.MyField.

The occurs occurs here, after the procedure and the message is that there isn't any record of DossTask available.

It will if you create a buffer for it like your first post, or

Code:
define buffer DossTask for Dosstask.
I do that now in my procedure.
Once you have created the buffer, you have to fill it using a find - it is a placeholder for a record, not a copy of an existing record.

It sounds like this is to do with record scoping - it can be confusing, but there is a lot of info out there (manuals, knowledgebase, peg, etc.) if you search on 'scope'.

Oh ok, I have to fill the buffer, I didn't know that. I thought it was a copy of the table.

Thanks a lot, I'll try this.

Griftou.

P.S.: For information, I'm using (at work) progress V9 and not OpenEdge.
 
Hi everyone,

I have a database with a table named "DossTask".

In my recursive procedure, I write "define buffer bDossTask for Dosstask".

Is Progress going to create a new buffer for each occurence ?

Thanks.

If you are using an internal procedure the record will be available in all susequent calls in the first buffer you used whether or not you find the record again or define a new buffer. The original record will also be changed if you update it to whatever it was updated to in the last procedure at the end of the recursion.

If you use an external proceudre the record will not be available.

If you want to take advantage of the fact that recursion normally creates a new instance of a variable that can have a different value from the previous intance and still keep the original value in the first instance then you can use temp-tables as parameters and external procedures. You pass in the whole temp-table to the recursive call to the procedure and any changes you make to it will only be in that instance if it is only an input parameter.

It depends on what you are trying to do.
 
Back
Top