如何创建 Openedge 程序的可视化界面
How to crate a Visual Interface to an Openedge Program
我是一名实习开发人员,并且是 Openedge 语言的新手,我正在做我工作的公司给我的一些练习来学习这门语言。这是练习:
Develop a simple calculator that can do the 4 basic math operations.
The program must contain:
- One .p file for the interface
- One .p file for the calculator logic
- One menu for choosing the wanted operation
Use the update command to get the values in the screen and the
display command to show the options.
我学过 C++,我知道如何创建一个等待用户输入并对其进行操作的界面。问题是,在 Openedge 中,直到现在,我只开发了 运行 一次带有硬编码变量的程序,我将如何在 Openedge 中做这种事情?创建一个等待用户键入一些输入的可视菜单。
鉴于你说你应该使用 UPDATE
和 DISPLAY
我猜你应该开发一个基于文本的用户界面。
一个非常简单的菜单可以是这样的:
DEFINE VARIABLE cCmd AS CHARACTER NO-UNDO.
DO WHILE cCmd <> "X" :
DISPLAY
"1) command one" SKIP
"2) command two" SKIP
"3) command three" SKIP
"X) Leave menu" WITH FRAME frameMenu 4 DOWN WIDTH 20.
UPDATE cCmd LABEL "Choice".
CASE cCmd:
WHEN "1" THEN MESSAGE "Command one".
WHEN "2" THEN MESSAGE "Command two".
WHEN "3" THEN MESSAGE "Command three".
OTHERWISE MESSAGE "Unknown command".
END CASE.
END.
我是一名实习开发人员,并且是 Openedge 语言的新手,我正在做我工作的公司给我的一些练习来学习这门语言。这是练习:
Develop a simple calculator that can do the 4 basic math operations. The program must contain:
- One .p file for the interface
- One .p file for the calculator logic
- One menu for choosing the wanted operation
Use the update command to get the values in the screen and the display command to show the options.
我学过 C++,我知道如何创建一个等待用户输入并对其进行操作的界面。问题是,在 Openedge 中,直到现在,我只开发了 运行 一次带有硬编码变量的程序,我将如何在 Openedge 中做这种事情?创建一个等待用户键入一些输入的可视菜单。
鉴于你说你应该使用 UPDATE
和 DISPLAY
我猜你应该开发一个基于文本的用户界面。
一个非常简单的菜单可以是这样的:
DEFINE VARIABLE cCmd AS CHARACTER NO-UNDO.
DO WHILE cCmd <> "X" :
DISPLAY
"1) command one" SKIP
"2) command two" SKIP
"3) command three" SKIP
"X) Leave menu" WITH FRAME frameMenu 4 DOWN WIDTH 20.
UPDATE cCmd LABEL "Choice".
CASE cCmd:
WHEN "1" THEN MESSAGE "Command one".
WHEN "2" THEN MESSAGE "Command two".
WHEN "3" THEN MESSAGE "Command three".
OTHERWISE MESSAGE "Unknown command".
END CASE.
END.