0

我在 Oracle Forms 上做了一个简单的程序。下面的代码是按下提交按钮时的触发器。

这里是:

BEGIN
CREATE_RECORD;

IF :USERS.USERNAME IS NULL THEN
    MESSAGE('Please enter Username');
    GO_ITEM('USERNAME');

ELSIF :USERS.PASSWORD IS NULL THEN
    MESSAGE('Please enter Password');
    GO_ITEM('PASSWORD');

ELSIF :USERS.PASSWORD2 IS NULL THEN
    MESSAGE('Please confirm your Password');
    GO_ITEM('PASSWORD2');

ELSIF :USERS.PASSWORD != :USERS.PASSWORD2 THEN
    MESSAGE('Password did not match');
    GO_ITEM('PASSWORD2');

ELSIF :USERS.NAME IS NULL THEN
    MESSAGE('Please enter your Name');
    GO_ITEM('NAME');

ELSIF :USERS.POSITION IS NULL THEN
    MESSAGE('Please enter your Position');
    GO_ITEM('POSITION');

END IF;

IF :USERS.ACCESS_LEVEL = 'admin' THEN

    IF :USERS.ADMIN_PASS = 'eweb1' THEN

        alert:= show_alert('USER_CREATED');

            IF alert = alert_button1 THEN
            MESSAGE('OK');
            END IF;

    ELSE
                MESSAGE('Administrator Password did not match');
                GO_ITEM('ADMIN_PASS');
    END IF;

    ELSE
        alert:= show_alert('USER_CREATED');

            IF alert = alert_button1 THEN
                /* foo */
            END IF;

END IF;

END;

当表单遇到错误时,例如当第二个密码(password2)不匹配时,当它显示“密码不匹配”的消息时,它仍然流动并阅读以下语句而不是停止并等待按下按钮再次。我希望我能解决这个问题。tnx

4

1 回答 1

1

您可以告诉 MESSAGE 在继续之前等待操作员确认消息:

MESSAGE('Please enter Username', ACKNOWLEDGE);
于 2013-10-03T01:09:38.850 回答