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.

DELETE_TIMER built-in<br />

Description<br />

84<br />

Deletes the given timer from the form.<br />

Syntax<br />

PROCEDURE DELETE_TIMER<br />

(timer_id Timer);<br />

PROCEDURE DELETE_TIMER<br />

(timer_name VARCHAR2);<br />

Built-in Type unrestricted procedure<br />

Enter Query Mode yes<br />

Parameters<br />

timer_id Specifies the unique ID that <strong>Form</strong> <strong>Builder</strong> assigns when it creates the timer,<br />

specifically as a response to a successful call to the CREATE_TIMER<br />

built-in. Use the FIND_TIMER built-in to return the ID to an<br />

appropriately typed variable. That data type of the ID is Timer.<br />

timer_name Specifies the name you gave the timer when you defined it. The data type<br />

of the timer_name is VARCHAR2.<br />

DELETE_TIMER restrictions<br />

• If you delete a timer, you must issue a FIND_TIMER call before attempting to call ID_NULL to<br />

check on availability of the timer object. For instance, the following example is incorrect because<br />

the call to DELETE_TIMER does not set the value of the ID. In other words, the timer is deleted,<br />

but the ID continues to exist, yet points to a non-existent timer, hence, it is not null.<br />

-- Invalid Example<br />

timer_id := Find_Timer(’my_timer’);<br />

Delete_Timer(timer_id);<br />

IF (ID_Null(timer_id))...<br />

DELETE_TIMER examples<br />

/*<br />

** Built-in: DELETE_TIMER<br />

** Example: Remove a timer after first checking to see if<br />

** it exists<br />

*/<br />

PROCEDURE Cancel_Timer( tm_name VARCHAR2 ) IS<br />

tm_id Timer;<br />

BEGIN<br />

tm_id := Find_Timer( tm_name );<br />

IF NOT Id_Null(tm_id) THEN<br />

Delete_Timer(tm_id);<br />

ELSE<br />

Message(’Timer ’||tm_name||’ has already been cancelled.’);<br />

END IF;

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

Saved successfully!

Ooh no, something went wrong!