I have some code something like the following:
FOR EACH table NO-LOCK:
FIND FIRST htable
WHERE htable.hval1 = table.val1
AND htable.hval2 = table.val2 NO-LOCK NO-ERROR.
IF AVAILABLE htable THEN
RUN proc1 IN THIS-PROCEDURE.
(more code).
END. /* End for each table */
PROCEDURE proc1:
ASSIGN
var1 = "field name 1"
var2 = STRING(table.field1)
var3 = STRING(htable.hfield1).
RUN proc2 IN THIS-PROCEDURE.
.
. (more of the same)
.
ASSIGN
var1 = "field name n"
var2 = STRING(table.fieldn)
var3 = STRING(htable.hfieldn).
RUN proc2 IN THIS-PROCEDURE.
END PROCEDURE. /* End procedure proc1 */
PROCEDURE proc2:
IF var1 <> var2 THEN
DO:
ASSIGN
p-line[1] = p-line[1] + " " + var1
p-line[2] = p-line[2] + " " + var2
p-line[3] = p-line[3] + " " + var3.
/* The above is simplified - it has various bits of code to ensure that the values in p-line are correctly aligned for printing. */
ASSIGN
changed = true.
END PROCEDURE. /* End procedure proc2 */
When I run the code, I get the following error:
SYSTEM ERROR: -s exceeded. Raising STOP condition and attempting to write stack trace to file 'procore'. Consider increasing -s startup parameter. (5635)
Can anyone tell me why this is and what I can do to prevent it, please?
I don't understand why the stack is "blowing" as I would expect the reference to proc2 to be removed from the stack when the procedure is complete.
:runtear:
FOR EACH table NO-LOCK:
FIND FIRST htable
WHERE htable.hval1 = table.val1
AND htable.hval2 = table.val2 NO-LOCK NO-ERROR.
IF AVAILABLE htable THEN
RUN proc1 IN THIS-PROCEDURE.
(more code).
END. /* End for each table */
PROCEDURE proc1:
ASSIGN
var1 = "field name 1"
var2 = STRING(table.field1)
var3 = STRING(htable.hfield1).
RUN proc2 IN THIS-PROCEDURE.
.
. (more of the same)
.
ASSIGN
var1 = "field name n"
var2 = STRING(table.fieldn)
var3 = STRING(htable.hfieldn).
RUN proc2 IN THIS-PROCEDURE.
END PROCEDURE. /* End procedure proc1 */
PROCEDURE proc2:
IF var1 <> var2 THEN
DO:
ASSIGN
p-line[1] = p-line[1] + " " + var1
p-line[2] = p-line[2] + " " + var2
p-line[3] = p-line[3] + " " + var3.
/* The above is simplified - it has various bits of code to ensure that the values in p-line are correctly aligned for printing. */
ASSIGN
changed = true.
END PROCEDURE. /* End procedure proc2 */
When I run the code, I get the following error:
SYSTEM ERROR: -s exceeded. Raising STOP condition and attempting to write stack trace to file 'procore'. Consider increasing -s startup parameter. (5635)
Can anyone tell me why this is and what I can do to prevent it, please?
I don't understand why the stack is "blowing" as I would expect the reference to proc2 to be removed from the stack when the procedure is complete.
:runtear: