Before you write a Procedure, here are the steps mandatorily to complet.
- Create and save the query and form
- Enter: RESET PROC
The PROC panel displays.
Example Proc:
/* This procedure checks to see what day it is.
If it’s Monday, it runs a query and prints a report.
If it isn’t, a message is displayed informing the user.*/
signal on error
if date(‘w’) = ‘Monday’
then
do
“RUN QUERY MYQUERY (FORM = MYFORM”
“PRINT REPORT”
“MESSAGE (TEXT=’OK,
MONDAY report has been created and sent to printer.'”
end
else
do
“MESSAGE (TEXT=’Sorry, it is not Monday. Report cannot be created.'”
end
exit 0 /Exit without errors */
error:
“MESSAGE (TEXT = ‘”dsq_message_text”‘”
exit 8 /Exit with error condition*/
*** END ***
Related posts