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.

• On Windows 95 platforms the FORM_SUCCESS built-in will always return TRUE for HOST<br />

commands which fail. This includes calls to command.com or OS functions, any 16-bit DOS or<br />

GUI application, or an invalid command. 32-bit applications will correctly return TRUE if executed<br />

sucessfully and FALSE if failed.<br />

HOST examples<br />

254<br />

/*<br />

** built-in: HOST<br />

** Example: Execute an operating system command in a<br />

** subprocess or subshell. Uses the<br />

** ’Get_Connect_Info’ procedure from the<br />

** GET_APPLICATION_PROPERTY example.<br />

*/<br />

PROCEDURE Mail_Warning( send_to VARCHAR2) IS<br />

the_username VARCHAR2(40);<br />

the_password VARCHAR2(40);<br />

the_connect VARCHAR2(40);<br />

the_command VARCHAR2(2000);<br />

BEGIN<br />

/*<br />

** Get Username, Password, Connect information<br />

*/<br />

Get_Connect_Info(the_username,the_password,the_connect);<br />

/*<br />

** Concatenate together the static text and values of<br />

** local variables to prepare the operating system command<br />

** string.<br />

*/<br />

the_command := ’orasend ’||<br />

’ to=’||send_to||<br />

’ std_warn.txt ’||<br />

’ subject="## LATE PAYMENT ##"’||<br />

’ user=’||the_username||<br />

’ password=’||the_password||<br />

’ connect=’||the_connect;<br />

Message(’Sending Message...’, NO_ACKNOWLEDGE);<br />

Synchronize;<br />

/*<br />

** Execute the command string as an O/S command The<br />

** NO_SCREEN option tells forms not to clear the screen<br />

** while we do our work at the O/S level "silently".<br />

*/<br />

Host( the_command, NO_SCREEN );<br />

/*<br />

** Check whether the command succeeded or not<br />

*/<br />

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

Message(’Error -- Message not sent.’);<br />

ELSE<br />

Message(’Message Sent.’);<br />

END IF;<br />

END;

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

Saved successfully!

Ooh no, something went wrong!