/* * DECforms V2.0 Sample Form * * © Copyright 2005 Hewlett-Packard Development Company, L.P. * Consistent with FAR 12.211 and 12.212, Commercial Computer Software, * Computer Software Documentation, and Technical Data for Commercial * Items are licensed to the U.S. Government under vendor's standard * commercial license. */ /* This is a very simple form. It has no help and the user interface * is simple -- no backing out, for example. The purpose of this form * is to show how all the defaults work and how little IFDL needs to * be written to achieve something useful. */ FORM sample_form FORM DATA account_number UNSIGNED LONGWORD balance UNSIGNED LONGWORD /* Kept in pennies */ check_amount UNSIGNED LONGWORD /* Kept in pennies */ check_memo CHARACTER(35) check_number UNSIGNED WORD check_payto CHARACTER(35) current_date DATE CURRENT deposit_amount UNSIGNED LONGWORD /* Kept in pennies */ deposit_memo CHARACTER(35) mail_csz CHARACTER(30) /* City, address, zip for mailing address on check */ mail_name CHARACTER(39) /* Name for mailing label */ menu_option UNSIGNED BYTE VALUE 2 street CHARACTER(30) END DATA /* The ACCOUNT record is used by SEND from the program. It is sent at * the beginning of the program to set the form data items used in labels * on the check and deposit slip. */ FORM RECORD account account_number UNSIGNED LONGWORD mail_name CHARACTER(39) street CHARACTER(30) mail_csz CHARACTER(30) END RECORD /* * UPDATE is sent whenever a new check number or balance is set. */ FORM RECORD update check_number UNSIGNED WORD balance UNSIGNED LONGWORD END RECORD /* OPERATOR_CHOICE is used only by a RECEIVE to request a choice from * the operator. */ FORM RECORD operator_choice menu_option WORD INTEGER END RECORD /* GET_CHECK is used only by a RECEIVE to get check information from * the operator. */ FORM RECORD get_check check_amount UNSIGNED LONGWORD /* passed as pennies */ check_payto CHARACTER(35) check_memo CHARACTER(35) END RECORD /* GET_DEPOSIT is used only by a RECEIVE to get deposit information * from the operator. */ FORM RECORD get_deposit deposit_amount UNSIGNED LONGWORD /* passed as pennies */ deposit_memo CHARACTER(35) END RECORD LAYOUT simple_vt DEVICE TERMINAL decvt1 TYPE %VT100 END DEVICE SIZE 24 LINES BY 80 COLUMNS FUNCTION print_panel IS %control_p END FUNCTION /* EXTERNAL RESPONSES */ /* Receive response for GET_CHECK resets the three modifiable check fields * to their original values (blanks and zero) and then asks for them. */ RECEIVE RESPONSE get_check RESET check_payto check_amount check_memo ACTIVATE FIELD check_payto ON check_panel FIELD check_amount ON check_panel FIELD check_memo ON check_panel END RESPONSE /* Receive response for GET_DEPOSIT resets the two modifiable deposit * fields to their original values (blanks and zero) and then asks for * them. Note the difference in the way of activating the fields compared * to the get_check response; both methods have essentially the same * effect. */ RECEIVE RESPONSE get_deposit RESET deposit_amount deposit_memo ACTIVATE PANEL deposit_panel END RESPONSE FUNCTION RESPONSE print_panel Return /* returns user-specified data to application */ Call "PRINT_CHECK" /* sends user-specified and application-provided data to a file for printing */ Using By Descriptor CHECK_PAYTO By Reference CHECK_AMOUNT By Descriptor CHECK_MEMO END RESPONSE /* * CHOICE_PANEL holds the menu and displays the balance. */ PANEL choice_panel LITERAL TEXT LINE 5 COLUMN 19 VALUE "Enter Choice:" DISPLAY FONT SIZE DOUBLE HIGH END LITERAL FIELD menu_option SAME LINE NEXT COLUMN + 2 DISPLAY FONT SIZE DOUBLE HIGH OUTPUT PICTURE 9 USE HELP MESSAGE "Enter 1, 2, or 3; then press CTRL/Z." RANGE 1 THROUGH 3 MESSAGE "Please choose a value between 1 and 3." /* * Make the RETURN key do the menu choice */ FUNCTION RESPONSE NEXT ITEM RETURN END RESPONSE END FIELD LITERAL TEXT NEXT LINE + 2 COLUMN 21 VALUE "1 - Exit" DISPLAY FONT SIZE DOUBLE WIDE END LITERAL LITERAL TEXT NEXT LINE + 1 SAME COLUMN VALUE "2 - Write a Check" DISPLAY FONT SIZE DOUBLE WIDE END LITERAL LITERAL TEXT NEXT LINE + 1 SAME COLUMN VALUE "3 - Make a Deposit" DISPLAY FONT SIZE DOUBLE WIDE END LITERAL LITERAL TEXT NEXT LINE + 3 COLUMN 19 VALUE "Balance " DISPLAY FONT SIZE DOUBLE WIDE END LITERAL FIELD balance SAME LINE NEXT COLUMN OUTPUT PICTURE 9,999,99W9.99 CURRENCY SIGN IS "$" SCALE -2 PROTECTED DISPLAY FONT SIZE DOUBLE WIDE END FIELD LITERAL TEXT NEXT LINE + 3 COLUMN 11 VALUE "Enter the number of your choice and then press CTRL/Z." END LITERAL END PANEL /* * CHECK_PANEL is used for entry of check data */ PANEL check_panel LITERAL TEXT LINE 4 COLUMN 27 VALUE "WRITE A CHECK" DISPLAY FONT SIZE DOUBLE HIGH END LITERAL LITERAL RECTANGLE LINE 5 COLUMN 2 LINE 18 COLUMN 79 END LITERAL FIELD check_number LINE 6 COLUMN 70 OUTPUT PICTURE 9999R9 PROTECTED END FIELD FIELD mail_name LINE 6 COLUMN 4 PROTECTED END FIELD FIELD street PROTECTED END FIELD FIELD mail_csz PROTECTED END FIELD LITERAL TEXT NEXT LINE +1 COLUMN 52 VALUE "Date:" END LITERAL FIELD current_date SAME LINE NEXT COLUMN + 1 OUTPUT PICTURE FOR DATE MMMMMMMMMQ' 'DD', 'YYYY PROTECTED END FIELD LITERAL TEXT NEXT LINE +1 COLUMN 4 VALUE "Pay to" END LITERAL FIELD check_payto SAME LINE NEXT COLUMN +1 OUTPUT PICTURE X(35) ACTIVE HIGHLIGHT REVERSE USE HELP MESSAGE "Enter the person or organization to whom you" " wish to pay the check." MINIMUM LENGTH 1 MESSAGE "You must fill in the payee." END FIELD LITERAL TEXT SAME LINE COLUMN 59 VALUE "Amount" END LITERAL FIELD check_amount SAME LINE NEXT COLUMN + 1 OUTPUT PICTURE 9,999,99R9.99 SCALE -2 JUSTIFICATION DECIMAL REPLACE LEADING "*" ACTIVE HIGHLIGHT REVERSE USE HELP MESSAGE "Enter the amount to be paid." RANGE 0 THROUGH balance MESSAGE "Check amount must be less than the balance in " "the account." REQUIRE check_amount > 0 MESSAGE "Check amount must be greater than zero." END FIELD LITERAL TEXT NEXT LINE + 1 COLUMN 4 VALUE "Memo" END LITERAL FIELD check_memo SAME LINE NEXT COLUMN + 1 OUTPUT PICTURE X(35) ACTIVE HIGHLIGHT REVERSE USE HELP MESSAGE "Fill in a reminder to yourself about what the" " check is for. You need not fill this in." END FIELD LITERAL TEXT NEXT LINE + 2 COLUMN 4 VALUE "FIRST NATIONAL BANK" END LITERAL LITERAL TEXT SAME LINE COLUMN 65 VALUE "Account" END LITERAL FIELD account_number SAME LINE NEXT COLUMN + 1 OUTPUT PICTURE 9(5) PROTECTED END FIELD LITERAL TEXT LINE 19 COLUMN 11 VALUE "Enter values; then press CTRL/Z to record check," END LITERAL LITERAL TEXT LINE 20 COLUMN 11 VALUE "or press CTRL/P to create a file for printing check." END LITERAL END PANEL /* * DEPOSIT_PANEL is used for entering a deposit */ PANEL deposit_panel LITERAL RECTANGLE LINE 5 COLUMN 14 LINE 13 COLUMN 67 END LITERAL LITERAL TEXT LINE 4 COLUMN 27 VALUE "Deposit Record" DISPLAY FONT SIZE DOUBLE HIGH END LITERAL LITERAL TEXT NEXT LINE + 1 COLUMN 16 VALUE "Date:" END LITERAL FIELD current_date SAME LINE NEXT COLUMN + 1 OUTPUT PICTURE FOR DATE MMMMMMMMMQ' 'DD', 'YYYY PROTECTED END FIELD LITERAL TEXT SAME LINE COLUMN 53 VALUE "Account" END LITERAL FIELD account_number SAME LINE NEXT COLUMN + 1 OUTPUT PICTURE 9(5) PROTECTED END FIELD LITERAL TEXT NEXT LINE + 2 COLUMN 21 VALUE "Deposit" END LITERAL FIELD deposit_amount SAME LINE SAME COLUMN + 10 OUTPUT PICTURE 9,999,99R9.99 SCALE -2 JUSTIFICATION DECIMAL USE HELP MESSAGE "Enter the amount of the deposit." REQUIRE deposit_amount > 0 MESSAGE "You must specify a non-zero deposit amount." END FIELD LITERAL TEXT NEXT LINE + 2 COLUMN 21 VALUE "Memo" END LITERAL FIELD deposit_memo SAME LINE SAME COLUMN + 10 OUTPUT PICTURE X(35) USE HELP MESSAGE "Fill in a reminder of where you got the money." END FIELD LITERAL TEXT LINE 14 COLUMN 13 VALUE "Enter values and then press CTRL/Z to finish deposit." END LITERAL END PANEL END LAYOUT Layout SIMPLE_PRINTER Device Pixel PRINTER Type %PRINTER End Device Units Inches Size 6.000 Lines by 8.880 Columns Send Response GET_CHECK /* Use the DISPLAY response step to send check panel data to a */ /* printer file (DDIF on VMS). */ Display Check_Panel End Response Panel CHECK_PANEL Display Viewport NODECORATIONS /* This clause has been added to remove border lines around the viewport's edge. (The check has its own literal rectangle to outline its dimensions.) */ Literal Rectangle Line 1.375 Column .277 Line 4.625 Column 8.824 End Literal Field CHECK_NUMBER Line 1.500 Column 7.770 Display Border Width Is 0 NoShadow Output Picture 9999R9 Protected End Field Field MAIL_NAME Line 1.500 Column .444 Display Border Width Is 0 NoShadow Protected End Field Field STREET Line 1.750 Column .444 Display Border Width Is 0 NoShadow Protected End Field Field MAIL_CSZ Line 2.000 Column .444 Display Border Width Is 0 NoShadow Protected End Field Literal Text Line 2.500 Column 5.994 Value "Date:" End Literal Field CURRENT_DATE Line 2.500 Column 6.660 DISPLAY UNDERLINED Output Picture For Date MMMMMMMMMQ' 'DD', 'YYYY End Field Literal Text Line 3.000 Column .444 Value "Pay to" End Literal Field CHECK_PAYTO Line 3.000 Column 1.221 Output Picture X(35) DISPLAY UNDERLINED /* Use Help Message and Minimum Length clauses have been removed because a PRINTER layout is used for output only. If these clauses were not removed, they would simply be ignored. */ End Field Literal Text Line 3.000 Column 6.549 Value "Amount" End Literal Field CHECK_AMOUNT Line 3.000 Column 7.326 Output Picture 9,999,99R9.99 Scale -2 Replace Leading "*" DISPLAY UNDERLINED /* A few input-oriented clauses (e.g., Range and Require) have been removed because a PRINTER layout is used for output only. If these clauses were not removed, they would simply be ignored. */ End Field Literal Text Line 3.500 Column .444 Value "Memo" End Literal Field CHECK_MEMO Line 3.500 Column .999 Output Picture X(35) DISPLAY UNDERLINED /* The Use Help Message clause has been removed because a PRINTER layout is used for output only. If the clause were not removed, it would simply be ignored. */ End Field Literal Text Line 4.250 Column .444 Value "FIRST NATIONAL BANK" End Literal Literal Text Line 4.250 Column 7.215 Value "Account" End Literal Field ACCOUNT_NUMBER Line 4.250 Column 8.103 Output Picture 9(5) End Field /* Text literals used to display on-screen instructions have been removed because a PRINTER layout is used for output only. */ End Panel End Layout End Form