Here is a screen similar to the one you already had, but with create and delete. I disabled the key (tt.a) in the modify, because it is default not to let change the primary key, besides, find what you do in the save fails when vc changes the key.
The code is as follows:
DEFINE TEMP-TABLE tt
FIELD TO AS INT
FIELD B AS CHAR.
DEFINE BUTTON bt LABEL "Modify".
DEFINE BUTTON btS LABEL "Save".
DEFINE BUTTON btC LABEL "Close".
DEFINE BUTTON btD LABEL "Delete".
DEFINE BUTTON btCr LABEL "Create".
DEFINE QUERY qr FOR tt.
DEFINE BROWSE br QUERY qr DISPLAY tt.a tt.b WITH SIZE 60 BY 5 .
DEFINE FRAME f
br btCr SKIP
bt AT ROW 2 COL 62
btD AT ROW 3 COL 62
tt.a AT ROW 6 COL 1 SKIP tt.b btS btC WITH THREE-D SIDE-LABELS.
ON 'choose':U OF bt IN FRAME f
DO:
RUN updateRecord.
END.
ON 'CHOOSE':U OF btCr IN FRAME f DO:
RUN createRecord.
END.
ON 'choose':U OF btS IN FRAME f DO:
FIND FIRST tt WHERE tt.a = INPUT FRAME f tt.a NO-ERROR.
IF NOT AVAILABLE tt THEN CREATE tt.
ASSIGN tt.a = INPUT FRAME f tt.a
tt.b = INPUT FRAME f tt.b.
OPEN QUERY qr FOR EACH tt.
CLEAR FRAME f.
DISABLE tt.a tt.b.
END.
ON 'choose':U OF btD DO:
MESSAGE 'Are you sure you want to delete?'
VIEW-AS ALERT-BOX QUESTION BUTTONS YES-NO UPDATE lResp AS LOGICAL.
IF lResp THEN DO:
DELETE tt.
OPEN QUERY qr FOR EACH tt.
END.
END.
/* Create some test records */
CREATE tt. ASSIGN a = 1 b = 'first'.
CREATE tt. ASSIGN a = 2 b = 'second'.
CREATE tt. ASSIGN a = 3 b = 'third'.
OPEN QUERY qr FOR EACH tt.
ENABLE ALL EXCEPT tt.a tt.b WITH FRAME f.
WAIT-FOR CHOOSE OF btC.
PROCEDURE updateRecord:
DISPLAY tt.a tt.b WITH FRAME f.
ENABLE tt.b WITH FRAME f.
END PROCEDURE.
PROCEDURE createRecord:
ENABLE tt.a tt.b WITH FRAME f.
END PROCEDURE.
The problem is that screens in CHUI (Character User Interface) are more laborious. Try playing with the appBuilder that is better finished and easier. As for Progress sites, I believe that few are still active... Usually people already work in the area and have more punctual doubts. but when looking for help, look for the tags Progress 4gl, ABL or Openedge.
By its code, I see that Voce dominates some commands, but you can explore several concepts that maybe you do not understand yet, or do not know how it works in Progress. I’d have to go through a training course anyway, for someone to explain directly.
I don’t know if I recommend Try learning Basic Progress today. I suggest you take the Telerik, that is their mobile platform, and eh the one that has the newest, and that will probably have enough demand soon.
Anyway, I hope it helps. Any doubt eh soh speak.
Tag the language, so the code gets Highlight and so people know which language it is
– rray
vlww, I tried to put however gave that I did not have enough points ...
– Alef Ribeiro