ibm-information-center/dist/eclipse/plugins/i5OS.ic.apiref_5.4.0.1/listUserWOPointer.htm

74 lines
5.0 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="concept" />
<meta name="DC.Title" content="Manipulate a user space without pointers" />
<meta name="abstract" content="When programming in a language that does not support pointers, you can use the Change user space (QUSCHGUS) and Retrieve user space (QUSRTVUS) APIs to manipulate data. However, you must first understand how to use positions and lengths with these APIs." />
<meta name="description" content="When programming in a language that does not support pointers, you can use the Change user space (QUSCHGUS) and Retrieve user space (QUSRTVUS) APIs to manipulate data. However, you must first understand how to use positions and lengths with these APIs." />
<meta name="DC.Relation" scheme="URI" content="listUserSpace.htm" />
<meta name="DC.Relation" scheme="URI" content="listRPG.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="listUserWOPointer" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Manipulate a user space without pointers</title>
</head>
<body id="listUserWOPointer"><a name="listUserWOPointer"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Manipulate a user space without pointers</h1>
<div><p>When programming in a language that does not support pointers,
you can use the Change user space (QUSCHGUS) and Retrieve user space (QUSRTVUS)
APIs to manipulate data. However, you must first understand how to use positions
and lengths with these APIs.</p>
<div class="section" id="listUserWOPointer__Header_42"><a name="listUserWOPointer__Header_42"><!-- --></a><h4 class="sectiontitle">Position values</h4><p>Some APIs return
offset values into a user space. To use other APIs, such as the Retrieve user
space (QUSRTVUS) API, you must use position values to locate bytes.</p>
<p>Position
values and offset values are different ways to express the same thing. An <em>offset
value</em> is the relative distance of a byte from the first byte of the user
space, which has an offset value of 0. A <em>position value</em> is the offset
value plus 1.</p>
<p>For examples of HLL programs that use positions, see Example
in RPG: List Object API.</p>
</div>
<div class="section" id="listUserWOPointer__Header_43"><a name="listUserWOPointer__Header_43"><!-- --></a><h4 class="sectiontitle">Lengths</h4><p>List APIs return the length
of the information in the different sections of the user space, as well as
the length of the list entries in the user space. You should code your application
using the lengths returned instead of specifying the current length returned
by the API or the size of a data structure in the data structure files. The
amount of information returned for any format may increase in future releases,
but the information will be placed at the end of the existing information.
In order for your application to function properly, it should retrieve the
length of the information returned and add that length to a pointer or to
a starting position.</p>
</div>
<div class="section" id="listUserWOPointer__Header_44"><a name="listUserWOPointer__Header_44"><!-- --></a><h4 class="sectiontitle">Using offset values with the change and retrieve
user space APIs</h4><p>When you use the Change User Space (QUSCHGUS) or
Retrieve User Space (QUSRTVUS) API, your application program should first
retrieve the offset value for the information you want. You must then add
one to the offset value to get the starting position for the information.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="listUserSpace.htm" title="The list APIs require a user space for returning information.">User spaces for list APIs</a></div>
</div>
<div class="relref"><strong>Related reference</strong><br />
<div><a href="listRPG.htm" title="This example program prints a report that shows all objects that adopt owner authority.">Example in RPG: List Object API</a></div>
</div>
</div>
</body>
</html>