/* * DECforms V2.0 Sample Form * * COPYRIGHT (c) 1988, 1989, 1991, 1993 BY * DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. * * THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED * ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE * INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER * COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY * OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY * TRANSFERRED. * * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE * AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT * CORPORATION. * * DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS * SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL. */ /* 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_VT_PIXEL /* 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 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. */ /* * CHOICE_PANEL holds the menu and displays the balance. */ /* * CHECK_PANEL is used for entry of check data */ /* * DEPOSIT_PANEL is used for entering a deposit */ Device Pixel WORKSTATION Type %Motif Pixel PC Type %Windows End Device Units Inches Size 6.250 Lines by 8.991 Columns Function PRINT_PANEL Is %CONTROL + %SMALL_P %CONTROL + %CAPITAL_P End Function 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 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" Using /* sends user-specified and application-provided data to a file for printing */ By Descriptor CHECK_PAYTO By Reference CHECK_AMOUNT By Descriptor CHECK_MEMO End Response Panel CHOICE_PANEL Literal Text Line 1.250 Column 2.109 Value "Enter Choice:" Display Font Size 18 End Literal Field MENU_OPTION Line 1.250 Column 5.217 Function Response NEXT ITEM Return End Response Display Font Size 18 Output Picture 9 Use Help Message "Enter 1, 2, or 3; then press CTRL/D." /* The CTRL/D default key binding for the Transmit function applies to more device types than the CTRL/Z binding. */ Range 1 Through 3 Message "Please choose a value between 1 and 3." /* Make the RETURN key do the menu choice */ End Field Literal Text Line 2.000 Column 2.331 Value "1 - Exit" Display Font Size 14 End Literal Literal Text Line 2.500 Column 2.331 Value "2 - Write a Check" Display Font Size 14 End Literal Literal Text Line 3.000 Column 2.331 Value "3 - Make a Deposit" Display Font Size 14 End Literal Literal Text Line 4.000 Column 2.109 Value "Balance " Display Font Size 14 End Literal Field BALANCE Line 4.000 Column 3.885 Display Font Size 14 Border Width Is 0 NoShadow Output Picture 9,999,99W9.99 Scale -2 Currency Sign is "$" Protected End Field Literal Text Line 5.000 Column 1.221 Value "Enter the number of your choice and then press CTRL/D." /* The CTRL/D default key binding for the Transmit function applies to more device types than the CTRL/Z binding. */ End Literal End Panel Panel CHECK_PANEL Literal Text Line 1.000 Column 2.997 Value "WRITE A CHECK" Display Font Size 18 End Literal 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 Border Width Is 0 NoShadow Output Picture For Date MMMMMMMMMQ' 'DD', 'YYYY Protected End Field Literal Text Line 3.000 Column .444 Value "Pay to" End Literal Field CHECK_PAYTO Line 3.000 Column 1.221 /* Active Highlight Reverse */ /* This has been edited out for improved appearance regardless of a window device's color settings */ Output Picture X(35) 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 Line 3.000 Column 6.549 Value "Amount" End Literal Field CHECK_AMOUNT Line 3.000 Column 7.326 /* Active Highlight Reverse */ /* This has been edited out for improved appearance regardless of a window device's color settings */ Output "" When CHECK_AMOUNT = 0 /* This clause has been added so that a number can be entered directly, without first deleting the default 0 value */ Output Picture 9,999,99R9.99 Scale -2 Replace Leading "*" Justification Decimal /* Not supported (ignored) in a pixel layout */ 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 Line 3.500 Column .444 Value "Memo" End Literal Field CHECK_MEMO Line 3.500 Column .999 /* Active Highlight Reverse */ /* This has been edited out for improved appearance regardless of a window device's color settings */ Output Picture X(35) 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 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 Display Border Width Is 0 NoShadow Output Picture 9(5) Protected End Field Literal Text Line 4.750 Column 1.221 Value "Enter values; then press CTRL/D to record check," /* The CTRL/D default key binding for the Transmit function applies to more device types than the CTRL/Z binding. */ End Literal Literal Text Line 5.000 Column 1.221 Value "or press CTRL/P to create a file for printing "- "check." End Literal End Panel Panel DEPOSIT_PANEL Literal Rectangle Line 1.375 Column 1.609 Line 3.375 Column 7.492 End Literal Literal Text Line 1.000 Column 2.997 Value "Deposit Record" Display Font Size 18 End Literal Literal Text Line 1.500 Column 1.776 Value "Date:" End Literal Field CURRENT_DATE Line 1.500 Column 2.442 Display Border Width Is 0 NoShadow Output Picture For Date MMMMMMMMMQ' 'DD', 'YYYY Protected End Field Literal Text Line 1.500 Column 5.883 Value "Account" End Literal Field ACCOUNT_NUMBER Line 1.500 Column 6.771 Display Border Width Is 0 NoShadow Output Picture 9(5) Protected End Field Literal Text Line 2.250 Column 2.331 Value "Deposit" End Literal Field DEPOSIT_AMOUNT Line 2.250 Column 3.441 Output "" When DEPOSIT_AMOUNT = 0 /* This clause has been added so that a number can be entered directly, without first deleting the default 0 value */ Output Picture 9,999,99R9.99 Scale -2 Justification Decimal /* Not supported (ignored) in a pixel layout */ 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 Line 3.000 Column 2.331 Value "Memo" End Literal Field DEPOSIT_MEMO Line 3.000 Column 3.441 Output Picture X(35) Use Help Message "Fill in a reminder of where you got the money." End Field Literal Text Line 3.500 Column 1.443 Value "Enter values and then press CTRL/D to finish deposit." /* The CTRL/D default key binding for the Transmit function applies to more device types than the CTRL/Z binding. */ 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