[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
NNETRDITM()
Reads an item property segment
------------------------------------------------------------------------------
Syntax
NNETRDITM(<cObjName>,<nType>,<cProperty>,[<nSeg>],
[<lMode>],[<cServer>|<nConId>]) --> cPropValue
Netware: 2.2 and 3.11
Arguments
<cObjName> Designates the name of the bindery object that is
processed.
<nType> Designates the object type of <cObjName>. The header file
CTNNET.CH contains symbolic constants for a number of object types.
When you work with numeric values, take into account that, for
efficiency reasons, NNETRDITM() expects the object type in the high-low
format.
<cPropName> Designates the name of the property that is processed.
<cPropName> must describe an item property.
<nSeg> Designates the number of the segment that is read. The
smallest possible number, as well as the default value, is 1.
<lMode> Designates whether the contents of the property are
interpreted as text (<lMode> = .F.) or as binary byte sequence (<lMode>
= .T.). The default value is .F.. If text, NNETRDITM() returns the
characters up to the first occurrence of a terminator 0. In binary
mode, all 128 bytes of the required property segment are returned.
<cServer> Designates the name of the file server for which the
bindery is accessed. Your workstation must be attached to <cServer>.
<nConId> Designates the connection ID of your workstation on
<cServer>.
Returns
NNETRDITM() returns the contents of the specified property segment in
the form of a character string. In text mode, the returned string
contains all characters up to the first occurrence of a terminator 0.
In binary mode, the string always contains 128 characters. If an error
occurs, the function returns an empty string.
Description
NOVELL NET READ ITEM PROPERTY
Internally, Novell Netware defines two property types: item and set
property. With NNETRDITM(), you can read the contents of an item
property. Item properties can contain any type of data. The
information within an item property is organized in segments that have a
constant length of 128 bytes. NNETRDITM() allows you to read single
segments (<nSeg>) of a property (<cPropName>) of a bindery object,
specified by <cObjName> and <nType>. The organization of the
information within a segment depends on the property. With <lMode> you
can specify if segment contains text or a binary sequence (see the
arguments). An example for text mode is the property IDENTIFICATION.
The IDENTIFICATION property contains a bindery object's full name as a
zero-terminated ASCII character string. An example for the binary mode
is the property LOGIN_CONTROL. The property LOGIN_CONTROL contains
binary-coded information about a user's access limits. To avoid
incorrect results when working with binary-coded information, the
parameter <lMode> must be designated .T..
To read all property segments, call NNETRDITM() with an incrementing
value for <nSeg> until NNETRDITM() returns an empty string and
NNETERROR() returns 236.
With the parameters <cServer> or <nConId>, the bindery of any attached
file server can be accessed. The connection ID of a file server is
returned by NNETATTACH() or NNETLOGIN().
The function NNETRDITM() requires sufficient bindery and property access
rights. The necessary property access rights depend on the property
security of the property that is read.
Examples
. Determine the full name of user MIKE:
#include "ctnnet.ch"
? NNETRDITM('MIKE',OBJ_USER,'IDENTIFICATION')
. Determine the date of the last login of user MIKE:
#include "ctnnet.ch"
cBuf=NNETRDITM('MIKE',OBJ_USER,'LOGIN_CONTROL',1,.T.)
IF !EMPTY(cBuf)
dLast= STOD('19'+NTOC(ASC(SUBSTR(cBuf,57,1)),,2,'0');
+NTOC(ASC(SUBSTR(cBuf,58,1)),,2,'0');
+NTOC(ASC(SUBSTR(cBuf,59,1)),,2,'0'))
? dLast
ENDIF
See Also:
NNETRDSET()
NNETWRTITM()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson