11.04.2013 Views

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

SUBROUTINE (Delete Trigger)<br />

Syntax<br />

SUBROUTINE trigname(execstat, dictflag, filename, record.ID.expr)<br />

FUNCTION trigname(dictflag, filename, record.ID.expr)<br />

Description<br />

A <strong>UniBasic</strong> subroutine or function serves as the DELETE trigger that is executed<br />

when you attempt to delete a record in the subject file. The SUBROUTINE or<br />

FUNCTION definition must be the first line in the <strong>UniBasic</strong> trigger subroutine.<br />

You must include a RETURN statement in the function:<br />

RETURN [execstat]<br />

Points to Remember<br />

Remember the following items when writing a subroutine that is triggered by a user<br />

attempting to delete a record:<br />

1-884 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong><br />

When you attempt to delete a record, UniData calls the trigger, passing the<br />

file name, DICT if dictionary file, record ID, and the input value before<br />

deleting the record. The subroutine returns the execution status.<br />

If the delete request fails the constraint, the subroutine must return a status<br />

of 0. If the request passes, the return must be 1.<br />

Tip: You can call a C routine from the <strong>UniBasic</strong> subroutine or function that is called<br />

from a trigger.

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

Saved successfully!

Ooh no, something went wrong!