Question

I need to update field in program a.p using external program or procedure. But i can't. This is example of a.p:

DEF VAR v1 AS CHAR.
DEF VAR v2 AS CHAR.
DEF VAR v3 AS CHAR.
DEF VAR v4 AS CHAR.

DEF VAR external_program AS CHAR INITIAL 'myexternalprogram.p'.

FORM 
    v1
    v2
    v3
    v4
WITH FRAME f1.


ON F2 OF v1 IN FRAME f1
DO:

    RUN VALUE(external_program) .

END.
REPEAT:
    UPDATE 
        v1
        v2
        v3
        v4
    WITH FRAME f1.
END.
=========================================
myexternalprogram.p :

INPUT FROM VALUE(txt_with_data).

If i am using internal procedure is very easy. But i need to use external. And i cannot modify program a.p . I tried some with handle but i failed...

I started thinking , is it possible in any way?

Thank You for Your answer.

When I use :

MESSAGE PROGRAM-NAME(2) VIEW-AS ALERT-BOX.
MESSAGE SELF:NAME VIEW-AS ALERT-BOX.

SELF:SCREEN-VALUE = 'w1'.
APPLY "ENTER" TO SELF.

I can jump to another field, but on the end of the procedure. How can I with similiar code jumping through all of my fields knowing frame and field name?

Was it helpful?

Solution

You can re-direct stdin by running a batch session:

mbpro -db dbname -p program.p < input.file

Alternately, use the ENTRY event to get the current field, check it's PROGRAM-NAME() and SELF:NAME values for the field you want, and modify SELF:SCREEN-VALUE as appropriate.

To update other fields in the frame, use widget-handle:PREV-SIBLING and widget-handle:NEXT-SIBLING to walk the frame's widget tree.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top