11.01.2013 Views

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

MESSAGE_TEXT built-in<br />

Description<br />

Returns message text for the message that <strong>Form</strong> <strong>Builder</strong> most recently generated during the current<br />

Runform session. MESSAGE_TEXT returns NULL at the beginning of a session, before <strong>Form</strong> <strong>Builder</strong><br />

generates any messages.<br />

Use MESSAGE_TEXT to test the outcome of a user action (e.g., pressing a key) to determine processing<br />

within an On-Message trigger.<br />

Note: If your applications must be supported in more than one language, use the MESSAGE_CODE<br />

built-in instead of the MESSAGE_TEXT built-in. Referencing message codes rather than message text is<br />

particularly useful in applications that provide national language support.<br />

Syntax<br />

FUNCTION MESSAGE_TEXT;<br />

Built-in Type unrestricted function<br />

Returns VARCHAR2<br />

Enter Query Mode yes<br />

Parameters<br />

none<br />

MESSAGE_TEXT examples<br />

286<br />

/*<br />

** Built-in: MESSAGE_CODE,MESSAGE_TEXT,MESSAGE_TYPE<br />

** Example: Reword certain FRM message messages by checking<br />

** the Message_Code in an ON-MESSAGE trigger<br />

** trigger: On-Message<br />

*/<br />

DECLARE<br />

msgnum NUMBER := MESSAGE_CODE;<br />

msgtxt VARCHAR2(80) := MESSAGE_TEXT;<br />

msgtyp VARCHAR2(3) := MESSAGE_TYPE;<br />

BEGIN<br />

IF msgnum = 40400 THEN<br />

Message(’Your changes have been made permanent.’);<br />

ELSIF msgnum = 40401 THEN<br />

Message(’You have no unsaved changes outstanding.’);<br />

ELSE<br />

/*<br />

** Print the Normal Message that would have appeared<br />

**<br />

** FRM-12345: Message Text Goes Here<br />

*/<br />

Message(msgtyp||’-’||TO_CHAR(msgnum)||’: ’||msgtxt);<br />

END IF;<br />

END;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!