{ include-fileargument &argument-name = "argument-value" }The name of an external operating system file that contains statements you want included during the compilation of a main procedure. If the file you name has an unqualified pathname, ABL searches directories based on the PROPATH environment variable. This filename follows normal operating system naming conventions and is case sensitive on UNIX. In Windows, the pathname cannot include characters outside of the non-Unicode code page. See OpenEdge Development: Internationalizing Applications for more information about Unicode and code pages.When ABL compiles the main procedure (the procedure containing the { } include file reference), it copies the contents of include-file into that procedure, substituting any arguments. So, you can use included procedures with arguments even when you precompile a procedure.With positional arguments, the first argument replaces {1} in the included file, the second argument replaces {2}, and so on.A name/value pair used by include-file as a named argument. The argument-name is the name of the argument you want to pass to the include file. You can use variable names, field names, and reserved words as argument names. The argument-value is the value of the argument you pass to the include file. Enclose the argument-value in quotation marks, as shown.The r-inc1.p procedure uses externally defined and maintained files (r-fcust.i and r-dcust.i) for the layout and display of a customer report. You can use these same include files in many procedures.
FOR EACH Customer NO-LOCK:{r-fcust.i}{r-dcust.i}END.
FORM Customer.CustNum Customer.Name LABEL "Customer Name"Customer.Phone FORMAT "999-999-9999".
DISPLAY Customer.CustNum Customer.Name Customer.Phone.The r-incl2.p example references an include file (r-show.i) that can take up to five arguments, and the main routine passes four arguments.
MESSAGE "At" "{1}" "{2}" {2} "{3}" {3} "{4}" {4} "{5}" {5}.When the main procedure is compiled, the line referencing the r-show.i include file is replaced by the following line:
MESSAGE At point-A var1 9 var2 6.43 var3 yesThis example shows how you can use include files to extend ABL. The main procedure uses a new statement, r-show.i, to display the values of fields or variables at various points in a procedure. The include file in this example can handle up to five passed arguments. The main procedure only passes four (point-A, var1, var2, and var3).The r-custin.p procedure displays a frame for each customer that you can update with customer information. The procedure includes r-cstord.i and passes the named argument &frame-options, and the value of the argument (CENTERED ROW 3 NO-LABEL) to the include file. When the include file references the &frame-options argument, it uses the value of the argument, and therefore displays the OVERLAY frame cust-ord as a centered frame at row 3 without a label.Include files are particularly useful for using form layouts in multiple procedures, especially if you do not include the keyword FORM or the closing period (.) of the FORM statement. Thus, the following r-incl3.p procedure includes the r-cust.f file as the definition of a FORM statement.
FORM {r-cust.f}.
Customer.CustNumCustomer.Name SKIP(2)Customer.StateThe r-incl4.p procedure uses the same include file as a layout for a DISPLAY statement:
FOR EACH Customer NO-LOCK:DISPLAY {r-cust.f} WITH 3 DOWN.END.
If you have many nested include files and you are running on a Sequent machine, use Maximum Files (-Mv) startup parameter to control the number of files you can open simultaneously.
When ABL reads an include file into the source, it appends a space character to the end of an include file. For example, the following include file r-string.i contains data that is used by r-incstr.p.
abcde
DISPLAY LENGTH("{r-string.i}").Although r-string.i contains five letters, when you run r-incstr.p, it returns the value 6 because ABL appends a space character to the end of r-string.i.
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates. |