$Curfile: Difference between revisions

From m204wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 13: Line 13:
<ul>
<ul>
<li>The <var>[[CURFILE parameter|CURFILE]]</var> parameter.
<li>The <var>[[CURFILE parameter|CURFILE]]</var> parameter.
<br/><b>Note:</b> In general, <code>$Curfile</code> is better than <code>$View('CURFILE')</code>.
<br/><b>Note:</b> We  recommend that you use <code>$Curfile</code> rather than <code>$View('CURFILE')</code>; in some circumstances <var>$Curfile</var> returns more accurate information than the <var>CURFILE</var> parameter.
<li>The <var>[[DEFCNTX parameter|DEFCNTX]]</var> parameter (which is quite similar to <var>CURFILE</var> but provides more information) and the <var>[[APDFCNTX parameter|APDFCNTX]]</var> parameter.
<li>The <var>[[DEFCNTX parameter|DEFCNTX]]</var> parameter (which is quite similar to the <var>CURFILE</var> parameter but provides more information) and the <var>[[APDFCNTX parameter|APDFCNTX]]</var> parameter.
<li>The <var>[[DEFAULT command|DEFAULT]]</var> and <var>[[OPEN file command|OPEN]]</var> commands, which reset the file/group context.
<li>The <var>[[DEFAULT command|DEFAULT]]</var> and <var>[[OPEN file command|OPEN]]</var> commands, which reset the file/group context.
<li>The <var>[[OPENC command|OPENC</var>]] command does <b>not</b> reset the file/group context.
<li>The <var>[[OPENC command|OPENC</var>]] command does <b>not</b> reset the file/group context.

Revision as of 21:00, 13 May 2015

The $Curfile function returns the name of the file from which the current record has been selected. If the file is remote, $Curfile also returns the location of the file (in the form filename AT location). $Curfile takes no arguments.

You can use $Curfile in two places:

  • In arithmetic and Print specifications within a record loop
  • In an In clause to override a default file or group in a Store Record statement

See $CURFILE and $UPDATE functions for a discussion of default files and for examples of requests using $Curfile.

You cannot use an In clause that includes both Member and $Curfile. See IN GROUP MEMBER clause for more information about the In Group Member clause.

See also

  • The CURFILE parameter.
    Note: We recommend that you use $Curfile rather than $View('CURFILE'); in some circumstances $Curfile returns more accurate information than the CURFILE parameter.
  • The DEFCNTX parameter (which is quite similar to the CURFILE parameter but provides more information) and the APDFCNTX parameter.
  • The DEFAULT and OPEN commands, which reset the file/group context.
  • The OPENC command does not reset the file/group context.
  • The CLOSE command, which might reset the file/group context.