简体   繁体   English

window 表单进入无响应阶段

[英]window form goes not responding stage

I am new to progress 4GL.我是进度 4GL 的新手。 In my program, I tried to create a form using progress 4GL.在我的程序中,我尝试使用 progress 4GL 创建一个表单。 The form has two fields one is DB name and another one is DB Description.该表单有两个字段,一个是数据库名称,另一个是数据库描述。 The scope of this form is by default this should have one DB name and description and if a user-entered or keep blank in the field of DB name then an alert box should give a message.此表格的 scope 默认情况下应该有一个 DB 名称和描述,如果用户在 DB 名称字段中输入或保持空白,则警报框应给出消息。 I have developed the form but when I run it the program keeps continuously running and window form goes not responding stage.我已经开发了表格,但是当我运行它时,程序会继续运行,并且 window 表格没有响应阶段。 I don't get a chance to enter or keep blank to the DB field name.我没有机会输入数据库字段名称或将其留空。 Let me share my code and please help to find out what is the issue and why it's continuously running.让我分享我的代码,请帮助找出问题所在以及为什么它会持续运行。

define variable cArcDB      as character   no-undo format "x(20)" INIT "qadb".
define variable cArcDBDesc  as character   no-undo format "x(25)" INIT "archive database".
define variable cTmp  as character   NO-UNDO.

form
cArcDB     colon 25
cArcDBDesc colon 25
with frame frArchiveDB width 80 side-labels.

MAIN-LOOP:
REPEAT:

display
     cArcDB
     cArcDBDesc
  with frame frArchiveDB.

  set
     cArcDB
  with frame frArchiveDB editing:
     if frame-field = "cArcDB" then do:
        /* Find next/prev record from ttAppDB */
        cTmp = cArcDB:input-value in frame frArchiveDB.

           display
              cArcDB
              cArcDBDesc
           with frame frArchiveDB.
        end.
  end. /* editing */
  cArcDB = trim(cArcDB).

  if cArcDB = "" then do:
     /* Blank not allowed */
   /*  {us/bbi/pxmsg.i &MSGNUM=40 &ERRORLEVEL=3} */
     next-prompt cArcDB with frame frArchiveDB.
     undo MAIN-LOOP,retry MAIN-LOOP.
  end.
  END.

Please have look at the online reference of the "EDITING phrase".请查看“编辑短语”的在线参考。 To me it looks like you're missing the READKEY after the beginning of the EDITING block and you also need to "APPLY LASTKEY" at some point.对我来说,您似乎在 EDITING 块开始后丢失了 READKEY,并且您还需要在某个时候“应用 LASTKEY”。 See the sample there:查看那里的示例:

/* Update Customer fields, monitoring each keystroke during the UPDATE */
UPDATE Customer.Name Customer.Address Customer.City Customer.State SKIP
  Customer.SalesRep HELP "Use the space bar to select a SalesRep" 
  WITH 2 COLUMNS EDITING:  /* Read a keystroke */
  READKEY.
  /* If the cursor is in any field except SalesRep, execute the last key
     pressed and go on to the next iteration of this EDITING phrase to check
     the next key */
  IF FRAME-FIELD <> "SalesRep" THEN DO:
    APPLY LASTKEY.
    IF GO-PENDING THEN LEAVE.
    ELSE NEXT.
  END.
  /* When in the SalesRep field, if the last key pressed was the space bar
     then cycle through the sales reps */
  IF LASTKEY = KEYCODE(" ") THEN DO:
    FIND NEXT SalesRep NO-ERROR.
    IF NOT AVAILABLE SalesRep THEN FIND FIRST SalesRep.
    DISPLAY SalesRep.SalesRep @ Customer.SalesRep.
    NEXT.
  END.
  /* If the user presses any one of a set of keys while in the SalesRep field,
     immediately execute that key */
  IF LOOKUP(KEYFUNCTION(LASTKEY), 
    "TAB,BACK-TAB,GO,RETURN,END-ERROR") > 0 THEN APPLY LASTKEY.
  ELSE BELL.
END.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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