DEFCNTX and APDFCNTX parameters: Difference between revisions

From m204wiki
Jump to navigation Jump to search
No edit summary
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<var>DEFCNTX</var> {{Template:DEFCNTX parameter subtitle}}
{{Template:DEFCNTX parameter subtitle}}
<p><b>and</b> </p>
<var>APDFCNTX</var> {{Template:APDFCNTX parameter subtitle}}
{{Template:APDFCNTX parameter subtitle}}
   
   
==Summary==
==Summary==
Line 18: Line 18:
   
   
==Description==
==Description==
These parameters provide information about the default file or group context, that is, which file or group is used when a file-based operation is performed without the qualification provided by the <var>[[IN clause|IN]] clause.
These parameters provide information about the default file or group context, that is, which file or group is used when a file-based operation is performed without the qualification provided by the <var>[[Basic SOUL statements and commands#IN clauses|IN]] clause.
 
They are very similar to the <var>[[CURFILE parameter|CURFILE]]</var> parameter, with these differences:
<ul>
<ul>
<li><var>CURFILE</var> returns a null string if the default context is a group.
<li><var>DEFCNTX</var> returns the current default context of the thread: <br />
<li>The first word or two returned by <var>DEFCNTX</var> and <var>APDFCNTX</var>
the most recent successful OPEN statement, OPEN command, or DEFAULT command.
is the type of context: <code>FILE</code>,
<p>For a <var>[[Daemon class|Daemon]]</var> thread, the initial value of <var>DEFCNTX</var> is copied from the master thread if <code>OpenAll=True</code> was specified on the [[New (Daemon constructor)|New]] constructor, otherwise the initial value is the null string.</p>
<code>TEMP GROUP</code>, or <code>PERM GROUP</code>.
<p>The first word or two returned by <var>DEFCNTX</var> is the type of context: <code>FILE</code>, <code>TEMP GROUP</code>, or <code>PERM GROUP</code>. The last word returned by <var>DEFCNTX</var> is the name of the file or group.</p>
<li>The last word returned by <var>DEFCNTX</var> and <var>APDFCNTX</var>
If there is no default context, the value of <var>DEFCNTX</var> is the null string.
is the name of the file or group.
</li>
<li><var>CURFILE</var> is affected by the <var>IN</var> clause prior to a <var>Begin</var> command and
 
can be affected by the <var>In</var> clause prior to many SOUL statements; <var>DEFCNTX</var> and
<li>
<var>APDFCNTX</var> are not affected by (either form of) the <var>IN</var> clause.
<var>APDFCNTX</var> shows the default context when the Apsy command was issued.
<li><var>DEFCNTX</var> provides information about the default context when the request was compiled.
<p class="note"><b>Note:</b> If the default context when an Apsy command was issued is the same as one of the files or groups in the Apsy's definition, <var>APDFCNTX</var> returns the null string.
<li><var>APDFCNTX</var> provides information not about the default context when the request was compiled, but
the context when the Apsy command was issued.
<p class="note"><b>Note:</b> If the default context when an Apsy command was issued is the
same as one of the files or groups in the Apsy's definition, <var>APDFCNTX</var> returns the null string.
</p>
</p>
The first word or two returned by <var>APDFCNTX</var> is the type of context: <code>FILE</code>, <code>TEMP GROUP</code>, or <code>PERM GROUP</code>. The last word returned by <var>APDFCNTX</var> is the name of the file or group.
<p>If there is no default context, the value of <var>APDFCNTX</var> is the null string.</p></li>
</ul>
</ul>
   
   
If there is no default context, the value of the parameters is the null string.
<var>DEFCNTX</var> and <var>APDFCNTX</var> are very similar to the <var>[[CURFILE parameter|CURFILE]]</var> parameter, with these differences:
   
   
<blockquote class="note"><b>Notes:</b> In versions 7.4 and 7.5, these parameters are only available using the <var>$View</var> function, for example:
<ul>
<li><var>CURFILE</var> returns a null string if the default context is a group. </li>
 
<li><var>CURFILE</var> is affected by the <var>IN</var> clause prior to a <var>Begin</var> command and can be affected by the <var>In</var> clause prior to many SOUL statements. <var>DEFCNTX</var> and <var>APDFCNTX</var> are not affected by (either form of) the <var>IN</var> clause. </li>
</ul>
===Usage===
In versions 7.4 and 7.5 of Model&nbsp;204, <var>DEFCNTX</var> and <var>APDFCNTX</var> are only available using the <var>$View</var> function. For example:
<p class="code">print $view('DEFCNTX')</p>
<p class="code">print $view('DEFCNTX')</p>
<ul>
<ul>
<li>Prior to version 7.6, they are not available with the <var>VIEW</var> command.
<li>As of version 7.6, they are available with the <var>VIEW</var> command.</li>
<li>In version 7.4, they were implemented as part of maintenance - Early Warning 740EW159.
 
<li>In version 7.5, they were implemented as part of maintenance - zap 75Z054.
<li>In version 7.4, they were implemented as part of maintenance: Early Warning 740EW159.</li>
 
<li>In version 7.5, they were implemented as part of maintenance: zap 75Z054.</li>
</ul>
 
==See also==
<ul>
<li>The <var>[[CURFILE parameter|CURFILE]]</var> parameter. </li>
<li>The <var>[[$Curfile]]</var> function. </li>
<li>The <var>[[Files,_groups,_and_reference_context#openAndOpenC|Open]]</var> statement.
<li>The <var>[[DEFAULT command|Default]]</var> and <var>[[OPEN FILE command|Open [File]]]</var> commands, which reset the file/group context. </li>
<li>The <var>[[OPENC command|OpenC</var>]] command does <b>not</b> reset the file/group context. </li>
<li>The <var>[[CLOSE command|Close</var>]] command, which might reset the file/group context. </li>
</ul>
</ul>
</blockquote>
   
   
[[Category:User parameters]]
[[Category:User parameters]]
[[Category:Parameters]]
[[Category:Parameters]]

Latest revision as of 16:53, 13 July 2017

Default file or group context

and

Default file or group context when APSY command issued

Summary

Default value
None
Parameter type
User
Where set
View-only
Related products
All
Introduced
Model 204 V7.4 or earlier

Description

These parameters provide information about the default file or group context, that is, which file or group is used when a file-based operation is performed without the qualification provided by the IN clause.

  • DEFCNTX returns the current default context of the thread:
    the most recent successful OPEN statement, OPEN command, or DEFAULT command.

    For a Daemon thread, the initial value of DEFCNTX is copied from the master thread if OpenAll=True was specified on the New constructor, otherwise the initial value is the null string.

    The first word or two returned by DEFCNTX is the type of context: FILE, TEMP GROUP, or PERM GROUP. The last word returned by DEFCNTX is the name of the file or group.

    If there is no default context, the value of DEFCNTX is the null string.

  • APDFCNTX shows the default context when the Apsy command was issued.

    Note: If the default context when an Apsy command was issued is the same as one of the files or groups in the Apsy's definition, APDFCNTX returns the null string.

    The first word or two returned by APDFCNTX is the type of context: FILE, TEMP GROUP, or PERM GROUP. The last word returned by APDFCNTX is the name of the file or group.

    If there is no default context, the value of APDFCNTX is the null string.

DEFCNTX and APDFCNTX are very similar to the CURFILE parameter, with these differences:

  • CURFILE returns a null string if the default context is a group.
  • CURFILE is affected by the IN clause prior to a Begin command and can be affected by the In clause prior to many SOUL statements. DEFCNTX and APDFCNTX are not affected by (either form of) the IN clause.

Usage

In versions 7.4 and 7.5 of Model 204, DEFCNTX and APDFCNTX are only available using the $View function. For example:

print $view('DEFCNTX')

  • As of version 7.6, they are available with the VIEW command.
  • In version 7.4, they were implemented as part of maintenance: Early Warning 740EW159.
  • In version 7.5, they were implemented as part of maintenance: zap 75Z054.

See also

  • The CURFILE parameter.
  • The $Curfile function.
  • The Open statement.
  • The Default and Open [File] 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.