简体   繁体   中英

How to avoid AppBuilder removing pieces of code

I'm working on a Progress-4GL programming environment, based on AppBuilder release 11.6.

Until now I've been changing already existing *.w and *.p files, but now I wanted to created my *.w file from scratch.

I've created a window and I've put a browse, a fill-in field and a button. Now I would like to add an event to that button. In order to do that, I add following lines to the *.w file:

ON CHOOSE OF btn-Start_Query IN FRAME DEFAULT-FRAME
DO:
    MESSAGE "button is pushed" VIEW-AS ALERT-BOX.
END.

However, when I save the *.w file, re-open it in the AppBuilder and save the file there again, those lines of code get removed.

I've already understood that, in order to avoid this, I need to "wrap" those lines of code by Scoped-define or Analyze:suspend/resume lines, something like this:

&Scoped-define SELF-NAME btn-Start_Query
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL btn-Start_Query C-Win
ON CHOOSE OF btn-Start_Query IN FRAME DEFAULT-FRAME
DO:
    MESSAGE "button is pushed" VIEW-AS ALERT-BOX.
END.
&ANALYZE-RESUME

However, this seems not to be working.

Can you explain me what exactly I have to do in order avoid my lines of code to be removed?

By the way: I know that I'm working with extremely outdated technology, but I only work here for two weeks, so I don't have the authority to force my boss to change his development environment, just for me.

The recommended approach is to use the Wizards of the AppBuilder to create the trigger block with the required AppBuilder markup for you.

  • Add the button to the Window
  • Select the button on the design canvas
  • Choose the "Edit code" button in the AppBuilder main window (the pencil)

在此处输入图像描述

This will create an empty default trigger block (in case of a button, that's the CHOOSE). To create a different event, use the "New..." button in the section editor window.

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM