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.

USER_EXIT built-in<br />

Description<br />

Calls the user exit named in the user_exit_string.<br />

Syntax<br />

USER_EXIT<br />

(user_exit_string VARCHAR2);<br />

USER_EXIT<br />

(user_exit_string VARCHAR2,<br />

error_string VARCHAR2);<br />

Built-in Type unrestricted procedure<br />

Enter Query Mode yes<br />

Parameters<br />

user_exit_string Specifies the name of the user exit you want to call, including any<br />

parameters.<br />

error_string Specifies a user-defined error message that <strong>Form</strong> <strong>Builder</strong> should display if<br />

the user exit fails.<br />

USER_EXIT examples<br />

/*<br />

** Built-in: USER_EXIT<br />

** Example: Invoke a 3GL program by name which has been<br />

** properly linked into your current <strong>Form</strong> <strong>Builder</strong><br />

** executable. The user exit subprogram must parse<br />

** the string argument it is passed to decide what<br />

** functionality to perform.<br />

*/<br />

PROCEDURE Command_Robotic_Arm( cmd_string VARCHAR2 ) IS<br />

BEGIN<br />

/*<br />

** Call a C function ’RobotLnk’ to initialize the<br />

** communication card before sending the robot a message.<br />

*/<br />

User_Exit(’RobotLnk INITIALIZE Unit=6,CmdToFollow=1’);<br />

IF NOT <strong>Form</strong>_Success THEN<br />

Message(’Failed to initialize Robot 6’);<br />

RAISE <strong>Form</strong>_trigger_Failure;<br />

END IF;<br />

/*<br />

** Pass the string argument as a command to the robot<br />

*/<br />

User_Exit(’RobotLnk SEND Unit=6,Msg=’||cmd_string );<br />

IF NOT <strong>Form</strong>_Success THEN<br />

Message(’Command not understood by Robot 6’);<br />

RAISE <strong>Form</strong>_trigger_Failure;<br />

END IF;<br />

/*<br />

** Close the robot’s communication channel<br />

*/<br />

449

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

Saved successfully!

Ooh no, something went wrong!