ibm-information-center/dist/eclipse/plugins/i5OS.ic.cl_5.4.0.1/chghllptr.htm

284 lines
15 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Change HLL Pointer (CHGHLLPTR)</title>
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body bgcolor="white">
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<a name="CHGHLLPTR.Top_Of_Page"></a>
<h2>Change HLL Pointer (CHGHLLPTR)</h2>
<table width="100%">
<tr>
<td valign="top" align="left"><b>Where allowed to run: </b>All environments (*ALL)<br>
<b>Threadsafe: </b>No
</td>
<td valign="top" align="right">
<a href="#CHGHLLPTR.PARAMETERS.TABLE">Parameters</a><br>
<a href="#CHGHLLPTR.COMMAND.EXAMPLES">Examples</a><br>
<a href="#CHGHLLPTR.ERROR.MESSAGES">Error messages</a></td>
</tr>
</table>
<div> <a name="CHGHLLPTR"></a>
<p>The Change High Level Language Pointer (CHGHLLPTR) command allows you to change or copy a pointer variable declared in a high-level language program. The following functions can be requested:
</p>
<ul>
<li>Copy the value of one HLL pointer into another HLL pointer variable.
</li>
<li>Set a HLL pointer variable to point to a variable in the program.
</li>
<li>Set the value of the HLL pointer variable to a null pointer.
</li>
</ul>
<p>HLL pointers are pointer variables that are declared in the source of an HLL program; they are contrasted with internal compiler-created pointers. Compiler-created pointers are pointer variables that are declared in the machine-interface (MI) program, by a compiler, to support various processing functions. Not all languages allow the user to declare HLL pointers.
</p>
<p><b>Restrictions:</b>
</p>
<ul>
<li>You can use this command only in debug mode. To start debug mode, refer to the Start Debug (STRDBG) command.
</li>
<li>You cannot use this command if you are servicing another job, and that job is on a job queue, or is being held, suspended, or ended.
</li>
</ul>
<ul>
<li>You cannot use this command to change variables in a bound program.
</li>
<li>You cannot use this command to change variables that are write-protected or within the system domain, unless the user has service (*SERVICE) special authority.
</li>
</ul>
</div>
<table width="100%">
<tr><td align="right"><a href="#CHGHLLPTR.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div>
<h3><a name="CHGHLLPTR.PARAMETERS.TABLE">Parameters</a></h3>
<table border="1" cellpadding="4" cellspacing="0">
<!-- col1="10" col2="15" col3="30" col4="10" -->
<tr>
<th bgcolor="aqua" valign="bottom" align="left">Keyword</th>
<th bgcolor="aqua" valign="bottom" align="left">Description</th>
<th bgcolor="aqua" valign="bottom" align="left">Choices</th>
<th bgcolor="aqua" valign="bottom" align="left">Notes</th>
</tr>
<tr>
<td valign="top" rowspan="3"><a href="#CHGHLLPTR.PTR"><b>PTR</b></a></td>
<td valign="top">Pointer to be changed</td>
<td valign="top"><i>Element list</i></td>
<td valign="top" rowspan="3">Required, Positional 1</td>
</tr>
<tr>
<td valign="top">Element 1: Program variable</td>
<td valign="top">
<i>Character value</i></td>
</tr>
<tr>
<td valign="top">Element 2: Basing pointer variable</td>
<td valign="top">
Values (up to 5 repetitions): <i>Character value</i></td>
</tr>
<tr>
<td valign="top" rowspan="3"><a href="#CHGHLLPTR.REFPTR"><b>REFPTR</b></a></td>
<td valign="top">Pointer to be copied</td>
<td valign="top"><i>Element list</i></td>
<td valign="top" rowspan="3">Optional, Positional 2</td>
</tr>
<tr>
<td valign="top">Element 1: Program variable</td>
<td valign="top">
<i>Character value</i></td>
</tr>
<tr>
<td valign="top">Element 2: Basing pointer variable</td>
<td valign="top">
Values (up to 5 repetitions): <i>Character value</i></td>
</tr>
<tr>
<td valign="top" rowspan="3"><a href="#CHGHLLPTR.ADR"><b>ADR</b></a></td>
<td valign="top">Address to be pointed to</td>
<td valign="top">Single values: *NULL<br>Other values: <i>Element list</i></td>
<td valign="top" rowspan="3">Optional</td>
</tr>
<tr>
<td valign="top">Element 1: Program variable</td>
<td valign="top">
<i>Character value</i></td>
</tr>
<tr>
<td valign="top">Element 2: Basing pointer variable</td>
<td valign="top">
Values (up to 5 repetitions): <i>Character value</i></td>
</tr>
<tr>
<td valign="top"><a href="#CHGHLLPTR.PGM"><b>PGM</b></a></td>
<td valign="top">Program</td>
<td valign="top"><i>Name</i>, <b><u>*DFTPGM</u></b></td>
<td valign="top">Optional</td>
</tr>
<tr>
<td valign="top"><a href="#CHGHLLPTR.RCRLVL"><b>RCRLVL</b></a></td>
<td valign="top">Recursion level</td>
<td valign="top"><i>Integer</i>, <b><u>*LAST</u></b></td>
<td valign="top">Optional</td>
</tr>
</table>
<table width="100%">
<tr><td align="right"><a href="#CHGHLLPTR.Top_Of_Page">Top</a></td></tr>
</table>
</div>
<div> <a name="CHGHLLPTR.PTR"></a>
<h3>Pointer to be changed (PTR)</h3>
<p>Specifies the name of the pointer (program variable) whose value is to be changed, allowing the pointer to point to a different address.
</p>
<p>This is a required parameter.
</p>
<p><b>Element 1: Program variable</b>
</p>
<dl>
<dt><b><i>character-value</i></b></dt>
<dd>Specify the name of the pointer variable whose value is to be changed. The pointer variable must be an HLL pointer (HLLPTR). An MI ODV number cannot be specified for the variable name, even though the variable that it defines is an HLL pointer. The name must be enclosed in apostrophes if it contains special characters.
<p>If the pointer to be changed is in an array, the subscripts representing the element in the array to be changed must be specified. Up to 132 characters may be specified for this pointer (program variable) entry. This includes any qualifiers, subscripts, embedded blanks, parentheses, and commas. It does not include the enclosing apostrophes when special characters are used. An integer, MI ODV number, or numeric variable name can be specified for a subscript. For more information on changing program variables during testing, refer to the CL information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
</p>
</dd>
</dl>
<p><b>Element 2: Basing pointer variable</b>
</p>
<dl>
<dt><b><i>character-value</i></b></dt>
<dd>Specify the name of a basing pointer variable. In some languages, the pointer to be changed may be based on a pointer variable. This set of values allows you to explicitly specify as many as 5 basing pointers for the pointer to be changed. The basing pointers must be a HLL pointer (HLLPTR). An MI ODV number cannot be specified for the name, even though the pointer that defines it is an HLL pointer. Each basing pointer name must be enclosed in apostrophes if it contains special characters. If the basing pointer is an array, the subscripts representing an element in the array must be specified. Up to 132 characters can be specified for a basing pointer name. This includes any qualifiers, subscripts, embedded blanks, parentheses, and commas. It does not include the enclosing apostrophes when special characters are used.
<p>For more information, refer to "Parameter values used for testing and debugging" in "CL concepts and reference" in the CL concepts and reference topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
</p>
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CHGHLLPTR.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CHGHLLPTR.REFPTR"></a>
<h3>Pointer to be copied (REFPTR)</h3>
<p>Specifies the pointer variable whose value is to be copied into the pointer identified on the <b>Pointer to be changed (PTR)</b> parameter.
</p>
<p><b>Element 1: Program variable</b>
</p>
<dl>
<dt><b><i>character-value</i></b></dt>
<dd>Specify the name of the pointer variable whose value is copied into the specified pointer. The pointer variable must be an HLL pointer (HLLPTR). An MI ODV number cannot be specified for the variable name, even though the variable that it defined is an HLL pointer. The name must be enclosed in apostrophes if it contains special characters. If the pointer to be copied is in an array, the subscripts representing the element in the array to be copied must be specified. Up to 132 characters may be specified for this pointer variable. This includes any qualifiers, subscripts, embedded blanks, parentheses, and commas. It does not include the enclosing apostrophes when special characters are used. An integer, MI ODV number, or numeric variable name can be specified for a subscript.
</dd>
</dl>
<p><b>Element 2: Basing pointer variable</b>
</p>
<dl>
<dt><b><i>character-value</i></b></dt>
<dd>Specify the name of a basing pointer variable. The pointer (program variable) may be based on a pointer variable. This set of values allows you to explicitly specify as many as 5 basing pointers for the pointer to be copied. The basing pointer must be an HLL pointer (HLLPTR). An MI ODV number cannot be specified for the name, even though the pointer that defines it is an HLL pointer. Each basing pointer name must be enclosed in apostrophes if it contains special characters. If the basing pointer is an array, the subscripts representing an element in the array must be specified. Up to 132 characters can be specified for a basing pointer name. This includes any qualifiers, subscripts, embedded blanks, parentheses, and commas. It does not include the enclosing apostrophes when special characters are used.
<p>For more information, refer to "Parameter values used for testing and debugging" in "CL concepts and reference" in the CL concepts and reference topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
</p>
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CHGHLLPTR.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CHGHLLPTR.ADR"></a>
<h3>Address to be pointed to (ADR)</h3>
<p>Specifies the program variable (if any) to which the specified HLL pointer is to point.
</p>
<p><b>Single values</b>
</p>
<dl>
<dt><b>*NULL</b></dt>
<dd>The HLL pointer is set to null; it no longer points to the address of any space object, and it no longer contains a space pointer or any type of pointer value.
</dd>
</dl>
<p><b>Element 1: Program variable</b>
</p>
<dl>
<dt><b><i>character-value</i></b></dt>
<dd>Specify the name of the variable to which the HLL pointer is to point. An HLL variable name must be entered; an MI ODV number cannot be used. The name must be enclosed in apostrophes if it contains special characters. If an array is specified without subscripts, the pointer is set to the address of the first element in the array. Up to 132 characters may be specified for this program variable. This includes any qualifiers, subscripts, embedded blanks, parentheses, and commas. It does not include the enclosing apostrophes when special characters are used. An integer, MI ODV number, or numeric variable name can be specified for a subscript.
<p>For more information, refer to "Parameter values used for testing and debugging" in "CL concepts and reference" in the CL concepts and reference topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
</p>
</dd>
</dl>
<p><b>Element 2: Basing pointer variable</b>
</p>
<dl>
<dt><b><i>character-value</i></b></dt>
<dd>Specify the name of a basing pointer variable. In some languages, the program variable to be changed may be based on a pointer variable. This set of values allows you to explicitly specify as many as 5 basing pointers for the variables to be addressed. The basing pointers must be HLL pointers (HLLPTR). An MI ODV number cannot be specified for the name, even though the pointer that defines it is an HLL pointer. Each basing pointer name must be enclosed in apostrophes if it contains special characters. If the basing pointer is an array, the subscripts representing an element in the array must be specified. Up to 132 characters can be specified for a basing pointer name. This includes any qualifiers, subscripts, embedded blanks, parentheses, and commas. It does not include the enclosing apostrophes when special characters are used.
<p>For more information, refer to "Parameter values used for testing and debugging" in "CL concepts and reference" in the CL concepts and reference topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
</p>
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CHGHLLPTR.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CHGHLLPTR.PGM"></a>
<h3>Program (PGM)</h3>
<p>Specifies the name of the program that contains the pointer whose value is to be changed.
</p>
<dl>
<dt><b><u>*DFTPGM</u></b></dt>
<dd>The program previously specified as the default program contains the pointer whose value is to change.
</dd>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the program that contains the pointer whose value is to be changed. The name must already have been specified in the Start Debug (STRDBG) or Add Program (ADDPGM) command.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CHGHLLPTR.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="CHGHLLPTR.RCRLVL"></a>
<h3>Recursion level (RCRLVL)</h3>
<p>Specifies which recursion level of the program contains the variable whose value is to be changed. Changes made to static variables automatically affect all recursion levels. Recursion level 1 is the first (or earliest) call of the program, recursion level 2 is the second call of the program, and so on to the last (most recent) recursion level in the stack. For example, if program A calls program B, then program B calls program A, a new recursion level of program A is formed. If the first call of program A contains the variable to be changed, a value of 1 must be specified for the <b>Recursion level (RCRLVL)</b> parameter. Some high-level languages also allow recursive procedures. For these programs, refer to the appropriate high-level language manual for more information.
</p>
<dl>
<dt><b><u>*LAST</u></b></dt>
<dd>The last (most recent) call of the specified program contains the variable to be changed.
</dd>
<dt><b><i>integer</i></b></dt>
<dd>Specify the recursion level of the program that contains the variable to be changed.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#CHGHLLPTR.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="CHGHLLPTR.COMMAND.EXAMPLES">Examples</a> </h3>
<p><b>Example 1: Setting a Pointer to a Variable Address</b>
</p>
<p>
<pre>
CHGHLLPTR PTR(STACKPTR) ADR(FIRSTELEM)
</pre>
</p>
<p>This command sets the pointer STACKPTR to the address of the variable FIRSTELEM.
</p>
<p><b>Example 2: Copying the Value of a Pointer</b>
</p>
<p>
<pre>
CHGHLLPTR PTR(NEXT@) REFPTR(CURRENT@)
</pre>
</p>
<p>This command copies the value of the pointer CURRENT@ into the pointer NEXT@. The value copied could be a null pointer.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#CHGHLLPTR.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="CHGHLLPTR.ERROR.MESSAGES">Error messages</a> </h3>
<p>None
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#CHGHLLPTR.Top_Of_Page">Top</a></td></tr>
</table>
</body>
</html>