SYSTEM ERROR: Memory violation. (49)

Dirky

New Member
I've got a question about a system error I get when using editor widgets on V9, CHui interface...

Here's an example:

define work-table w_table
field w_fill1 as character
field w_fill2 as character
field w_edit3 as character view-as editor size 30 by 2.

def var count as int.
do count = 1 to 5:
create w_table.
assign
w_fill1 = subst("record &1, fill-in 1", count)
w_fill2 = subst("record &1, fill-in 2", count)
w_edit3 = subst("record &1, editor", count).
end.

form
w_fill1 format "x(20)"
w_fill2 format "x(20)"
w_edit3 view-as editor size 30 by 2
with 5 down frame f_down.

do while true with frame f_down on error undo, retry on endkey undo, retry:
if retry then do:
up frame-line - 1.
end.

for each w_table with frame f_down:
display w_table.
down.
end.

readkey.
if keyfunction(lastkey) = "new-line" then do:
/* Goto line #3 to insert a record there */
up frame-line - 1.
down 2.

/* Visualize an empty record */
scroll from-current down.

prompt-for w_table.
create w_table.
assign w_table.
end.
end.

Run the code, then press F9 (or NEW-LINE) and then press F4 (or END-ERROR) to cancel the prompt-for.

Then do this same thing once more, and you'll get the system error #49 (Memory Violation)

Can anybody please explain to me why this occurs. Needless to say I'm looking for a way to prevent te system error from occuring...

Please help me out...
Dirky
 
What O/S, version of Progress? It works fine in chui 9.1 and 8.3 gui on Windows ME. Normally this happens because you don't have enough memory to allocate to the process. Or your Progress executable may me corrupt or needs to be compiles against your O/S i.e. Linux.
 
I tried it on a Sun Enterprise UNIX box with 9.1C18 and got Error Number 48.

I've forgotten so much about CHUI coding, that I can't really analyse your code, but I've always been very wary of
DO WHILE TRUE
statements.
 
The 'do while true' only prevents you from having to type in the code twice... after the second time you've cancelled the prompt-for, a system error will occur,
so it could also be reproduced without the 'do while true' loop; just type the code within that block again...
 
Back
Top