Reg: Editing Block

Hi Everybody,
I am stuck up with a clarification. Please do the needful at the earliest. The requirement is as follows;
Consider a frame f1 with 3 variables are defined and the input to the frame is requested through PROMPT-FOR. I have another frame say f2 which needs to be popped up and accept inputs when user presses "F5".

How can this be handled in the Editing block of the frame f1?

Thanks in advance.
 
You really shouldn't be creating new code with editing blocks. They have been deprecated for many years. It is one thing to be stuck with old code that has huge, complex editing blocks and not wanting to rewrite all of that to make a small changes ... although I would recommend a rewrite there too ... but there is just no good reason to create new code with editing blocks. Bite the bullet, learn the new way, and go forward from there. It is really a much better idea.
 
Hi Tamhas,
I do totally agree with you but the problem here is i can't go for re-structing such a big code in editing block. The requirement here is to add another prompt-for with in the parent prompt-for and write an editing block.

I wrote a prompt-for with editing block in another editing block. The system went into a deadlock state and got stuck. So can't we use an editing block with in another? If so can you/someone provide me with an example.

Any alternative cases is also appreciateable... Thanks in advance...
 
Is putting frame f2 in a different program an option? Then you can simply do something like this in the editing of f1:

readkey.
if keyfunction(lastkey) = "F5" then run progF2.
<continue F1>

Or maybe just an internal procedure ipProgF2?
 
Don't be surprised if, in the end, you spend more time trying to get it to work the way it is than it would take to rewrite it ... and if you *ever* need to modify the code again, it will be already way easier to maintain and enhance.
 
Yep. I do totally agree with you. but the thing is moving for entire restructuring of the program they generally don't prefer in our projects. So there is no other go for me...

Thanks a lot. I am trying to to implement the way that you have provided. More information is appreciatable.

Thank in advance.
 
Very simple example:

ProgF1:

def var var1 as char no-undo.
def var var2 as char no-undo.
def var var3 as char no-undo.

do with frame f1:
form var1 skip(0) var2 skip(0) var3 skip(0) with side-labels size 50 by 10.
prompt-for var1 var2 var3
editing:
readkey.
if keylabel(lastkey) = "F5" then do:
run ipProgF2.
next.
end.
apply lastkey.
end.
assign var1 var2 var3.
end.

procedure ipProgF2:
def var var4 as char no-undo.
def var var5 as char no-undo.

do with frame f2:
form var4 var5 with overlay row 3.
prompt-for var4 var5
editing:
readkey.
apply lastkey.
end.
assign var4 var5.
end.
end.

Just to show you the basics.

Hope this helps you out.
 
Hi Vaalen,
Thanks a lot... The Stuff was very useful and helpful for me as well. But i wonder how the Progress Compiler works.

Initially i tried a scenario like;
PROMPT-FOR
var1
var2
var3
EDITING:
readkey.
if keyfunction(lastkey) = "F5" then
DO:
PROMPT-FOR
var1
var2
var3
EDITING:
readkey.
if keyfunction(lastkey) = "F5" then
disp "xyz".
END.
END.
END.

which didn't work. It turned up into a mess up. Nothing worked and almost a dead state. But if the same inner PROMPT-FOR is copied to another procedure its working fine.

Can someone let me know why its acting so??? Thanks in advance.
 
Given the nature of an EDITING block, I'm not surprised its brains got scrambled. An EDITING block is nothing like a procedural block. Think of what this would look like if it were written properly with ON actions ... would you expect to see them nested?
 
Back
Top