2001-03-03 09:56:29 +00:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
<!DOCTYPE gsdoc PUBLIC "-//GNUstep//DTD gsdoc 0.6.6//EN" "http://www.gnustep.org/gsdoc-0_6_6.xml">
|
|
|
|
<gsdoc base="NSFunctions" up="Base">
|
|
|
|
<head>
|
|
|
|
<title>NSFunctions</title>
|
|
|
|
<author name="Richard Frith-Macdonald">
|
|
|
|
<email address="rfm@gnu.org"/>
|
|
|
|
<url url="http://www.gnustep.org/developers/whoiswho.html"/>
|
|
|
|
</author>
|
2001-03-03 09:58:53 +00:00
|
|
|
<version>$Revision$</version>
|
2001-03-03 09:56:29 +00:00
|
|
|
<date>$Date$</date>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<chapter>
|
2001-04-10 03:27:01 +00:00
|
|
|
<heading>Functions</heading>
|
|
|
|
</chapter>
|
|
|
|
<chapter>
|
|
|
|
<heading>Types</heading>
|
|
|
|
<type name="NSRange">
|
|
|
|
<typespec>
|
|
|
|
struct { unsigned long location; unsigned long length; }
|
|
|
|
</typespec>
|
|
|
|
<declared>Foundation/NSRange.h</declared>
|
|
|
|
<desc>
|
|
|
|
<p>
|
|
|
|
The NSRange type is used to specify ranges of locations,
|
|
|
|
typically items in an array, characters in a string, and bytes
|
|
|
|
in a data object.
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
As 'boundary' or 'fencepost' errors are a particularly common
|
|
|
|
problem in programming, it is important that you understand
|
|
|
|
how an NSRange works.
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
An NSRange consists of a location and a length. The points
|
|
|
|
that are considered to lie in a range are the integers from
|
|
|
|
the location to the location plus the length, so the number
|
|
|
|
of points in a range is the length of the range plus one.<br />
|
|
|
|
However, if you consider these points like the marks on a
|
|
|
|
ruler, you can only store information <strong>between</strong>
|
|
|
|
points. So the number of items that can be stored in a range
|
|
|
|
is the length of the range.
|
|
|
|
</p>
|
|
|
|
</desc>
|
|
|
|
<standards><OpenStep/><MacOS-X/><GNUstep/></standards>
|
|
|
|
</type>
|
2001-03-03 09:56:29 +00:00
|
|
|
</chapter>
|
|
|
|
</body>
|
|
|
|
</gsdoc>
|