Copyright: Copyright ©1994 MH Software All Rights Reserved


Contents
dGPLIB - NetWare API Library

Table of Contents

License Agreement

Ordering Information

General Information About dGPLIB

How to access dGPLIB

Function List

Bindery Services

Connection & Drive Services

File & Directory Services

Message Services

Miscellaneous

Printing Services

Server Environment

TTS/Semaphore Services

Frequently Asked Questions

About Default Servers

What's New

Registration Program

Enhancement Requests

Upgrades

Technical Support

File List


Function List
dGPLIB Function List

Bindery Services

N_AccessDate()

N_ChangePassword()

N_Equivs()

N_GroupMembers()

N_GroupsIn()

N_MemberOf()

N_PwdDate()

N_ScanBindery()

N_SecurityEquivalent()

N_UserName()

N_VerifyPassword()

Connection & Drive Services

N_Attached()

N_ClearStation()

N_ConnNum()

N_DefaultServer()

N_DriveBase()

N_DriveCount()

N_DriveList()

N_DrivePath()

N_DriveRel()

N_LogOff()

N_LoggedIn()

N_Login()

N_LoginDate()

N_LoginTime()

N_MapDelete()

N_MapDrive()

N_ServerAttach()

N_ServerDetach()

N_ServerFromDrive()

N_Servers()

N_StationAddress()

N_UserID()

File & Directory Services

N_ConnsUsing()

N_DirInfo()

N_FileInfo()

N_FilesOpen()

N_GetLocks()

N_SetAttr()

N_TrusteeList()

N_TrusteeModify()

N_TrusteeRemove()

N_Volumes()

Message Services

N_MsgBroadcast()

N_MsgMode()

N_MsgRetrieve()

N_SendFromServer()

N_SendToServer()

Miscellaneous

AboutdGPLIB()

Flag()

Make_Dir()

N_MRUListRemove()

N_ShellVersion()

NWStoD()

Ofs2RecNo()

Rem_Dir()

Printing Services

N_BannerUserName()

N_CapMode()

N_DeleteQJob()

N_ListQJobs()

N_MoveQJob()

N_QueueStatus()

N_ReadPParms()

N_StorePParms()

Server Environment

N_ConsoleOperator()

N_LIStat()

N_MaxConns()

N_SYSTime()

N_SerialNo()

N_ServerDate()

N_ServerTime()

N_ServerVers()

TTS/Semaphore Services

N_SetSemaphore()

N_TTSAvailable()

N_TTSBegin()

N_TTSCommit()

N_TTSRollBack()


NWStoD()
NWStoD() - NetWare date format to date variable conversion

Description

The purpose of this function is to convert a NetWare date string in the format YYYYMMDD to a dBASE variable of type DATE.

Usage

NWStoD( cString )

cString is a string in format YYYYMMDD.

Return Values

The string value converted to a date variable.  If an empty string is passed, an null date is returned.

Comments

NWStoD() is included with dGPLIB as a dBASE program.

Source Code

Function NWStoD

* NetWare String to date function

Parameter cString

private y, m, d, cDate, cAnswer

if empty(cString)

return {}

endif

y=left(cString,4)

d=right(cString,2)

m=substr(cString,5,2)

cDate=set('DATE')

do case

case cDate='MDY' .or. cDate='AMERICAN'

cAnswer=M+'/'+d+'/'+Y

case cDate='ANSI'

cAnswer=Y+'.'+m+'.'+d

case cDate="BRITISH" .or. cDate="FRENCH" .or. cDate='DMY'
cAnswer=d+'/'+M+'/'+y

case cDate='GERMAN'

cAnswer=d+'.'+m+'.'+y

case cDate='ITALIAN'

cAnswer=d+'-'+m+'-'+y

case cDate='JAPAN' .or. cAnswer='YMD'

cAnswer=y+'/'+m+'/'+d

case cDate='USA'

cAnswer=m+'-'+d+'-'+y

otherwise

msgbox('Unknown date formatting.  Check function '+;

'NWStoD() and modify if necessary for local date type')

endcase

return ctod(cAnswer)


N_AccessDate
N_AccessDate()	Return date or time user last accessed the network.

See Also:	Example

Description

Return the date or time the specified user last accessed the network.

Usage

N_AccessDate( cUserID ,  1 || 2 )

cUserID user ID to get the last network access time for.

If the second parameter is 1, the last login date will be returned as a variable of type character.

If the second parameter is 2, the last login time will be returned as a character string.

Return Values

Last network access date, or time depending on the second paramter.

Comments

To use this routine to get the last login date for any person besides the person operating the program, you must be a supervisor equivalent, equivalent to that user, or manager over that user.


N_AccessDate See Also
NWStoD()

N_PwdDate()


N_AccessDate Example
N_AccessDate() Example

Copy Example

?N_AccessDate(N_UserID(), 1)

19940704

?N_AccessDate(N_UserID(), 2)

12:05:47

*  This example demonstrates a house cleaning routine that will put

*  an entry in the system error log when accounts are inactive.

*  You must be a supervisor or equivalent for this program to work.

aUserArray=new object()

N_ScanBindery(aUserArray,1)

set printer to f:\system\sys$log.err

set print on

?

? Padc(" Inactive Account Warnings ",78,'*')

?

for n=1 to alen(aUserArray,1)

    if date()-NWStoD(N_AccessDate(aUserArra[n,1],1)) > 180

        ?	'User '+aUserArray[n,1]+' has not logged in since '+;

                N_AccessDate(aUserArray[n,1],1)

    endif

endfor

?

? replicate("*",78)

set print off

set printer to


N_ChangePassword
N_ChangePassword()	Change Bindery Object Password

See Also:	Example

Description

The purpose of this function is to change a bindery object password.  The bindery object may be a user, print server, job server, etc.

Usage

N_ChangePassword( cObjectID, cOldPassword, cNewPassword [, nObjectType] )

cObjectID is the name of the object to change the password for.

cOldPassword is the current password for the object.  If the person using this routine is a supervisor equivalent, then a null string may be passed.  This allows you to change the passwords for all users programatically.

cNewPassword is the new password for the object.

nObjectType is the type of object to change the password for.  If this optional parameter is not passed, the default object type is 1 (user).

Return Values

0000	Success

0x89d7	Password Not Unique

0x89d8	Password too short

0x89f8	No Property Write Privilege

0x89ff	No Such Object Or Bad Password

Comments

This function does no validation to ensure that a password is valid.  It is recommended that you use the sample validation routine provided.


N_ChangePassword See Also
N_PwdDate()

N_ScanBindery()

N_VerifyPassword()


N_ChangePassword Example
N_ChangePassword() Example

Copy Example

*

*	Change the current users password

*

store space(127) to cOldPass, cNewPass

clear

@5,5 Say 'Enter Old Password : ' Get cOldPass Picture '@S40'

@7,5 Say 'Enter New Password : ' Get cNewPass Picture '@S40'

read

if GoodPass(cOldPass) .and. GoodPass(cNewPass)

    cResult=N_ChangePassword(N_UserID(), cOldPass, cNewPass)

    if cResult <> '0000'

        ?'Password Change Failed! '+cResult

    else

        ?'Password Change successful!'

    endif

endif

Function GoodPass

*

* Description:

*

*	Provide a simple password validation routine

Parameter cPassWord

private n, c, lOk

lOk=not empty(cPassword)

cPassWord=upper(alltrim(cPassword))

for n=1 to len(cPassword)

    c=substr(cPassword,n,1)

    lOk=lOk and (isalpha(c) or isdigit(c) or c=='_')

endfor

return lOk


N_Equivs
N_Equivs()	Return all objects a specifed user is equivalent to

See Also:	Example

Description

This function creates an array containing a list of objects the specified user is equivalent to.

Usage

N_Equivs( cUserID, oObjVar )

cUserID is the user ID to get equivalent listings for.  cUserID may not contain wild-cards.

oObjVar is the object variable to store the array in.

Return Values

Number of objects the user is equivalent to.  Creates a two dimensional array containing the name,  object type, and object ID of objects the user is equivalent to.  These objects can include user groups, or other users.


N_Equivs See Also
N_GroupsIn()

N_SecurityEquivalent()


N_Equivs Example
N_Equivs() Example

Copy Example

aObjs=new object()

n=N_Equivs(N_UserID(),aObjs)

for i=1 to alen(aObjs,1)

    ?aObjs[n,1]

endfor


N_GroupMembers
N_GroupMembers()	Return list of users in a group

See Also:	Example

Description

The purpose of this function is to create a list of members of a specified user group.

Usage

N_GroupMembers( cGroupName, oObjVar )

cGroupName is the name of the group to examine.

oObjVar is the object variable to store the created array in.

Return Values

Number of members of the group.  Creates a two dimensional array containing the User ID, Object Type, and Object ID for members of the specified group.


N_GroupMembers See Also
N_Equivs()

N_GroupsIn()

N_SecurityEquivalent()


N_GroupMembers Example
N_GroupMembers() Example

Copy Example

Function SendGroup

*

*	Purpose:	Send message to users who are logged in, and are part of a

*   specified group.  If no group is specified, group EVERYONE is assumed.

*

parameters cMessage, GroupName

private NumStations, n, StationCount, iLastMode, aMembers, nUsers

cMessage = alltrim(cMessage)

if len(cMessage) > 55 .or. len(cMessage) = 0

    return - 1

endif

if empty(cGroupName)

    cGroupName = "EVERYONE"

else

    cGroupName = alltrim(cGroupName)

endif

iLastMode = N_MsgMode(1)	&& set it so we don't get our own Message

StationCount = 0

aMembers=new object()

nUsers=N_GroupMembers(cGroupName, aMembers)

for n = 1 to nUsers

    if N_LoggedIn(aMembers[n,1])

        StationCount = StationCount + N_MsgBroadcast(aMembers[n,1], cMessage )

    endif

endfor

N_MsgMode(iLastMode)

return StationCount


N_GroupsIn
N_GroupsIn()	Return a list of groups the specified user is in.

See Also:	Example

Description

The purpose of this function is to create an array containing a list of groups the specified user is a member of.

Usage

N_GroupsIn( cUserID, oObjVar )

cUserID is the user ID to get equivalent listings for.

oObjVar is the object variable to store the created array in.

Return Values

Number of groups the user is a member of.  Creates an array containing the names of groups the user is in, the object type, and the object ID for the group.


N_GroupsIn See Also
N_Equivs()

N_GroupMembers()

N_ScanBindery()

N_SecurityEquivalent()


N_GroupsIn Example
N_GroupsIn() Example

Copy Example

aGroups=new object()

n=N_GroupsIn(N_UserID(), aGroups)

for i=1 to n

    ?aGroups[n,1]

endfor


N_MemberOf
N_MemberOf()	Return Group Membership

See Also:	Example

Description

The purpose of this function is to return true if the person specified is a member of a specified group.

Usage

N_MemberOf( cUserName, cGroupName )

cUserName is the name of the person to check membership for.

cGroupName is the name of the group to check membership for.

Return Values

.T. if user is member of specified group, .F. otherwise.

Comments

An interesting place to use this function is in the MENU Builder, enabled  condition.  This allows you to have menu options that are only available if the person is a member of the appropriate group.


N_MemberOf See Also
N_ScanBindery()

N_SecurityEquivalent()


N_MemberOf Example
N_MemberOf() Example

Copy Example

if .not. N_MemberOf(N_UserID(), 'HR')

    MsgBox('Error! You are not authorized to execute this program!',;

            'Error')

    CANCEL

endif


N_PwdDate
N_PwdDate()	Return date user's password expires.

See Also:	Example

Description

Return the date a user's password expires

Usage

N_PwdDate( [ cUserID ] )

cUserID is the optional user ID to get the date for.

Return Values

Date network password expires as a character string

Comments

To get the password for any user besides himself, the person executing this program must equivalent to that user, a manager over that user, or a supervisor equivalent.

If your program is logging users into servers and password expiration is enabled, then your program should call this function to determine whether it is necessary to change the users password.


N_PwdDate See Also
NWStoD()

N_AccessDate()

N_ChangePassword()

N_UserName()


N_PwdDate Example
N_PwdDate() Example

Copy Example

?N_PwdDate()

19940505

cResult=N_Login(cUserID, cPassword, cServer)

if cResult=='0000'

dPassDate=NWStoD(N_PwdDate())

if dPassDate <= date()

* code to change user password here

endif

else

MsgBox('Error logging into server')

endif


N_ScanBindery
N_ScanBindery()	Return Array listing all objects in bindery.

Example

Description

Return an array containing a list of all objects in the bindery.

Usage

N_ScanBindery( oObjVar [, nObjectSpec, cObjectSpec, cServerName ] )

oObjVar is the object variable to store the created array in.

nObjectSpec is an optional specifier that limits objects returned.  If this parameter is not passed, all objects are returned.

cObjectSpec limits the object returned to those that have names matching cObjectSpec.  cObjectSpec can include the wild-card characters * and ?.

cServerName is an optional specifier that permits reading the bindery of a server besides the default server.

Return Values

The number of matches in the bindery.  Creates a two dimensional array with three columns that contain the Object Name, Object ID, and the Object Type as a hexidecimal string.

Object Type meanings:

0000h	Unknown

0001h	User

0002h	User Group

0003h	Print Queue

0004h	File Server

0005h	Job Server

0006h	Gateway

0007h	Print Server

0008h	Archive Queue

0009h	Archive Server

000Ah	Job Queue

000Bh	Administration

0024h	Remote Bridge Server

0045h	Advertising Gateway Server?

0047h	Advertising Print Server

0048h	Advertising TCP IP Gateway Server?

0066h	Advertising Archive Server?

0107h	Remote Console (NetWare 3.X REMOTE.NLM, RSPX.NLM)

030Ch	HP Laserjet Print Server

8000h 	Reserved up to 8000h

8002h 	LanPort/Netport

FFFFh	Wild

All object types above 8000h are available for developers to use as they see fit.  One interesting example of this is MicroTest LanPort/Intel NetPort devices have an object type of 8002h.


N_ScanBindery Example
N_ScanBindery() Example

Copy Example

* Get a list of users

a=new object()

?N_ScanBindery(a,1)

* get a list of users from server ENGINEERING

?N_ScanBindery(a,1,'*','ENGINEERING')

* get a list of available servers

?N_ScanBindery(a,4)


N_SecurityEquivalent
N_SecurityEquivalent()	Return Security Equivalence

See Also:	Example

Description

The purpose of this function is to return true if the person on the executing machine is equivalent to the specified user.

Usage

N_SecurityEquivalent( cUserToCheck, cUserName )

cUserToCheck is the name of the person to check equivalence for.

cUserName is the name of the user to check equivalence with.

Return Values

.T. if cUserName is equivalent to cUserToCheck, .F. otherwise.


N_SecurityEquivalent See Also
N_Equivs()

 N_MemberOf()


N_SecurityEquivalent Example
N_SecurityEquivalent() Example

Copy Example

If .not. N_SecurityEquivalent( N_UserID(), 'Supervisor')

    MsgBox('You must be a supervisor equivalent to run this program!')

    CANCEL

endif


N_UserName
N_UserName()	Return full name of a specified user or station.

See Also:	Example

Description

Return the full user name for the connection number specified.  If no connection number is specified, the full name for the user logged in on the executing machine is returned.  Optionally, you may specify the character name of a USER OBJECT only, and get the full name.  At this time, you cannot specify the character name for a Print Server, or other object.

Usage

N_UserName( iStationNumber || cLoginID )

iStationNumber is the optional station number to get the name for.

cLoginID is the optional name of the LoginID to get the name for.

Return Values

Full name as entered in the NetWare bindery.  If no full name is specified the function returns < (OBJECT TYPE) - No Full Name >.


N_UserName See Also
N_ScanBindery()

N_UserID()


N_UserName Example
N_UserName() Example

Copy Example

?N_UserName(2)

Bill Smith

?N_UserName('BillS')

Bill Stanley, x2322

?N_UserName(3)

< User - No Full Name >

*  Display a list of users currently logged in,

*  and their full names

nMax_Conns=N_MaxConns()

for n=1 to nMax_Conns

    if len(N_UserID(n))>0

        ?str(n,3), padr(N_UserID(n),12),;

                padr(N_UserName(n),40), N_LoginDate(n), ;

                N_LoginTime(n)

    endif

endfor


N_VerifyPassword
N_VerifyPassword()	Verify a users password

See Also:	Example

Description

The purpose of this function is to verify a user's network password.  Using this function, a programmer can force a user to reenter his network password before entry into an application.  This simplifies network & application administration, by not requiring multiple passwords for applications.  An additional benefit of this method is the users password stays stored in the bindery.  Using this procedure provides an additional layer of security in case your users leave their computers logged in at a system menu.

Usage

N_VerifyPassword( cPassWord )

cPassWord is the user's Novell NetWare password.

Return Values

0000	Successful (Password Correct)

0x89c5	Account Locked By Intruder Lockout Detection

0x89f0	Wildcard Not Allowed

0x89fb	No Such Property

0x89fc	No Such Object

0x89fe	Server Bindery Locked

0x89ff	Failure (No such object or bad password)

Comments

If your network has intruder detection lockout turned on, and a call is made to this routine unsuccessfully <N> times, the account for that user will be locked.


N_VerifyPassword See Also
N_ChangePassword()

N_MemberOf()

N_SecurityEquivalent()


N_VerifyPassword Example
N_VerifyPassword() Example

Copy Example

Store space(127) to PassWord

@5,5 Say 'Please enter password for entry to payroll files ' ;

Get PassWord Picture "@S40"

Read

PassWord=Alltrim(PassWord)

if N_VerifyPassword(PassWord)<>'0000'

    MsgBox('Error Access Denied!')

    CANCEL

endif

*  Main application for payroll


N_Attached
N_Attached()	Return whether workstation is attached to a file server.

See Also:	Example

Description

Return whether a workstation is attached to the specified file server.

Usage

N_Attached( cServerName )

cServerName is the server name to check.

Return Values

.T. if attached, .F. otherwise.


N_Attached See Also
N_Login()

N_LogOff()

N_ServerAttach()

N_ServerDetach()


N_Attached Example
N_Attached() Example

Copy Example

?N_Attached('MHS')

.T.

?N_LogOff('MHS',.t.)

0000

?N_Attached('MHS')

.f.


N_ClearStation
N_ClearStation()	Clear Specified station

See Also:	Example

Description

The purpose of this function is to clear the specified network station number.

Usage

N_ClearStation( iStationNumber )

iStationNumber is the station number to clear.

Returns

.T. if the specified station was cleared successfully, .F. otherwise.

Comments

You must be a supervisor equivalent to execute this command.

WARNING

DO NOT CLEAR YOUR OWN STATION AS A TEST!  Under certain versions of NetWare, this can cause the server to not recognize your connection until it has been manually deleted at the server.  This can have the effect of making your network interface card appear defective.  If you have to manually delete your connection at the server and you are running NetWare 3.10, ensure that you have the latest version of monitor.nlm, otherwise clearing that connection may cause an ABEND on your server.


N_ClearStation See Also
N_ConnNum()

N_SecurityEquivalent()

N_UserID()


N_ClearStation Example
N_ClearStation() Example

Copy Example

*  Clear all users logged in as GUEST prior

*  to packing DBF.  NOTE:  THE RESULTS OF CLEARING A CONNECTION WITH

*  READ/WRITE PRIVELIGES TO AN OPEN DBF ARE UNDEFINED, AND YOU

*  AS PROGRAMMER ACCEPT FULL RESPONSIBILITY FOR YOUR ACTIONS.

*

for n= 1 to N_MaxConns()

    if N_UserID(n)=='GUEST'

        N_ClearStation(n)

    endif

endfor


N_ConnNum
N_ConnNum()	Return NetWare station number.

See Also:	Example

Description

Return the NetWare connection number for the current machine.  Each time a station logs into a NetWare file server, it is issued a connection number.  This number will vary from 1 to the number corresponding to your NetWare License limit.

Usage

N_ConnNum()

Return Values

The NetWare station number as an integer.


N_ConnNum See Also
N_StationAddress()

N_UserID()


N_ConnNum Example
N_ConnNum() Example

Copy Example

ScratchFile='$T'+alltrim(str(N_ConnNum()))+'TEMP.FIL'

copy structure to (ScratchFile)

use (scratchFile) ALIAS Scratch

*  Perform some kind of processing

use

erase (scratchFile)


N_DefaultServer
N_DefaultServer()	Read/Set the name of the default server

See Also:	Example

Description

Read/Set the name of the default server

Usage

N_DefaultServer( [cServerName] )

cServerName is an optional parameter.  If passed, N_DefaultServer() changes the default server to cServerName.

Return Values

The function returns the name of the current default server.  If cServerName is passed, then that server is made the new default server for the current window and the name of the previous default server is returned.

Please read the information in About Default Servers.  This information is critical to using dGPLIB in a multi-server environment.


N_DefaultServer See Also
About Default Servers

N_MRUListRemove()

 N_Servers()


N_DefaultServer Example
N_DefaultServer() Example

Copy Example

*  Display a list of users currently logged in, and their full names

*  on the engineering server.

cLastServer=N_DefaultServer("ENGINEERING")

Max_Conns=N_MaxConns()

for n=1 to Max_Conns

    if len(N_UserID(n))>0

        ?str(n,3), padr(N_UserID(n),12),;

                padr(N_UserName(n),40),N_LoginDate(n), ;

                N_LoginTime(n)

    endif

endfor

N_DefaultServer(cLastServer)


N_DriveBase
N_DriveBase()	Return base portion of mapped drive.

See Also:	Example

Description

This function returns the base portion of the path for a mapped drive.

Usage

N_DriveBase( cDrive )

cDrive is the drive letter to check.

Return Values

Base portion of the drive path.


N_DriveBase See Also
N_DriveList()

 N_DrivePath()

N_DriveRel()

N_MapDelete()

N_ServerFromDrive()


N_DriveBase Example
N_DriveBase() Example

Copy Example

N_MapDrive('SYS:','G')

?N_DriveBase('G')

SYS:

SET DEFA TO G:

SET DEFA TO (N_USERID())

?N_DriveBase('G')

SYS:

?N_DriveRel('G')

GEORGES

?N_MapDrive('SYS:USERS','G')  && Note a "fake root"

?N_DriveBase('G')

SYS:USERS


N_DriveCount
N_DriveCount()	Return number of local drives

Example

Description

Return the number of drives that NetWare considers the local station to have.

Usage

N_DriveCount()

Return Values

Number of local drives on the machine as an integer value.


N_DriveCount Example
N_DriveCount() Example

Copy Example

?'Your first NetWare drive letter is '+chr(65+N_DriveCount())+':.'

*	This second example demonstrates how to find the first

*	drive letter mapped to SYS of the default server.

Function GetSYSLtr

*  The purpose of this function is to get the next available drive letter

Private Start

Start=chr(65+N_DriveCount())

do while Start < '['

    if N_ServerFromDrive(start)=N_DefaultServer() .and. ;

                N_DrivePath(start)='SYS:'

        Exit

    else

        Start=Chr(ASC(Start)+1)

    endif

Enddo

if start='Z'

    MsgBox('Unable to find drive mapped to SYS: on Def. Server','Error')

    cancel

else

    Return Start

endif


N_DriveList
N_DriveList()	Return a list of available drives.

See Also:	Example

Description

This function returns a list of available drives on the workstation.

Usage

N_DriveList( oObjVar, [ iMask ] )

oObjVar is the object variable to store the created array in.

iMask is the optional drive mask to limit the types of drives returned.  If this parameter is not included, all drives are returned.  Allowed values are:

0	All Drives

1	Local Drives Only (Fixed and Removable)

2	Remote Drives Only (Fixed and Removable)

4	Removable Drives Only (Local and Remote)

5	Local Removable Drives Only

6	Remote Removable Drives Only

8	Fixed Drives Only (Local and Remote)

9	Local Fixed Drives Only

10	Remote Fixed Drives Only

Return Values

The function returns the number of drives matching the desired drive-type.  The function creates a two-dimensional, three-column array containing information about the drives on the calling workstation.

Column 1 is the drive letter

Column 2 is .T. if the drive is remote, .F. if local.

Column 3 is .T. if the drive is removable, .F. if Fixed.

Comments

This function uses standard DOS interrupt calls to make it's list.  Therefore, this function will work with any NOS (Banyan Vines, LanMan, NetWare, etc).

With some versions of the Microsoft CD-ROM driver, a CD-ROM will apear as a REMOTE-FIXED drive.  This is a function of how the MSCDEX driver is implemented.


N_DriveList Example
N_DriveList() Example

Copy Example

aDrives=new object()

N_DriveList(aDrives)

for n=1 to alen(aDrives,1)

    ?'Drive: '+aDrives[n,1],;

            iif(aDrives[n,2],'REMOTE','LOCAL'),;

            iif(aDrives[n,3],'REMOVABLE','FIXED')

endfor

* Local Removable Drives

?N_DriveList(aDDrives,5)

* Local Fixed Drives

?N_DriveList(aDrives,9)


N_DrivePath
N_DrivePath()	Return Path for a drive letter.

See Also:	Example

Description

Return the full NetWare path for a mapped drive.

Usage

N_DrivePath( cDriveLetter )

cDriveLetter is the drive letter to return the path for.

Return Values

The NetWare path of the drive letter as a character string.  The path will be in the format <Volume>:<PATH>.  If the drive is not mapped, the function returns a null string.


N_DrivePath See Also
N_DriveCount()

N_DriveList()

N_MapDelete()

N_MapDrive()

N_ServerFromDrive()


N_DrivePath Example
N_DrivePath() Example

Copy Example

N_MapDrive('sys:public','G')

?N_DrivePath('g')

SYS:PUBLIC


N_DriveRel
N_DriveRel()	Return relative portion of drive mapping.

See Also:	Example

Description

This function returns the relative part of a mapped drive path.  When a drive is mapped, the path consists of two portions.  The first, the BASE or ROOT path contains the volume name, or the volume + directory name for drives mapped to a fake root.  The second portion is the relative path the rest of the drive letter refers to.

Usage

N_DriveRel( cDriveLetter )

cDrive Letter is the drive to return the relative path for.

Return Values

Relative part of a mapped drive.


N_DriveRel See Also
N_DriveBase()

N_DriveList()

N_MapDelete()

N_MapDrive()


N_DriveRel Example
N_DriveRel() Example

Copy Example

?N_DriveRel('Z')	&& Z: mapped to SYS:PUBLIC

PUBLIC

?N_DriveBase('Z')

SYS:


N_LogOff
N_LogOff()	Logout from a specified file server.

See Also:	Example

Description

Log the user out of the specified file server

Usage

N_LogOff( cServerName [, lDetach] )

cServerName is the name of the server to logout from.

lDetach is an optional parameter.  If .T., then you will be detached from the specified server once you are logged out.  If .F., you will be left attached to the specified server once you are logged out.

Return Values

.T. if successful, .F. otherwise.

Comments

If you use the detach option of this function, you must reset the server to a valid server (refer to example).

YOU MUST CLOSE ALL OPEN FILES ON THE TARGET SERVER BEFORE LOGGING OUT.  FAILURE TO DO SO WILL RESULT IN PROGRAM ERRORS AND POSSIBLE DATA CORRUPTION.

Please read the section entitled About Default Servers before using dGPLIB in a multi-server environment.


N_LogOff See Also
About Default Servers

 N_Login()

N_ServerDetach()


N_LogOff Example
N_LogOff() Example

Copy Example

cServer=N_DefaultServer()	&& Save current server

*  Login to the engineering server and copy a file to it then logout.

N_Login("Engineering","Joe","BLOW")

N_MapDrive("G","SYS:DBDATA","ENGINEERING")

copy file dataFile.dbf to g:\dbdata\datafile.dbf

N_LogOff('ENGINEERING',.T.)

N_DefaultServer(cServer)	&& Restore old server


N_LoggedIn
N_LoggedIn()	Return whether a specified user is logged in.

See Also:	Example

Description

Return whether a specified user is logged into the network.

Usage

N_LoggedIn( cUserID )

cUserID is the name of the user to check login status for.

Return Values

.T. if specified user is logged into the default server, .F. otherwise.


N_LoggedIn See Also
N_MsgBroadcast()


N_LoggedIn Example
N_LoggedIn() Example

Copy Example

IF N_LoggedIn('SUPERVISOR')

    N_MsgBroadcast("SUPERVISOR", "The payroll program is being accessed by "+;

            N_UserID())

ENDIF

*  Access the payroll program

USE PAYROLL


N_Login
N_Login()	Login to file server.

See Also:	Example

Description

Log a station into a file server.

Usage

N_Login( cLoginID, cPassword, cServerName )

cLoginID is the login ID to use.

cPassword is the password for the login ID specified.

cServerName is the servers name.

Return Values

NetWare completion code:

0000	Successful

0x89c5	Intruder Detection Activated

0x89dc	Account Disabled

0x89fc	No Such Object

0x89fe	Login Disabled

0x89ff	No Response From Server

Comments

If the login attempt was unsuccessful, you will still be attached to the server you tried to login to.

Executing this command WILL NOT execute either the system login script, or the users specific login script.  It will be up to your program to provide any drive-mappings, or captures that would normally be done via the login script.

Please read the information in About Default Servers before using dGPLIB in a multi-server environment.

If the user's password expires, and you use all available grace logins, then the account will be locked.  If your program will be logging into servers and password expiration has been set, your program should call the N_PwdDate() function, and take appropriate action if the password has expired.


N_Login See Also
About Default Servers

 N_LogOff()

N_MRUListRemove()

N_PwdDate()

N_ServerAttach()

N_ServerDetach()


N_Login Example
N_Login() Example

Copy Example

set talk off

clear

store space(48) to userid, pword, s_name

&& Note: password can actually be 127 characters long

@3,5 Say "Server Name : " get s_name

@7,5 Say "User ID : " Get Userid

@9,5 Say "Password: " Get Pword

read

s_name=alltrim(s_name)

userid=alltrim(userid)

pword=alltrim(pword)

cResult=N_Login(userid,pword,s_name)

if cResult == '0000'

    MsgBox('Successfully logged in to file server : '+s_name)

else

    MsgBox('Login FAILED.  Result code was :'+cResult)

endif


N_LoginDate
N_LoginDate()	Get a workstations login date

See Also:	Example

Description

Read the login date for a specified workstation.

Usage

N_LoginDate( [iWorkStation] )

If iWorkStation is not passed, the login date for the user on the current station is returned, otherwise the login date for the user on the specified work-station is returned.

Return Values

Login date for specified work-station.


N_LoginDate See Also
NWStoD()

N_LoginTime()

N_UserID()

N_UserName()


N_LoginDate Example
N_LoginDate() Example

Copy Example

?N_LoginDate() && Print login date as date variable for my station

19940618

For n= 1 to N_MaxConns()

    if empty(N_UserID(n))

  loop

    else

  if (Date()-NWStoD(N_LoginDate(n))) > 1

        	? N_UserID(n)+' Logged in at '+N_LoginTime(n)+;

    dtoc(NWSToD(N_LoginDate(n)))+;

                ' and has not logged out as of : '+dtoc(date())

  endif

    endif

EndFor


N_LoginTime
N_LoginTime()	Get a workstations login time

See Also:	Example

Description

Read the login time for a specified workstation.

Usage

N_LoginTime( [iWorkStation] )

If iWorkStation is not passed, the login time for the user on the current station is returned, otherwise the login time for the user on the specified work-station is returned.

Return Values

Login time for specified work-station.


N_LoginTime See Also
N_LoginDate()

N_UserID()

N_UserName()


N_ServerAttach
N_ServerAttach()	Attach to a file server.

See Also:

Description

Attach to a NetWare file server but not login.

Usage

N_ServerAttach(  cServerName )

cServerName is the name of the file server to attach to.

Return Values

0000	Successful

0x8800	Already Attached to Server

0x8801	Invalid Connection

0x8847	No Server

0x89fc	Unknown File Server

Comments

This function allows you to attach to different servers without logging in or out.  This permits you to perform some operations, such as getting the maximum number of connections, the server date and time, etc. without logging into that server.

Also note that you can only be logged in or attached to 8 file servers using the NetX shells.  Using the VLM shells you can attach to more than 8 servers.


N_ServerAttach See Also
N_Attached()

N_DefaultServer()

N_Login()

N_LogOff()

N_ServerDetach()


N_ServerDetach
N_ServerDetach()	Detach from file server.

See Also:	Example

Description

Detach from a specified file server.

Usage

N_ServerDetach( cServerName )

cServerName is the name of the server to detach from.

Return Values

.T. if successful, .F. otherwise.

Comments

YOU MUST CLOSE ALL OPEN FILES ON A SERVER BEFORE DETACHING OR LOGGING OUT.  FAILURE TO DO SO WILL RESULT IN PROGRAM ERRORS AND POSSIBLE FILE CORRUPTION.


N_ServerDetach See Also
About Default Servers

 N_Attached()

N_Login()

N_LogOff()

N_ServerAttach()


N_ServerDetach Example
N_ServerDetach() Example

Copy Example

cServer=N_DefaultServer()

N_Login('JOEB',cPassWord,'ENGINEERING')

if N_ServerDetach('ENGINEERING')

    ?'connection to engineering server cleared'

endif

N_DefaultServer(cServer)


N_Servers
N_Servers()	Create array with attached servers

See Also:	Example

Description

The purpose of this function is to create an array that contains a list of all servers the current workstation is attached to.

Usage

N_Servers( aObject )

aObject is the object to store the server list into.

Return Values

Returns the number of servers the workstation is currently attached to.


N_Servers See Also
N_Login()

N_LogOff()

N_ScanBindery()

N_ServerAttach()

N_ServerDetach()


N_Servers Example
N_Servers() Example

Copy Example

*

*	Print the servers currently attached to

*

aServers=new object()

N_Servers(aServers)

for n=1 to alen(aServers,1)

    ?aServers[n]

endfor

release aServers


N_StationAddress
N_StationAddress() 	 Return Physical station Address

See Also:	Example

Description

Return the 20 digit network node address of the specified station.  If no station is specified, return the address of the current station.  This number is unique on the network.

Usage

N_StationAddress( [nStation] )

nStation is the optional station number to get the network address for.

Return Values

8 digit logical network number:12 digit physical node address in hexadecimal


N_StationAddress See Also
N_ConnNum()

N_UserID()


N_StationAddress Example
N_StationAddress() Example

Copy Example

?N_StationAddress()

00000001:0006EADF0003


N_UserID
N_UserID()	Return NetWare User ID

See Also:	Example

Description

Return the NetWare user ID of a station.  If the station is not logged in, the function returns a null string.

Usage

N_UserID( [iStationNumber] )

iStationNumber is the optional station number to retrieve the Login ID for.  If this parameter is ommitted, the Login ID of the person on the executing station will be returned.


N_UserID See Also
N_LoginDate()

N_LoginTime()

N_UserName()


N_UserID Example
N_UserID() Example

Copy Example

use Journal

Append Blank

Replace User_ID with N_UserID(), Date with ;

        N_ServerDate(), Action with "Added record to personnel file."

select Personnel

Append Blank

Edit

Close Data

*

*	The second example shows a UserList function

*

Private nMaxConns, nWorkArea

nWorkArea=select()

nMaxConns=N_MaxConns()

create temp structure extended

append blank

replace field_name with 'station', field_type with 'N', field_len with 4

append blank

replace field_name with 'UserID', field_type with 'C', field_len with 30

append blank

replace field_name with 'FullName', field_type with 'C', field_len with 40

append blank

replace field_name with 'LogDate', field_type with 'D', field_len with 8

append blank

replace field_name with 'LogTime', field_type with 'C', field_len with 8

append blank

replace field_name with 'Address', field_type with 'C', field_len with 21

create Temp2 from temp

for n=1 to nMaxConns+2

    if len(N_UserID(n))>0

        append blank

        replace ;

                Station with n,;

                UserId with N_UserID(n),;

                Fullname with N_UserName(n),;

                LogDate with NWStoD(N_LoginDate(n)),;

                LogTime with n_LoginTime(n), ;

                address with N_StationAddress(n)

    endif

endfor

go top

browse fields Station ,;

        UserID ,;

        Fullname ,;

        LogDate ,;

        LogTime ,;

        Address ;

        Title 'Logged in Users' ;

        noinit noappend nodelete nomodify

use

select (nWorkArea)


N_ConnsUsing
N_ConnsUsing()	Return a list of stations using a specified file.

See Also:	Example

Description

This function creates an array containg a list of stations/tasks using the specified file.

Usage

N_ConnsUsing( oObjVar, cFileName)

oObjVar is the object variable to store the created array in.

cFileName is the name of the file to check.

Return Values

The number of stations/tasks that have the specified file open.  The function creates a two-column array containing a list of stations/tasks that have the specified file open.  Column 1 is the station number, and column 2 is the task number.

The function returns as a numeric value the number of stations that have the specified file open.

Comments

The user on the executing workstation must be a NetWare Console Operator in order to call this function.  For more information on Console Operator status, please refer to your NetWare Concepts Manual.

With the advent of Microsoft Windows and other multi-tasking environments, more than one "task" on a work-station can have file open on one station.

This function only works on NetWare 3.11 and higher.


N_ConnsUsing See Also
N_ConsoleOperator()

N_GetLocks()


N_ConnsUsing Example
N_ConnsUsing() Example

Copy Example

private nResult, ok, n

ok=.f.

do while .not. ok

    aUsers=new object()

    nResult=N_ConnsUsing(aUsers,'ACCOUNTS.DBF')

    if nResult=0

        use accounts exclusive

        pack

        use

        ok=.t.

    else

        for n=1 to alen(aUsers,1)

            N_MsgBroadcast(N_UserID(aUsers[n,1]),;

                    'PLEASE CLOSE ACCOUNTS DATABASE IMMEDIATELY!')

        endfor

        inkey(60)

    endif

    release aUsers

enddo

* the second example activates a browse form

* showing users who have a file open

parameter cFileName

local cDBFName, cTempFile, nOpen, aConnections, f, b

set talk off

if empty(cFileName)

   cFileName=GetFile("*.*",'Select File To Examine')

else

   cFileName=upper(alltrim(cFileName))

endif

if empty(cFileName)

   return

endif

#include dGPLIB.h

aConnections=new object()

nOpen=N_ConnsUsing(aConnections, cFileName)

if nOpen==0

   MsgBox(cFileName+' is not open by any stations on the network.')

   return

endif

cTempFile=fUnique()

create (cTempFile) structure extended

append blank

replace field_name with 'STATION', field_type with 'N', field_len with 4

append blank

replace field_name with 'Task', field_type with 'N', field_len with 4

append blank

replace field_name with 'USER_ID', field_type with 'C', field_len with 30

append blank

replace field_name with 'USER_NAME', field_type with 'C', field_len with 30

cDbfname=fUnique()

create (cDbfName) from (cTempFile)

use (cDBFName) alias CUSING nosave exclusive

erase (cTempFile+'.DBF')

append from array aConnections

replace all User_ID with N_UserID(station), ;

   user_name with N_UserName(station)

go top

f=new form()

f.autosize=.t.

f.mdi=.f.

b=new browse(f)

b.fields="station \h='Station' \10,task \h='Task #'"+;

   "\6,User_ID \h='User ID' \30, User_Name \h='User Name' \30"

b.append=.f.

b.modify=.f.

b.toggle=.f.

f.text='Stations Using '+cFileName

f.width=110

b.width=108

b.height=20

f.ReadModal()

use


N_DirInfo
N_DirInfo()	Return directory information.

See Also:	Example

Description

The purpose of this function is to return the directory owner, and effective rights mask for a specified directory.

Usage

N_DirInfo( cDirName )

cDirName is the directory name

Return Values

Character string containing the User ID of the directory owner, and the effective rights mask.

Comments

Rights lists are returned in NetWare 386 format.  The Supervisory right flag is NOT returned.


N_DirInfo Example
N_DirInfo() Example

Copy Example

?N_DirInfo('SYS:PUBLIC')

SUPERVISOR,R    F

?N_DirInfo('Z:')	&& Mapped to SYS:Public

SUPERVISOR,R    F


N_FileInfo
N_FileInfo()	Return information about a file or files.

See Also:	Example

Description

This function returns the NetWare specific information about a particular file or files.  This function is implemented as a find-first/find-next system.

Usage

N_FileInfo( cFileSpec , 0 || 1 )

cFileSpec is the file specification to return information about.

0 is passed on the initial call, and 1 is passed on the second and subsequent calls.

Return Values

The function returns information about the file in a comma-delimited list.  The format is:

<FileName>, <FileSize>, <FileDate>, <FileTime>, <Attribute Flags>, <Owner Name>, <Last Access Date>, <Creation Date>, <Creation Time>, <Last Archived Date>, <Last Archived Time>


N_FileInfo See Also
N_DirInfo()

N_SetAttr()


N_FileInfo Example
N_FileInfo() Example

Copy Example

set talk off

cFileSpec='SYS:USERS\'+N_UserID()+'\*.*'

create temp structure extended

append blank

replace field_name with 'NAME', field_type with 'C', field_len with 14

append blank

replace field_name with 'SIZE', field_type with 'N', field_len with 12

append blank

replace field_name with 'DATE', field_type with 'D', field_len with 8

append blank

replace field_name with 'TIME', field_type with 'C', field_len with 8

append blank

replace field_name with 'Attr', field_type with 'C', field_len with 20

append blank

replace field_name with 'OWNER', field_type with 'C', field_len with 30

append blank

replace field_name with 'ACCDATE', field_type with 'D', field_len with 8

append blank

replace field_name with 'CreatDat', field_type with 'D', field_len with 8

append blank

replace field_name with 'CreatTim', field_type with 'C', field_len with 8

append blank

replace field_name with 'ArcDate', field_type with 'D', field_len with 8

append blank

replace field_name with 'ArcTime', field_type with 'C', field_len with 8

create temp2 from temp

use temp2

cInfo=N_FileInfo(cFileSpec,0)

do while .not. empty(cInfo)

    append blank

    replace name with DelElem(cInfo,',',1), ;

            size with val(DelElem(cInfo,',',2)), ;

            date with NWStoD(DelElem(cInfo,',',3)), ;

            time with DelElem(cInfo,',',4), ;

            Attr with DelElem(cInfo,',',5), ;

            Owner with DelElem(cInfo,',',6), ;

            AccDate with NWStoD( DelElem(cInfo,',',7)), ;

            CreatDat with NWStoD( DelElem(cInfo,',',8)), ;

            creatTim with DelElem(cInfo,',',9), ;

            ArcDate with NWStoD( DelElem( cInfo,',',10)), ;

            ArcTime with DelElem(cInfo,',',11)

    cInfo=N_FileInfo(cFileSpec,1)

enddo

go top

browse

use

Function DelElem

Parameter cTemp, cDelimiter, nElement

Private cElement, cList

cList=cTemp

if right(cList,1)<>cDelimiter

    cList=cList+cDelimiter

endif

if nElement > 1

    cList=substr(cList, at(cDelimiter, cList, nElement-1)+1)

endif

cElement=substr(cList,1,at(cDelimiter,cList)-1)

return cElement


N_GetLocks
N_GetLocks()	Return list of record/file locks for a file.

See Also:	Example

Description

The purpose of this function is to return a list of record and file locks that workstations have on a particular file.

Usage

N_GetLocks( oObjVar, cFileName )

oObjVar is the object variable to store the created array in.

cFileName is the name of the file to get the lock status for.

Return Values

Upon successful completion, the function creates a four column array.  The array structure is:

Connection Number

Task Number

Starting Byte Offset for Record Lock as a hexadecimal string

Ending Byte Offset for Record Lock as a hexadecimal string

One row will be created for each record lock or file lock on the file.  In the case of a file lock, there will always be only one row returned.

The function returns the number of record locks on the specified file.

Comments

This function can be useful for finding out what station has a record lock, or a file locked.  This can be extremely useful in troubleshooting "deadly-embrace" situations.

The person executing this function must be a console operator.  For more information on Console Operators,  refer to your NetWare concepts manual.

This function only returns shared-mode file and record locks.  If a file is used exclusively, it will not be reported by this function because it is not "locked", it is opened non-shareable.  Only files that have FLOCK()'s or RLOCKS()'s against them will be returned.

Under Windows, and other multi-tasking operating systems, more than one task can have a file open, or have records locked.

It is not possible to "peek ahead" to determine what stations are requesting a lock.  Short of placing an NLM on the server that would monitor lock calls, the only method of determining this is through the use of a hardware monitor.  One such monitor would be a Sniffer by Network General.

There is a bug in NetWare versions 3.11 and 3.12.  This bug causes this function to return garbage if more than 23 record locks are applied to a file.  The NetWare 3.12 patch is available in the NOVLIB forum on CompuServe.  The 3.11 patch is available from MH Software on request.  The patch name is GLOCKFIX.NLM.


N_GetLocks See Also
N_ConnsUsing()

N_ConsoleOperator()

Ofs2RecNo()


N_GetLocks Example
N_GetLocks() Example

Copy Example

cFile=Getfile('DBF','Select Database:')

if empty(cFile)

    return

endif

declare aLocks[1]

if (N_GetLocks(aLocks,cFile) > 0)

    create temp structure extended

    append blank

    replace field_name with 'Station', field_type with 'N', field_len with 4

    append blank

    replace field_name with 'Task', field_type with 'N', field_len with 3

    append blank

    replace field_name with 'StOffs', field_type with 'N', field_len with 12

    append blank

    replace field_name with 'EndOffs', field_type with 'N', field_len with 12

    append blank

    replace field_name with 'RECNO', field_type with 'N', field_len with 8

    append blank

    replace field_name with 'UserID', field_type with 'C', field_len with 30

    create temp2 from temp

    append from array aLocks

    replace all UserID with N_UserID(Station), ;

   recno with Ofs2RecNo(stoffs,endoffs)

    browse

    use

endif

return


N_MapDelete
N_MapDelete()	Delete a drive mapping.

See Also:

Description

Delete a network drive mapping.

Usage

N_MapDelete( cLetter )

cLetter is the drive letter to delete.

Return Values

0000	Success

0x899b	Bad Directory Handle


N_MapDelete See Also
N_DriveBase()

N_DriveList()

N_DrivePath()

N_DriveRel()

N_MapDrive()

N_ServerFromDrive()


N_MapDrive
N_MapDrive()	Map a drive

See Also:	Example

Description

The purpose of this function is to map a drive on the network.

Usage

N_MapDrive( cPath, cLetter )

cPath is the path

cLetter is the drive letter.

Return Values

0000	Success

0x8998	Volume Does Not Exist

0x899c	Path Does Not Exist

0x89ff	Path Not Locatable


N_MapDrive See Also
N_DriveList()

N_DrivePath()

N_MapDelete()

N_ServerFromDrive()


N_MapDrive Example
N_MapDrive() Example

Copy Example

?N_MapDrive('sys:public','M')

0000

?N_MapDrive('SYS:DBDATA','M','ENGINEERING')

&& Map drive m to SYS:DBDATA on the ENGINEERING server.

?N_MapDrive('M:','N')


N_ServerFromDrive
N_ServerFromDrive()	Return Server name.

See Also:	Example

Description

Return the name of the file server that a drive is mapped to.

Usage

N_ServerFromDrive( cDriveLetter )

cDriveLetter is the drive letter to check.

Return Values

Server name as character string.  This function should not be called with local drives.  Generally speaking it will return a null string.  However, when used on a CDROM drive with certain versions of MSCDEX and VLM.EXE, this function generates an error.


N_ServerFromDrive See Also
N_DriveBase()

N_DriveCount()

N_DrivePath()

N_DriveRel()

N_MapDelete()

N_MapDrive()


N_ServerFromDrive Example
N_ServerFromDrive() Example

Copy Example

#include dGPLIB.H

Private a, n

a=new object()

N_DriveList(a)	&& Get a list of drives to check

*	Define a macro to check if a drive is a network drive

#define IsNetDrive(x) (upper(left(x,1)) > chr( asc('A')-1+N_DriveCount()))

for n=1 to alen(a,1)

if IsNetDrive(a[n,1])

*

* Note the check to make sure this is a network

* drive before this call.  This is to work around

* bugs in the NetWare/MSCDEX interface.

*

?a[n,1],N_ServerFromDrive(a[n,1])

else

?a[n,1],'Local Drive'

endif

endfor


N_SetAttr
N_SetAttr()	Set extended attributes of a file.

See Also:	Example

Description

Set the extended attribute flags of a file on a NetWare file server.

Usage

N_SetAttr( cFileSpec, cAttribs)

cFileSpec is the file specification to process.  It may include the DOS wild-card characters * and ?.

cAttribs are the attribute flags to modify.  The flags are set in the format +<attribute> or -<Attribute>.  Valid attribute flags are listed below.

H	Hidden

A	Archive

R	Read Only

Y	System

X	Execute Only

S	Shareable

T	Transactional

I	Indexed (NetWare 2.2 and lower)

Return Values

Number of files that had their attributes modified.

Comments

Once a file is marked Transactional, it cannot be deleted.  This also means that you cannot pack a DBF that is marked transactional.

If you flag a DBF transactional, please make sure that you flag all associated files (DBT, MDX, etc) Transactional also.

Care should be used when marking files Execute Only.  This setting cannot be reversed.  Some programs have overlays in the main .EXE file.  Flagging these files X will cause them to no longer run.


N_SetAttr See Also
N_DirInfo()

N_FileInfo()


N_SetAttr Example
N_SetAttr() Example

Copy Example

?N_SetAttr('*.PRO','+S+R')

97


N_TrusteeList
N_TrusteeList()	Create a trustee list for a directory.

See Also:	Example

Description

The purpose of this function is to create an array containing a list of trustees for a specified file or directory.

Usage

N_TrusteeList( oObjVar, cPath )

oObjVar is the object variable to store the created array in.

cPath is the path or file name to return the trustee list for.

Return Values

Creates a two dimensional array where column 1 is the object name and column 2 is the object type, and column 3 is the rights mask for the object.  Returns as an integer the number of trustees found.

If the directory does not exist, you do not have rights to that directory, or there are no trustees, the function returns 0.


N_TrusteeList See Also
N_TrusteeModify()

N_TrusteeRemove()


N_TrusteeList Example
N_TrusteeList() Example

Copy Example

*

*	Find users with rights to root of SYS

*

a=new object()

?N_TrusteeList(a,'SYS:')

For a more detailed example, refer to the file DIRINFO.WFM that accompanies this program.


N_TrusteeModify
N_TrusteeModify()	Modify the trustee rights for a user or group.

See Also:	Example

Description

The purpose of this function is to modify the trustee rights for a user or group for a specified file or directory.

Usage

N_TrusteeModify( cPath, cFlags, cObject [,iObjectType, cServer] )

cPath is the file or directory name to change trustee rights for.

cFlags are the new permissions to assign to the directory or path.  Allowed flags are:

R	Read

W	Write

C	Create

E	Erase

A	Access Control

F	File Scan

M	Modify

S	Supervisory

N	Normal (All rights but A and S)

ALL	All rights

iObjectType is an optional parameter specifying object type.  The default value is 1 (USER).  Allowed values are:

1	User

2	User Group

cServer is the optional server where the file resides.  If this parameter is not passed, the default server is assumed.

Return Values

0000	Success

0x880f	Invalid Server

0x8998	Volume Does Not Exist

0x899c	Path or File Does Not Exist

0X89fc	No Such Object

0x89ff	No Rights To Modify Trustee

Comments

In order to use this function, you must have ACCESS control rights to the directory or file you specify.

Rights granted to a file apply only to that instance of the file.  For example, if you grant rights to a file, and then pack the file, all users will lose rights to the packed file.  This is because the packed file is actually a new directory entry.


N_TrusteeModify See Also
N_TrusteeList()

N_TrusteeRemove()


N_TrusteeModify Example
N_TrusteeModify() Example

Copy Example

use ACCOUNTS

PACK

USE

* Grant read rights to group everyone for the accounts table

N_TrusteeModify('ACCOUNTS.DBF','RF','EVERYONE',2)

* Grant rights to my user directory to another user

* on the engineering server

N_TrusteeModify('SYS:USERS\'+N_UserID(),'ALL','CAROL',1, 'ENGINEERING')

* Grant the same rights on the default server

N_TrusteeModify('SYS:USERS\'+N_UserID(),'ALL','CAROL')


N_TrusteeRemove
N_TrusteeRemove()	Remove a trustee from the specified path or file.

See Also:	Example

Description

The purpose of this function is to remove a trustee from the specified path or file.

Usage

N_TrusteeRemove( cPath, cObject [, iObjectType] )

cPath is the file or directory name to remove the trustee from.

cObject is the name of the user or group to remove trusteeship for.

iObjectType is an optional parameter that specifies the type of object you are dealing with.  Allowed values are 1 USER and 2 USER GROUP.  The default object type if this parameter is not passed is 1, USER.

Return Values

0000	Success

0x89f0	Wild Cards Not Allowed

0x89fc	No Such Object (Verify the right object type is used)

0x89ff	Invalid Trustee/Insufficient Rights

Comments

You must have the ACCESS control privilege for the specified directory.


N_TrusteeRemove See Also
N_TrusteeList()

N_TrusteeModify()


N_TrusteeRemove Example
N_TrusteeRemove() Example

Copy Example

* Revoke group everyone's rights to accounts table

* on engineering server

N_TrusteeRemove('ACCOUNTS.DBF','EVERYONE',2, 'ENGINEERING')

* Revoke directory rights from a user for my directory

N_TrusteeRemove('SYS:USERS\'+N_UserID(),'CAROL')

* Revoke directory rights from a user for my directory on

* engineering's server

N_TrusteeRemove('SYS:USERS\'+N_UserID(),'CAROL', 1, 'ENGINEERING')


Registration Information
Ordering Information

Order Form

You may test the demonstration version of dGPLIB, but if you continue to use it, you must purchase it.

Registered users will receive a printed and bound manual, and a diskette containing the latest version of dGPLIB.  Registered users also dGPLIB get free updates via CompuServe for one year.  When you purchase dGPLIB you will be given a serial number and an activation key.  You can use this to initialize the latest version of the software as it is placed on CompuServe.  For example: you  purchase dGPLIB, two months later, when a new version is released, you can download the new files from CompuServe.  You can then register the new program  using the Serial Number and Activation Key you were given at registration.

Shipping

MAIL

Normal US Shipment is via 2nd Day US Mail.  Normal International Shipment is via small-packet air mail.  Delivery times to Europe average about 7 days

Federal Express

Shipment via Federal Express is also available.  If you desire next day shipment or traceable shipment your order should be sent via Federal Express.

Electronic Notification

If you include your Internet or CompuServe ID with your order form, you will also electronically receive your serial number and activation key.

Purchase Orders

Purchase orders are accepted from US and Canadian companies and foreign subsidiaries of US companies.  You may fax your purchase order to (303) 469-9679.  Payment terms are Net 30.

Turnaround Time

Generally, all orders are processed the same day they are received.  If your order is received by 3:00 MST, you will receive electronic notification that day, and your order within the time specified in the shipping section.

Credit Cards

We accept Visa, MasterCard, and American Express for payment.  To order using your credit card, please complete the credit card ordering information section of the dGPLIB order form.


N_Volumes
N_Volumes()	Create array containing mounted volumes on server.

See Also:	Example

Description

The purpose of this function is to create an array containing a list of mounted volumes on a NetWare file server.

Usage

N_Volumes( oObjVar, cServerName )

oObjVar is the object variable to store the created array in.

cServerName is the server name to get the list from.

Return Values

Number of volumes mounted on server.  Creates an array containing the following information about the voumes:

Column	Description

1	Volume Name

2	Sectors Per Block

3	Total Number of Blocks

4	Available Number of Blocks

5	Total Number of Directory Entries

6	Available Directory Entries

7	Removable Flag ( .T. if drive removable)

Comments

The total volume size can be calculated with the following formula:

Size= SectorsPerBlock*512*TotalNumberOfBlocks

The disk free space can be calculated as:

Free= SectorsPerBlock*512*AvailableNumberofBlocks


N_Volumes See Also
N_DirInfo()


N_Volumes Example
N_Volumes() Example

Copy Example

aTest=new object()

?N_Volumes(aTest, N_DefaultServer())

2

disp memory

test	Pub   A [1,7]

[1,1]	"SYS"

[1,2]	16

[1,3]	63723

[1,4]	34172

[1,5]	23360

[1,6]	8570

[1,7]	.F.


N_MsgBroadcast
N_MsgBroadcast()	Send a message to another network user.

See Also:	Example

Description

Send a broadcast message to other workstations on the network.

Usage

N_MsgBroadcast(  cUserID, cMessage )

cUserID is the Login ID to send the message to.

cMessage is the message to send.  cMessage may be up to 55 characters long.

Return Values

The number of stations the message was sent to.


N_MsgBroadcast See Also
N_MsgMode()

N_MsgRetrieve()

N_SendFromServer()


N_MsgBroadcast Example
N_MsgBroadcast() Example

Copy Example

clear

Store space(55) to Msg

store space(48) to UserID

@5,5 Say "Please enter the message : " Get MSG Picture "@S30"

@7,5 Say "Enter the users name     : " Get UserID picture "@S30"

Read

Result=N_MsgBroadcast(Alltrim(UserID), msg)

If result > 0

    MsgBox("The message was sent to "+alltrim(UserID)+" on "+;

            alltrim(str(result))+" station(s).")

else

    MsgBox("The message was not sent to "+alltrim(UserID))

endif


N_MsgMode
N_MsgMode()	Read/Set Current Broadcast Mode

See Also:	Example

Description

Read/Return the current broadcast mode setting for the work station.

Usage

N_MsgMode( [iState] )

iState is an optional parameter.  If this parameter is not passed, the current mode is returned.  If this parameter is passed, then the message mode will be set to that specified.  Valid modes are:

0	Equivalent to CASTON.  All messages will be received

1	Equivalent to CASTOFF. Messages from server will be accepted.  Messages from users will be discarded.

2	Equivalent to CASTOFF /ALL.  Messages from both the server, and other workstations will be disregarded.  Messages from the server will be saved, and may be recalled with a call to N_MsgRetrieve().

3	Messages from both the server and other workstations will be stored at the server.  The station may recall the messages by a call to N_MsgRetrieve().

Return Values

Current station broadcast mode if no mode change is specified.  If mode change is specified, it returns the previous mode setting

Comments

If there is a message waiting in the server buffer, and the message mode is changed from a store mode (2 or 3) to 0, then that message will be immediately retrieved and displayed.


N_MsgMode See Also
N_MsgBroadcast()

N_MsgRetrieve()

N_SendFromServer()


N_MsgRetrieve
N_MsgRetrieve()	Retrieve a stored message from the file server.

See Also:	Example

Description

Retrieve a stored message from the file server.  Messages can be stored if the mode is set using N_MsgMode() to 2 or 3.

Usage

N_MsgRetrieve()

Return Values

A string containing the stored message (or a null string if no message is waiting) if successful.


N_MsgRetrieve See Also
N_MsgBroadcast()

N_MsgMode()

N_SendFromServer()


N_MsgRetrieve Example
N_MsgRetrieve() Example

Copy Example

N_MsgMode(3)	&& save messages from users and the server

Do while .t.

    *  Perform processing

    cMsg=N_MsgRetrieve()

    if Type(cMsg)='C' .and. .not. empty(cMsg)

        MsgBox(cMsg)

    endif

enddo


N_SendFromServer
N_SendFromServer()	Broadcast a message from the server console

See Also:	Example

Description

Send a broadcast message to a specified user from the server console.

Usage

N_SendFromServer( cUserID, cMessage )

cUserID is the user to send the message to.  If cUserID is EVERYONE then the message will be sent to all logged in members of group EVERYONE.

cMessage is a character string holding the message.  This message may be up to 55 characters long.

Comments

There are differing levels that you can set the broadcast mode for a station.  It is possible to set the mode to ignore messages from other users, but accept messages from the server console.  Sending a message using this function will get the message through even if the person has used N_MsgMode() to set the current broadcast mode to 1.

The person executing this command must be a NetWare console operator.

Return Values

.T. if successful, .F. otherwise.


N_SendFromServer See Also
N_ConsoleOperator()

N_MsgBroadcast()

N_MsgMode()

N_MsgRetrieve()


N_SendFromServer Example
N_SendFromServer() Example

Copy Example

?N_SendFromServer("Supervisor", 'Please mount CDROM volume')


N_SendToServer
N_SendToServer()	Broadcast a message to the server console

See Also:	Example

Description

Send a message to the fileserver console.

Usage

N_SendToServer( cMessage )

cMessage is a character string holding the message.  This message may be up to 58 characters long.

Return Values

0000	Successful

0x89fc	Message Queue Full

0x89fe	I/O Failure; Lack of Dynamic Workspace


N_SendToServer See Also
N_MsgBroadcast()

N_MsgMode()

N_MsgRetrieve()


N_SendToServer Example
N_SendToServer() Example

Copy Example

?N_SendToServer('Please mount CDROM volume')


AboutGPLIB
AboutdGPLIB()	Return version information for dGPLIB

Example

Description

This function displays the current version number of dGPLIB and NWCALLS.DLL in a Windows dialog box.  Along with the version information, the registered owner information will be displayed.

Usage

AboutdGPLIB()

Return Values

dGPLIB version number as a character string.


AboutGPLIB Example
AboutdGPLIB() Example

Copy Example

?AboutdGPLIB()

1.0.0


Flag
Flag()	Set DOS file attributes.

Example

Description

Set the DOS file attribute for a file or files.

Usage

Flag( cFileSpec, cAttributesFlags )

cFileSpec is the name of the file to change.  Standard DOS wildcards of '?' and '*' are supported.

cAttributeFlags is the attributes to change.  Supported attribute flags are:

R - Read Only

H - Hidden

S - System

A - Archive

flags are in the format +<attribute>, to set that attribute bit, or -<attribute> to clear that attribute bit.  Spaces are not permitted between the bit operator, and bit name.


Flag Example
Flag() Example

Copy Example

?Flag('*.PRG','+R')  && Set all prg files in current directory read-only

23


Make_Dir
Make_Dir()	Create directory.

See Also:	Example

Description

The purpose of this routine is to create a DOS directory.

Usage

MAKE_DIR( cDirName )

cDirName is the name of the directory to create

Return Values

.T. if successful, .F. otherwise

Comments

This routine will only create 1 directory level.  I.E. in order to create C:\TEMP\TEMP1, the directory C:\TEMP must exist before the TEMP1 directory can be created.  One thing that can cause this routine to fail is the presence of a file with the same name as the directory you are trying to create.  I.E. if file TEMP exists, creating a directory name TEMP will fail.  This is because they are both directory entries on this disk, with only the attribute bit specifying one is a directory.


Make_Dir See Also
Rem_Dir()


Make_Dir Example
Make_Dir() Example

Copy Example

if .not. make_dir('C:\MyProg\Temp')

    ?'Unable to create directory'

else

    ?'Directory created'

endif


N_ShellVersion
N_ShellVersion()	Return NetWare Shell Version

Example

Description

The purpose of this function is to return the NetWare Shell version.  If the NetWare shell is not loaded or if Windows is not configured in SETUP for NetWare, this function will return a null string ("").  This call is the preferred method of testing if NetX is loaded.

Usage

N_ShellVersion()

Return Values

The NetWare Shell version in the format

<Major Version>.<Minor Version><Rev>

If your workstation is using VLM.EXE, then this function returns the version of VLM.EXE.


N_ShellVersion Example
N_ShellVersion() Example

Copy Example

?N_ShellVersion()

3.32a

*  This next example shows how you could use N_Shellver() to

*  test for presence of the Net Shell

if empty(N_ShellVersion())

    MsgBox("This machine does not have NETX loaded.  "+;

            "Program Cancelled...")

    cancel

endif


Rem_Dir
Rem_Dir()	Remove a directory

See Also:	Example

Description

Remove a DOS directory

Usage

Rem_Dir( cDirName )

cDirName is the directory name to remove.

Return Values

.T. if successful, .F. otherwise.

Comments

Normal DOS limitations about removing directories also apply to this function.  I.E. the directory you remove must be empty.


Rem_Dir See Also
Make_Dir()


Rem_Dir Example
Rem_Dir() Example

Copy Example

?REM_DIR('C:\TEMP\TEMP1')

.T.


N_BannerUserName
N_BannerUserName()	Read/Set user name for banner page

See Also:

Description

Read/Set the user name printed on the banner page of a print job.

Usage

N_BannerUserName( [ cUserName ] )

If the optional parameter cUserName is not passed, then the function will return the current user-name printed on the banner.

If the optional parameter cUserName is passed then the function will set the user-name printed on the banner to that value.  Only the first 12 characters of the passed name will be used.

Return Values

User-name that will be printed on the banner page.

Comments

When you capture using Novell's CAPTURE command, it sets the banner user-name.  If a user logs into a station and then capture is initiated using another method (N_StorePParms() for example), then the user-name stored by the work-station shell will not be updated.  This command provides a method of working around this problem.


N_BannerUserName See Also
N_ReadPParms()

N_StorePParms()


N_CapMode
N_CapMode()	Read/Set current capture state

See Also:	Example

Description

Toggle the current capture state ON or OFF, or return the current capture state.

Usage

N_CapMode( iLptPort [, lState ] )

iLptPort is the LPT port to set the capture state, or get the capture state for.

lState is the flag used to set the capture state.  Allowed values are .T. or .F.  If lState is not passed, the function returns the current capture state.

Return Values

If called in interrogate mode ( lState not passed ), the function returns "ON"  if capture is active, and "OFF" if capture is not active.  In set mode (lState is specified) the function returns the NetWare completion code.


N_CapMode See Also
N_ReadPParms()

N_StorePParms()


N_CapMode Example
N_CapMode() Example

Copy Example

a=new object()

N_ReadPParms(a,1)

a[2]='MYQUEUE'

N_StorePParms(a,1)

*  Perform output & reports

*  and then

*  Send output to local printer

N_CapMode(1,.F.)

*  Turn the net printer back on

N_CapMode(1,.T.)

!capture nb nt q=printq_0

?N_CapMode(1)

ON


N_DeleteQJob
N_DeleteQJob()	Remove a print job from a queue

See Also:	Example

Description

Remove a print job from a Novell Print Queue

Usage

N_DeleteQJob( iJobNumber, cQueueName  [, cServerName ] )

iJobNumber is the NetWare Job Number.

cQueueName is the print queue name.

cServerName is the optional file server name where the queue resides.

Return Values

NetWare completion code.

0000	Success

0x89d0	Queue Error

0x89d1	No Queue

0x89d3	No Queue Rights

0x89d5	No Queue Job

0x89d6	No Job Rights

0x89f0	No Queue Job

0x89fe	Server Bindery Locked

0x89ff	Bindery Failure

Comments

Please refer to the Comments section for N_ListQJobs().


N_DeleteQJob See Also
N_ListQJobs()

N_MoveQJob()

N_QueueStatus()

N_ScanBindery()


N_DeleteQJob Example
N_DeleteQJob() Example

Copy Example

?N_DeleteQJob(272, 'PRINTQ_0')  && Remove job 272

*  The following example demonstrates

*  how to remove all jobs from a queue.

aJobArray=new object()

JobCount=N_ListQJobs('PRINTQ_0',aJobArray)

FOR Counter= 1 to JobCount

    N_DeleteQJob(aJobArray[counter,1],'PRINTQ_0')

endfor

For a more complete example of how to use this function, please refer to the QMgr.PRG that accompanies this program.


N_ListQJobs
N_ListQJobs()	Create array containing current print jobs for a queue.

See Also:	Example

Description

Create a two dimensional array containing the current print job entries for the specified print queue.

Usage

N_ListQJobs( cQueueName, oObjVar, cServerName  )

cQueueName is the queue to get the job list for.

oObjVar is the object variable to store the created array in.

cServerName is the server name the queue resides on.

Return Values

Upon successful completion of this call, the function creates an array with the structure shown below.

1	Job Number

2	Job Size

3	Job Description

4	Job Owner

5	Job Status( Active, Adding, Ready, Hold-User, Hold-Oper )

The function returns a character string containing the NetWare completion code.  These codes are:

0000	Successful

0x880f	Not Attached to Server

0x89fc	Invalid Queue

Comments

Because of design limitations in the Novell Queue system the maximum number of print jobs this function can return is 250.  Under NetWare 3.X, the maximum number of print jobs is actually 65535.

In order to use this and other Queue functions the following conditions must apply.

To use N_ListQJobs() you must be either a queue user, or a queue operator.

To use N_DeleteQJob() you must be either the Job Owner, or a queue operator.

To use N_MoveQJob() you must be a queue operator.

For more information on how Novell handles queue rights and how to create queue operators, please refer to your NetWare documentation.


Order Form
dGPLIB Order Form

Name:_______________________________________ Compuserve ID (Optional)	_________________________

Company:	______________________________________________  Phone:   _____________________________

Address:	______________________________________________________________________________________

City:_________________________________________________ State:  _____________  Zip:	________________

Country:  __________________________________________________________________________

dGPLIB for dBase Windows   Qty:  _________  * $149.00  = ________________

Ship Via:  	US/International Mail	US, Canada & Mexico	$5.00

All Others	$10.00

Federal Express*	US Next Day	$15.50

US Priority	$22.50

Alaska & Hawaii add	$5.00

Canada Next Day	$33.00+GST

All others call for pricing

*Freight costs are quoted based on one copy of dGPLIB.  For each additional product add $4.00

Shipping	________________

Sub-Total	________________

Colorado residents add 4.3% Sales Tax	________________

Total	________________

Purchase orders accepted from US & Canadian companies or Government agencies only.  Payment must be in US Dollars.  FAX, phone, or mail this order form and your purchase order, credit card information or check to:

MH Software	Voice:	(303)438-9585

1006 W 104th Ave #200	FAX:	(303)469-9679

Northglenn, CO 80234-3802

Credit Card Ordering Information

Account # ________________________________________________________ Exp Date (MM/YY)	____________

Card Holder Name	_____________________________________________________________________________

Card Type (Circle One)	American Express	MasterCard	Visa

Authorized Signature _________________________________________________


N_ListQJobs See Also
N_DeleteQJob()

N_MoveQJob()

N_QueueStatus()

N_ScanBindery()


N_ListQJobs Example
N_ListQJobs() Example

Copy Example

aQJobs=New Object()

?N_ListQJobs('PRINTQ_0',aQJobs,'MHS')  && get jobs for Printq_0

For a more complete example of how to use this function, please refer to the QMgr.PRG that accompanies this program.


N_MoveQJob
N_MoveQJob()	Move a job within a queue

See Also:	Example

Description

Change the servicing priority for a job in a NetWare queue.

Usage

N_MoveQJob( iNewPosition, iJobNumber, cQueueName [, cServerName ] )

iNewPosition is the new print job service position

iJobNumber is the NetWare print job Number.

cQueueName is the print queue name.

cServerName is the optional server name where the queue resides.

Return Values

NetWare completion code.

0000	Success

0x89d0	Queue Error

0x89d1	No Queue

0x89d3	No Queue Rights

0x89d5	No Queue Job

0x89d6	No Job Rights

0x89fe	Server Bindery Locked

0x89ff	Bindery Failure

Comments

If iNewPosition is greater than the number of jobs currently in the queue, the job will placed at the end of the queue.

Please refer to the Comments section for N_ListQJobs() for additional information.


N_MoveQJob See Also
N_DeleteQJob()

N_ListQJobs()

N_ScanBindery()


N_MoveQJob Example
N_MoveQJob() Example

Copy Example

?N_MoveQJob(1,272,'PRINTQ_0')  && Move job 272 to Position 1

0000

For a more complete example of how to use this function, please refer to the QMgr.PRG that accompanies this program.


N_QueueStatus
N_QueueStatus()	Read the status of a print queue.

See Also:	Example

Description

This function is used to read the current status of a print queue.  It can be used to determine if a user has rights to a queue.

Usage

N_QueueStatus( cPrintQueue [, cServername ] )

cPrintQueue is the name of the queue to check.

cServerName is an optional server name that the queue resides on.

Return Values

0000	Success (Queue Rights/Queue Status Normal)

0001	Cannot Add Jobs

0002	Print Servers Cannot Attach

0004	Print Server Cannot Service Jobs

0x880f	Invalid Server Specified

0x89d3	No Queue Rights

0x89fc	Invalid Queue

The return values may be logically "or'ed" together.  That is the function may return 0x07 indicating that the current queue status is Cannot Add Jobs, Print Servers Cannot Attach, and Print Server Cannot Service Jobs.


N_QueueStatus See Also
N_DeleteQJob()

N_ListQJobs()

N_MoveQJob()

N_ScanBindery()


N_QueueStatus Example
N_QueueStatus() Example

Copy Example

#define NW_PRINT_QUEUE 3

a=new object()

N_ScanBindery(a,NW_PRINT_QUEUE)	&& Get a list of print queues

*

*	Now delete the queues ones we don't have

*	rights to or that are turned off

*

nDeletes=0

for n=alen(a,1) to 1

    if N_QueueStatus(a[n,1])<>'0000'

        adel(a,n)

        nDeletes=nDeletes+1

    endif

endfor

declare a[alen(a,1)-nDeletes,alen(a,2)]


N_ReadPParms
N_ReadPParms()	Get current capture settings.

See Also:	Example

Description

To read the current capture parameters.  This function allows programs to read the current capture parameters including FormFeed, Notify, Banner, etc.

Usage

N_ReadPParms( oObjVar, iLPTPort )

oObjVar is the object variable to store the created array in.

iLPTPort is the LPT Port to read. I.E. 1-3.

Return Values

NetWare completion code.  The function also creates a 14 Element, 1 dimensional array that contains the capture parameters.  Please refer to the list below for a description of each element.

RowContents

1	Server Name

2	Queue Name

3	Form Number (0-255)

4	Form Name

5	Tab Size

6	Tab Expansion ( .t. or .f. )

7	Form Feed Flag ( .t. or .f. )

8	Notification Flag ( .t. or .f. )

9	AutoEndCap Flag ( .t. or .f. )

10	Banner Text

11	Banner Flag ( .t. or .f.)

12	Number of Copies (1-255)

13	Timeout in Seconds

14	Job Description

Comments

Even if you use N_CapMode() or ENDCAP to end capture, this function will still return the parameters for your last effective capture.  This is not an undocumented feature, it is just how NetWare works.

The form name field is for information only.  It is totally disregarded by NetWare.  If you use the N_StorePParms() function, changing the Form Name will have absolutely no effect.

If you use form numbers, you must ensure that your customers understand forms, and more specifically how to inform NetWare that a form has been mounted.


N_ReadPParms See Also
N_BannerUserName()

N_CapMode()

N_StorePParms()


N_ReadPParms Example
N_ReadPParms() Example

Copy Example

pArray= new object()

N_ReadPParms(pArray,1)

MsgBox('The current Queue is '+pArray[2]+;

        '.  The current server is '+pArray[1])


N_StorePParms
N_StorePParms()	Set current capture settings.

See Also:	Example

Description

The purpose of this function is to allow programs to modify their current NetWare capture settings.  This function allows programs to modify the FormFeed Flag, the notify flag, timeout value, etc.

Usage

N_StorePParms( oObjVar, iLPTPort )

oObjVar is the array variable to read information from.  The array used to alter the settings is in the form listed below.

iLPTPort is the LPT Port to set I.E. 1-3.

Row	Contents

1	Server Name

2	Queue Name

3	Form Number (0-255)

4	Form Name

5	Tab Size

6	Tab Expansion ( .t. or .f. )

7	Form Feed Flag ( .t. or .f. )

8	Notification Flag ( .t. or .f. )

9	AutoEndCap Flag ( .t. or .f. )

10	Banner Text

11	Banner Flag ( .t. or .f.)

12	Number of Copies (1-255)

13	Timeout in Seconds

14	Job Description

Return Values

NetWare completion code.

Comments

The form name field is for information only, it is totally disregarded by NetWare.

If you use form numbers, you must ensure that your customers understand forms, and more specifically how to inform NetWare that a form has been mounted.

Do not try to set the printer to a local printer by setting the 2nd array element to null and calling N_StorePParms().  To set the printer to local use N_CapMode() to toggle capture on or off.


N_StorePParms See Also
N_BannerUserName()

N_CapMode()

N_ReadPParms()


N_StorePParms Example
N_StorePParms() Example

Copy Example

a=new Object()

N_ReadPParms(a,1)	&&  Create our array with current settings

a[7]=.F.	&&  Set Form Feed Off

N_StorePParms(a,1)	&&	Make changes active


N_ConsoleOperator
N_ConsoleOperator()	Return whether person is a console operator

See Also:

Description

Return whether the person on the executing workstation is a NetWare Console Operator.  A person must be a console operator before performing certain functions (enabling or disabling TTS, sending messages from the server console, etc.

Usage

N_ConsoleOperator()

Return Values

.T. if person is a console operator, .F. otherwise.


N_ConsoleOperator See Also
N_LIStat()


N_LIStat
N_LIStat()	Query/Set Login State On Server

See Also:

Description

Read the current login status, or change the current login status for the default server.

Usage

N_LIStat( [lMode] )

if lMode is ommitted, the function returns the current login state on the default server (.T. if enabled, or .F. if disabled.)

If lMode is .T., it enables login on the server.

If lMode is .F., it disables login on the server.

Return Values

If lMode is ommitted, the function returns .T. if login is enabled on the server, and .F. if not.

If lMode is passed, the function returns .T. if the login state is changed, otherwise it returns .f.

Comments

You must be a console operator to make this call successfully.


N_LIStat See Also
N_ConsoleOperator()


N_MaxConns
N_MaxConns()	Return Maximum NetWare connections.

See Also:	Example

Description

Return the highest number of NetWare connections supported by the default server.

Usage

N_MaxConns()

Return Values

Integer corresponding to the maximum number of concurrent logins the license for the default server permits.

Comments

Interestingly, some NLMs will "login" to the server at connection numbers higher than the License will permit.  One example of this is the ArcServe from Cheyenne Software.  Another example is the PSERVER NLM from Novell.


N_MaxConns See Also
N_SerialNo()

N_ServerVers()

N_UserID()

N_UserName()


N_MaxConns Example
N_MaxConns() Example

Copy Example

for n= 1 to N_MaxConns()+5

    ?N_UserID(n), N_UserName(n)

endfor


N_SYSTime
N_SYSTime()	Synchronize the workstations clock with file server.

See Also:	Example

Description

Synchronize the stations time and date with that on the file server.

Usage

N_SYSTime( [ cServerName ] )

cServerName is the optional server name to get the time from.

Comments

This function is equivalent to running the Novell SYSTIME utility.  This function reads the date and time from the file server, and then sets the DOS date and time to the same value.  This function does not modify the value of the PCs internal real time clock.  Because of the event-driven nature of Windows, it is possible for users to reset the clock on the station.  If accuracy and security are absolutely essential, you should place a call to N_SysTime() in your form's OnGotFocus event handler.

Generally, the worst case inaccuracy for this function is -2 seconds.  This inaccuracy is due to 2 reasons.  1) NetWare only returns the server's time with resolution of 1 second.  2)  The travel time from the server  to the workstation is unknown, but assumed to be between 0 and 1 second .  So, we have a possible loss of .99 seconds because of the limited resolution in the NetWare time service, and an estimated loss of between 0 and 1 second for travel time from the server to the station, and some odd processing time.  If you were performing this call to a server linked by a WAN or MAN, your transit time for the packet may vary.

If you are looking for an accurate source to set the clock on your server to, you may wish to try (303) 499-7111.  This is the number for the Atomic Clock located at the National Institute of Standards and Technology, located in Boulder, CO.

Return Values

NetWare completion code.

0000	Successful


N_SYSTime See Also
N_ServerDate()

N_ServerTime()


N_SYSTime Example
N_SYSTime() Example

Copy Example

N_Systime()  && Station date & time are now synched with server.

N_SysTime('ENGINEERING')  && Synch clock to engineerings server.


N_SerialNo
N_SerialNo()	Return NetWare Server Serial Number

See Also:	Example

Description

Return the NetWare serial number for the default server.

Usage

N_SerialNo()

Return Values

8 digit NetWare serial number formatted as a character string.

Comments

Each copy of NetWare sold by Novell is serialized.  This function returns that Novell assigned serial number.

Note:  Recently, Novell has started distributing special versions of NetWare to major accounts.  These special versions all have the same serial number.

You must be logged in to the server to get the serial number.


N_SerialNo Example
N_SerialNo() Example

Copy Example

?N_SerialNo()   && Get serial number of default server

N_DefaultServer('ENGINEERING')   && Set default server to engineering

?N_SerialNo()	 	 && and read it's serial number


N_ServerDate
N_ServerDate()	Return server date.

See Also:	Example

Description

Return the current system date from the network file server.

Usage

N_ServerDate()

Return Values

Server date as a character variable.


N_ServerDate See Also
NWStoD()

N_ServerTime()

N_SYSTime()


N_ServerDate Example
N_ServerDate() Example

Copy Example

*  This mythical example shows how you could implement a journaling

*  system to record changes to key tables.  Because the system

*  date and time are retrieved directly from NetWare, they can

*  be considered secure, and immune from tampering.

*

if updated()

    select journal

    replace date with NWStoD(N_ServerDate()), ;

            time with N_ServerTime(), ;

            user with N_UserID(), ;

            action with 'modified record', ;

            key with partno

endif

?NWStoD(N_ServerDate())+5  && return date for 5 days from today.


N_ServerTime
N_ServerTime()	Return File Server Time.

See Also:	Example

Description

Return the current system time from the file server.

Usage

N_ServerTime()

Return Values

Current server time as a formatted string.


N_ServerTime See Also
N_ServerDate()

N_SYSTime()


N_ServerTime Example
N_ServerTime() Example

Copy Example

?N_ServerTime()

12:34:55

*  This mythical example shows how you could implement a journaling

*  system to record changes to key tables.  Because the system

*  date and time are retrieved directly from NetWare, they can safely

*  be considered secure, and immune from tampering.

*

if updated()

    select journal

    replace date with NWStoD(N_ServerDate()), ;

            time with N_ServerTime(), ;

            user with N_UserID(), ;

            action with 'modified record', ;

            key with partno

endif


N_ServerVers
N_ServerVers()	Return NetWare server version number

See Also:	Example

Description

Return the NetWare version number for the default server.

Usage

N_ServerVers()

Return Values

NetWare version number as a formatted string.


N_ServerVers Example
N_ServerVers() Example

Copy Example

?N_ServerVers()

3.11a


N_SetSemaphore
N_SetSemaphore()	Perform NetWare semaphore locking.

Example

Description

Provide a system of using logical locks, with NetWare semaphores.

Usage

N_SetSemaphore( cSemaphoreName, lMode [, cServerName ])

cSemaphoreName is the name of the semaphore to lock or unlock.

If lMode is true, the semaphore is locked.  If lMode is .F., the semaphore is unlocked.

cServerName is the optional server name where the semaphore should reside.

Return Values

.T. if successful, .F. otherwise.

Comments

NetWare Semaphores allow the programmer to perform logical record locking rather than physical record locking.  An example of this would be if you had multiple tables that you needed to update.  With semaphores, you could lock the primary key (in the example PartNo) and then proceed.  Using physical locks, it would be necessary to obtain locks on all the records in all the related tables in order to ensure that the transaction would be performed.  The only catch to this idea is that ALL APPLICATIONS WHICH UPDATE THOSE TABLES MUST CONSISTENTLY USE THE SEMAPHORE LOCKING, AND CONSISTENTLY NAME THOSE SEMAPHORES.


N_SetSemaphore Example
N_SetSemaphore() Example

Copy Example

If N_SetSemaphore(Accounts.Acct_No, .T.)

    * Perform Edit of Account Master

    N_SetSemaphore(Accounts.Acct_no, .F. )

else

    MsgBox('Unable to obtain lock on record for '+Accounts.Acct_no)

    return

EndIf


N_TTSAvailable
N_TTSAvailable()	Return TTS Availability

See Also:	Example

Description

The purpose of this function is to return the availability of TTS on a server.

Usage

N_TTSAvailable()

Return Values

The function returns .T. if TTS is available, and .F. if it is not.


N_TTSAvailable See Also
N_SetAttr()

N_TTSBegin()

N_TTSCommit()

N_TTSRollBack()


N_TTSAvailable Example
N_TTSAvailable() Example

Copy Example

* Query current TTS status

?N_TTSAvailable()

.T.


N_TTSBegin
N_TTSBegin()	Begin an explicit transaction

See Also:	Example

Description

The purpose of this function is to signal to the NetWare operating system that an explicit TTS transaction has begun.

Usage

N_TTSBegin()

Return Values

NetWare completion code:

0x00ff	Success

0x8996	Out of Dynamic Workspace

0x89fe	Implicit Transaction Already Active.  Implicit transactions will be converted to explicit transactions.

0x89ff	Explicit Transaction Already Active.  Existing transaction will continue normally.

Comments

There are some very serious pitfalls to be aware of when using TTS with dBaseWin and NetWare.  Generally speaking, TTS is only recommended for non-interactive batch update processes.  Some of the problems with TTS are:

If you issue an APPEND BLANK or INSERT INTO command while a TTS Transaction is active, the DBF header will be locked until the transaction is committed or rolled back.  When you issue an append, the record count located in the first 32 bytes of the header is modified.  This means that no other users may issue an APPEND BLANK or even issue a USE <DBFName> until the transaction is committed.

Records locked during a TTS transaction remain locked until the transaction is committed or rolled back.  This lock, unlike a normal dBaseWin lock, prevents other users from examining affected records.

If the changes haven't been written to disk, then a roll-back will not work.  For example:

use test

N_TTSBegin()

append blank

replace field1 with 1

N_TTSRollBack()

use

will not always have the expected outcome.  Because the changes haven't been written to disk yet by dBaseWin, Novell can't roll them back.  To work around this problem, you should issue a FLUSH command before any RollBack commands.

There is a real limit to how large your transaction can be.  Under NetWare 3.11, the maximum number of record locks per connection is 10,000.  Thus, the theoretical maximum number of locks in a single transaction is 10,000.  In reality, the number will depend upon your server's available memory and disk space.  It is recommended by Novell that you perform updates on a small number of records in each transaction.


N_TTSBegin See Also
N_SetAttr()

N_TTSAvailable()

N_TTSCommit()

N_TTSRollBack()


N_TTSBegin Example
N_TTSBegin() Example

Copy Example

private nTransNo

if N_TTSAvailable() .and. N_SetAttr('TEST.DBF','+T')>0

    use test

    N_TTSBegin()	&& Start the transaction

    browse	&& Make our changes

    FLUSH

    if yes('Write changes to disk?')

        N_TTSCommit()	&& Write the transaction

        MsgBox('Transaction written to disk!')

    else

        N_TTSRollBack()

        MsgBox('Transaction rolled back!')

    endif

    use

else

    MsgBox('TTS was not available!')

endif


N_TTSCommit
N_TTSCommit()	Signal the end of an explict TTS Transaction

See Also:	Example

Description

Signal the end of an explicit TTS transaction.

Usage

N_TTSCommit()

Return Values

NetWare result code.

Comments

Depending upon the load on your server, and it's various settings, up to 10 seconds can pass before a transaction can be written.


N_TTSCommit See Also
N_SetAttr()

N_TTSAvailable()

N_TTSBegin()

N_TTSRollBack()


N_TTSRollBack
N_TTSRollBack()	Roll back an explicit TTS transaction

See Also:	Example

Description

Roll back an explicit NetWare TTS transaction.

Usage

N_TTSRollBack()

Return Values

NetWare completion code.

0000	Success

0x89fd	Transaction Tracking Disabled (No rollback performed)

0x89fe	Transaction Ended, Records Locked

0x89fd	No Explicit Transaction Active


N_TTSRollBack See Also
N_SetAttr()

N_TTSAvailable()

N_TTSBegin()

N_TTSCommit()


How to access GPLIB
How to access dGPLIB

To access dGPLIB from within dBase for Windows you must first tell dBase about the functions included in dGPLIB.  The file dGPLIB.H contains the function prototypes for all of the functions within dGPLIB.  To use the functions, first put the command:

#include dGPLIB.H

in your program.  If you just want to load dGPLIB and test the functions from the command line, create a one line program containing the #include statement above and execute it.  When the program returns, all of the functions of dGPLIB will be available.


Console Operator
A console operator is a user that has been granted special privileges by the network administrator.  A Console Operator has the following powers on the network:

Change System Clock

Enable & Disable Login

Enable & Disable TTS

Perform Certain Calls to Determine what users have a file open.

To make a user a console operator, the Network supervisor must use the Novell SYSCON utility.


Enhancement Requests

We welcome your requests for enhancements.  MH Software is dedicated to providing the finest dBASE enhancement tools available.  We need your input to let us know how we can improve our products.  If you have an idea for an enhancement, please contact us.  When you do, please be sure to provide your daytime telephone number in the event that we need to contact you for clarification.  Please forward all requests for enhancements to CompuServe mail ID 73237,1665 or mail them to:

MH Software

1006 W 104th Ave #200

Northglenn, CO 80234


Registration Program

dGPLIB comes with a registration program named REGISTER.EXE.  This program is used to embed the registration information into dGPLIB.  Once this program is ran, the demonstration version message will stop being displayed.  To use the registration program, you need to have your serial number and activation key you received when you purchased dGPLIB.

To use the program, from the DOS Prompt type:

REGISTER dGPLIB.DLL

If you used the dGPLIB setup program to install dGPLIB, double-click on the icon dGPLIB Registration Utility.

You will be prompted to enter your serial number and activation key.  Once these are entered, you will be prompted to enter your registration information.  This information will be embedded in the library.  Once embedded, it can be displayed using ABOUTdGPLIB().


License Agreement
License Agreement	Q&A

This license permits you to use the software (dGPLIB) under the terms of this license.  Ownership of the software including the programs, documentation, and any other materials provided with the program, and any components thereof ("LICENSED SOFTWARE") remains with MH Software ("LICENSOR").

The LICENSED SOFTWARE is owned by LICENSOR, is protected by a registered copyright belonging to LICENSOR and is protected by United States copyright laws and international copyright treaty provisions.

You may install dGPLIB on one computer or network file server for software development purposes.  If you wish to use dGPLIB for development on more than one computer or server, you must purchase additional licenses or obtain a site license.

You may distribute dGPLIB as part of your software, provided you do so within the following conditions:

dGPLIB.DLL may only be distributed as part of a compiled dBASE for Windows program or dBASE for Windows .EXE file.

If you deliver source-code to your customer, and your customer, or his agent will make modifications to customers program, then the customer must purchase dGPLIB.  You may distribute the unregistered version of dGPLIB provided that all accompanying documentation and files are included.  If your program uses dGPLIB, and you wish to distribute it with your source code, without requiring your customers to register dGPLIB, then you must purchase a distribution license.

You may not reverse engineer, decompile, or disassemble the software.  You may not copy (except for backup purposes), sell or otherwise distribute (except within the terms described above) this software.

You may not share, post on any bulletin board system, or otherwise distribute your dGPLIB activation key.

Limits of Liability

LICENSOR makes no warranty of any kind, expressed or implied, with regard to the program or documentation contained in this product.  EXCEPT AS EXPRESSLY SET FORTH HEREIN, LICENSOR DISCLAIMS ANY AND ALL PROMISES, REPRESENTATIONS, AND WARRANTIES WITH RESPECT TO THE LICENSED SOFTWARE, INCLUDING THE CONDITION, THE CONFORMITY TO ANY REPRESENTATION OR DESCRIPTION, THE EXISTENCE OF ANY ERRORS OR OTHER LATENT OR PATENT DEFECT, ANY INFRINGEMENT OF ANYONE ELSE'S INTELLECTUAL PROPERTY RIGHTS, ANY NEGLIGENCE, THE MERCHANTABILITY OF THE LICENSED SOFTWARE, AND FITNESS FOR ANY PARTICULAR USE.  LICENSOR SHALL NOT BE LIABLE IN ANY EVENT FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY OTHER LOSS) IN CONNECTION WITH OR ARISING OUT OF THE USE OF THIS PROGRAM.  UNDER NO CIRCUMSTANCES SHALL LICENSOR'S LIABILITY EXCEED THE COST PAID FOR THE SOFTWARE, EVEN IF LICENSOR HAS BEEN ADVISED OF THIS POSSIBILITY.

This agreement shall be construed and enforced in accordance with the laws of the State of Colorado.  Any action or proceeding brought by either party against the other arising out of or related to the Agreement shall be brought only in a State or Federal Court of competent jurisdiction located in the City and County of Denver, Colorado.  The parties hereto agree to in personam jurisdiction of said courts.  You agree that should you breach this agreement, said breach will cause imminent harm to LICENSOR and that LICENSOR has no adequate remedy at law, and that injunctive relief is appropriate.  You also agree that if you should breach this agreement, LICENSOR shall be entitled to reasonable costs including attorneys' fees in any action to enforce any provision of the agreement.  This agreement is the full integration of the understanding between the parties thereto.

Defective Media

If within ninety (90) days of receipt of this software, the distribution media is found to be defective, you may receive replacement media for no charge.  After 90 days there will be a nominal shipping and handling  fee.

Customer Remedies

LICENSOR'S entire liability and your exclusive remedy shall be, at LICENSOR'S option, either (a) return of the price paid for the software, or (b) repair or replacement of defective media.

Trademarks

dBASE for Windows is a registered trademark of Borland International.  MSDOS is a registered trademark and  of Microsoft Corporation.  NetWare is a registered trademark of Novell, Inc.  dGPLIB is a trademark of LICENSOR.


License Q&A

Q:	I would like to install dGPLIB on my network.  I have 100 programmers attached to the network who will be accessing dGPLIB.  How many licenses do I need?

A:	You need only purchase one license.  The dGPLIB license agreement allows it to be installed on one computer or one network server.

Q:	I have 20 programmers.  Each programmer needs dGPLIB installed on their own PC.  How many licenses do I need?

A:	You need to purchase 20 licenses.  The dGPLIB license agreement allows it to be installed on one computer or network server.  In this case because you wish to install it on 20 computers you need 20 licenses.  You can contact MH Software for a quantity pricing schedule.

Q:	I am doing some contract work for a client.  I have registered dGPLIB.  After I complete the work, their people will take over maintenance of the software.  Can I distribute my copy of  dGPLIB to them?

A:	No.  In this case, your client will need to purchase a license to use dGPLIB.  The license permits you to distribute dGPLIB as part of a compiled application.  In this case, since the library would be used by a third party for development, they must license the software.

Q:	I am selling a dBASE for Windows add-in product.  My product would benefit greatly from incorporation of dGPLIB.  When I distribute my product I will distribute the source code, and would like to include a registered version of dGPLIB for use by other developers.  If I register dGPLIB, may I distribute it with my product?

A:	No.  The license for dGPLIB allows you to distribute it only as part of a compiled application.  If you wish to distribute dGPLIB you must contact MH Software for a distribution license.  You may distribute the unregistered version of dGPLIB with your product provided that all accompanying documentation including license, manual, and sample programs are included.

Q:	My company is developing a dry-cleaning vertical market application.  We estimate sales will be 10,000 units per month.  We would like to use dGPLIB in our product.  The application will only be distributed in compiled form.  There will not be any VARs or other intermediaries who will have access to the source code.  How many licenses do we need?

A:	Most likely you need only one license.  The license for dGPLIB restricts how many machines it can be installed upon for development purposes.  You may distribute an unlimited number of  copies of dGPLIB as long as it is part of the compiled application.


Upgrades

With the purchase of dGPLIB, you are entitled to free updates for a period of one year.  These free updates can be obtained via download from CompuServe.  The latest version of dGPLIB is available on the Borland dBASE for Windows  Forum (GO DBASEWIN).  You can download the latest version from this forum as soon as it is made available.  After you download them, use the REGISTER utility program to enter your serial number, activation key and registration information into the library.  The registration process will suppress demonstration version messages.  If you are unable to download the file from CompuServe, you can obtain an upgrade disk for $10.00.  Mail your check or money order to:

MH Software

1006 W 104th Ave #200

Northglenn, CO 80234


Technical Support

Every effort has been made to ensure this software is free of defects.  If you find a bug in this program we will make every effort to fix the problem and provide you with an updated program.

Before contacting us, please try the following:

Double check the syntax in your program to make sure it matches the documentation.

Examine the examples provided.

Check the Frequently Asked Questions section for additional information.

Completely read the documentation for the function you are trying to use, including all available popups.

You may contact technical support via CompuServe mail @73237,1665, via Internet at 73237.1665@compuserve.com, by calling (303) 438-9585, or via mail at:

MH Software

1006 W 104th Ave #200

Northglenn, CO 80234


What's New

This section will contain lists of new features and corrections made to dGPLIB.


General Information About GPLIB
General Information About dGPLIB

dGPLIB is a NetWare API Library for dBASE for Windows.  It contains over 75 NetWare specific commands.  In order for the NetWare functions to work you must be using NetWare 2.1X or higher.  These functions will not work with NetWare Lite or NetWare Personal Edition.

Error Handling and dGPLIB

In most instances, I have relied on the Extern:: Error() function.  The function will return an error message containing the error number.

NetWare Security and dGPLIB

Certain functions require that the person executing be either the network supervisor, or equivalent.  An example of this is N_PwdDate().  I can use this function to get my password date, but I cannot use it to get another persons password date UNLESS:  1)  I am SUPERVISOR or equivalent, 2)  I am security equivalent to that person, 3)  I am a manager over that person.  This generally applies to N_SecurityEquivalent(), N_PwdDate(), N_AccessDate(), etc., those functions which read the NetWare bindery for specific user information.  Also, some functions such as N_LIStat() require that the person executing them be either a supervisor, or a console operator.


CASTON
Novell command line utility to set message broadcast status.


CASTOFF
Novell command line utility to set broadcast message status.


SYSTIME
SYSTIME is a Novell command line utility that synchronize the date and time of the PC to that of the Novell Server.  SYSTIME does not update the PCs hardware real-time clock.


Object Types
NetWare Object Types

0000h	Unknown

0001h	User

0002h	User Group

0003h	Print Queue

0004h	File Server

0005h	Job Server

0006h	Gateway

0007h	Print Server

0008h	Archive Queue

0009h	Archive Server

000Ah	Job Queue

000Bh	Administration

0024h	Remote Bridge Server

0045h	Advertising Gateway Server?

0047h	Advertising Print Server

0048h	Advertising TCP IP Gateway Server?

0066h	Advertising Archive Server?

0107h	Remote Console (NetWare 3.X REMOTE.NLM, RSPX.NLM)

030Ch	HP Laserjet Print Server

8000h 	Reserved up to 8000h

8002h 	LanPort/Netport

FFFFh	Wild


Frequently Asked Questions

How Do I...

Help Related Questions

GPF Problems

Programming Questions

Registration & Update Problems


Object ID
The object ID is the unique number that identifies a bindery object on a server.  The object ID is not unique across NetWare 3.x servers, but is in NetWare 4.x servers.  For users, the object ID corresponds to the name of the users mail directory.  I.E.  SYS:MAIL\12310101.


File List

The following files make up dGPLIB.

Name	Description

dGPLIB.DLL	This is the .DLL library that contains all of the functions of dGPLIB.

REGISTER.EXE	This program is used to initialize dGPLIB.DLL with the owners registration information.

NWCALLS.DLL	This is a support file used by dGPLIB to perform NetWare access.  This file must be placed in the same directory as dGPLIB.

dGPLIB.HLP	This help file.

dGPLIB.H	dBASE for Windows include file.  This file contains the function prototypes for dGPLIB.

ISDIGIT.PRG	Support program used by examples

PADR.PRG

ALLTRIM.PRG

PADC.PRG

NWSTOD.PRG

dGPMAIN.WFM	Main form of a sample program that shows the features of dGPLIB.

dGPMAIN.MNU	Menu for dGPMAIN.WFM

*.WFM	Child forms called by dGPMAIN.WFM

READ.ME	ASCII text file containing important information about dGPLIB.


NetX
NetX & VLM

To access Novell NetWare servers your computer must have IPX and NETX or IPX and VLM.EXE loaded.  These programs make the network accessible to MSDOS.  Usually, the call to load these files is placed in the AUTOEXEC.BAT or NET.BAT.  A typical NET.BAT might look like this:

CD \NET

IPX

NETX

f:

Login

If you are using ODI drivers with multiple protocol stacks, a typical NET.BAT would look like this:

LSL

SMC8000

IPXODI

NETX

f:

login

VLM.EXE is a replacement shell for NETX.  It was introduced with NetWare 3.12 and 4.00.  VLM.EXE has the benefit of being more memory conservative, but many users of VLM.EXE (version 1.1) report strange problems ranging from workstations hanging to bizarre error messages.  If you are using NetWare 3.X we recommend that you use NETX rather than VLM.EXE.


traceable shipment
Orders shipped via Federal Express can be traced to determine the status of a package and who the package was delivered to.

Many large companies either do not accept delivery of purchases through US Mail or are not accustomed to accepting delivery of purchases through US Mail.  If your company fits this description, we recommend that you have your order shipped via Federal Express.


Help Related Questions

Q:	How can I access this help file from within dBASE for Windows?

A:	To access this help file issue the dBASE command:

SET HELP TO dGPLIB

from the dBASE for Windows command window.

Q:	How can I use help more easily?

A:	When you open the on-line documentation for dGPLIB, three push buttons are added to the top menu bar.  These three "speed buttons" are Print, Help On Top, and Functions.

Print

Print the current help topic.

Help On Top

Toggle the "Help On Top" state of the help window.  This is equivalent to selecting HELP|HELP ON TOP from the system menu bar.  If Help On Top is selected, the help window will stay on top even when it loses focus.  When the help window is placed in "Always On Top" mode, it will have a double border around the right and bottom edges.

Functions

This button is a short-cut to get to the function list of the on-line document.

If you are constantly referring to one section try using the Bookmark facility of Windows Help.


GPF Problems

Q:	When I try to access the functions contained in dGPLIB I immediately get a GPF fault.

A:	Certain video drivers supplied by video card manufacturers (ATI is a known case) can cause this problem.  Try changing your video driver to a Microsoft supplied driver (VGA or SuperVGA 800*600) or obtain an updated video driver from your video card manufacturer.

Q:	When I call a function in dGPLIB I sometimes get a GPF.

A:	Please check to make sure that the syntax, type, and the calling order of the parameters you are passing is correct.


Registration & Update Problems

Q:	I am trying to install an updated version of dGPLIB, but every time I do, I get a "File In Use" error.

A:	Before installing a new version of dGPLIB, check to ensure that all dBASE for Windows applications that use dGPLIB.DLL are closed.

Q:	I keep getting the demonstration version message for dGPLIB even though I have purchased it.

A:	dGPLIB uses a serial number/key system.  If the copy of dGPLIB that your program calls has not been initialized with the REGISTER.EXE program, then you need to either replace the file with a copy of dGPLIB that has been initialized or use the Registration Program (REGISTER.EXE) to enter your serial number and activation key.

Q:	How can I obtain updates to dGPLIB.

A:	Refer to the UPGRADES section.


Programming Questions

Q:	When I try to use the functions in dGPLIB, they don't work.  I get errors, usually Extern:: Error 0x88ff.  I know that I am logged into the network and I have NetX loaded.

A:	Make sure that in Windows Setup you have Novell NetWare selected as the network.  You may want to ask your network support person to assist you in configuring your machine.

Q:	I am trying to write a program to login to multiple servers, get some data, and then logout.  It works on the first server, but after that I get errors.

A:	Make sure that after you logout of a server, you restore the default server using the N_DefaultServer() function.  For more information refer to the help section titled About Default Servers.


N_FilesOpen
N_FilesOpen() Return files open on a workstation

See Also:	Example

Description

This function creates an array containing a list of files held open by a specified workstation.

Usage

N_FilesOpen( oObjVar, iConnection  )

oObjVar is the object variable to store the created array in.

iConnection is the station number to get the file list for.

Return Values

The number of network files open on the specified station.  The function creates a two dimensional array containing a list of files open by the station.  The structure of the array is:

Column	Description

1 	File Name

2 	Task Number

3	Access Mode

Comments

You must be a NetWare console operator to make this call.

Because of a bug in the Novell NetWare Client Kit only the file portion of the name is available.  Future versions will return the complete path of the open files.

The access mode flag is a bit-mapped column with the following values

1	Open for read by client

2	Open for write by client

4	Deny read requests from others

8	Deny write requests from others

16	File detached

32	TTS holding detach

64	TTS holding open

The value returned in access mode may be a combination of the flags above.


See Also:
N_ConnsUsing()

N_ConsoleOperator()

N_GetLocks()


N_FilesOpen() Example

Copy Example

private a, n, nCount

a=new object()

nCount=N_FilesOpen(a,N_ConnNum())

for n=1 to nCount

? a[n,1], iif(bitand(a[n,3],1)==1,"READ ",""), ;

iif(bitand(a[n,3],2)==2,'WRITE ',''),;

iif(bitand(a[n,3],4)==4,'DENY READ ',''),;

iif(bitAnd(a[n,3],8)==8,'DENY WRITE ',''),;

iif(bitAnd(a[n,3],16)==16,'File Detached ',''),;

iif(bitAnd(a[n,3],32)==32,'TTS holding detach ',''),;

iif(bitAnd(a[n,3],64)==64,'TTS holding open ','')

endfor


How Do I...

Q:	How do I order dGPLIB?

A:	Go to the section ORDERING INFORMATION read the ordering information.  Click on the topic ORDER FORM, and then click on the button labelled PRINT.  Once the blank form has printed, complete the form and send it with your payment or PO to MH Software.

Q:	How do I get a user list?

A:	In the example for the function N_UserID(), there is a sample program that demonstrates getting a list of users and putting them in a browse window.  Also, refer to USERLIST.WFM in the sample files.

Q:	How do I find out who has a file open?

A:	Use the function N_ConnsUsing().

Q:	How do I find out what files a station has open?

A:	Use the N_FilesOpen() function.

Q:	How do I login to another server?

A:	Use the N_Login() function.

Q:	How do I get a list of available servers, queues, groups, users, etc.?

A:	Use the N_ScanBindery() function.

Q:	How do I identify the physical computer my program is running on?

A:	Use the N_StationAddress() function.

Q:	How do I determine if the network drivers are loaded?

A:	Use the N_ShellVersion() function.

Q:	How do I determine my dGPLIB version number.

A:	From the DOS prompt, while logged into a server, type VERSION DGPLIB.DLL.  From within dBASE for Windows, issue the following two commands from the command window:  EXTERN CSTRING ABOUTDGPLIB( CVOID ) DGPLIB.DLL followed by ?ABOUTDGPLIB().


About Default Servers

See Also:

If your programs will be changing the default server, or logging in and out of servers, please read this section.  Understanding this information is critical to effectively using dGPLIB in a multi-server environment.

Because of the event-driven nature of dBASE for Windows, it takes special care to keep track of what server to send requests to.  One approach would be to require the server be passed as a parameter to each dGPLIB function.  This approach is unwieldy, and would create unnecessary coding for most people.  Another approach would be to just use the NetWare calls to set the default server.  The trouble with this approach is that if another form or process changes where the shell points, your program will have problems.  The approach dGPLIB takes is to use the NetWare default server.  However, functions are provided to override the default server for each open window.  Once overridden, this default will apply to that window until the default is again overridden.

The default server is calculated in the following manner:

1.	If a call to N_DefaultServer() or N_Login() is made, then that server is made the default server for the active window.

2.	If a default server has not been set by a call to N_DefaultServer() or N_Login(), dGPLIB uses the NetWare default connection.  If this has not been set, dGPLIB uses the primary connection ID.  If this has not been set, dGPLIB obtains a list of connections from NetWare and uses the first one.

3.	If a call to N_Logoff() or N_ServerDetach() is made, then all windows that reference that server will have their default server entries removed and they will revert to determination by the method in step 2.

4.	If a call to N_MRUListRemove() is made for a form, then the default server is calculated as in step 2.

A call to set the default server is only applicable for the window that made the call.  A call to N_DefaultServer() from one window does not affect the default server for other windows.

dGPLIB uses a Most Recently Used list (MRU) to store the default server for a window.  The window is identified by its Windows HWND.  If you are releasing a window that has had the default server set, it is a good idea to call the function N_MRUListRemove() to remove the Window's slot from the MRU list.  If you don't do this and another window is created with the same hWND, then that window will inherit the default server settings from the previous window.

For consistent results when using forms that reference multiple servers, your forms should always set the default server to a known value using the N_DefaultServer() function and call N_MRUListRemove() on closing the form.

WARNING:  Unloading dGPLIB by using the RELEASE DLL command will remove the MRU list from memory, and the default server for all active windows.


primary connection ID
The primary connection ID is usually the server the workstation first attached to when NetX or VLM.EXE was loaded.  Certain versions of the OS/2 requester for NetWare do not properly set the primary connection ID.


default connection
The default connection is usually determined by the default drive.  If the current default drive is set to F: and drive F: is mapped to ENGINEERING then ENGINEERING is the default server.  This default server can be reset by some functions.  For example, if you use the function N_MapDrive() to a server, then that server will become the default connection ID.


HWND
An hWnd is a numeric handle that Windows generates for each object.  This handle is used by Windows Programs to refer to the object.  Many class objects in dBASE for windows have hWnd as a property of their class.  An example would be form.hwnd.  The hWnd for an object is only unique and meaningful during it's existence.  If the object is deleted, and recreated, it can potentially have a different hWnd.  Also, hWnds are reused.  That is, a window might have the same hWnd as a window that was created before.


N_MRUListRemove
N_MRUListRemove()	Remove an entry for a window from the MRU List

See Also:	Example

Description

N_MRUListRemove() removes an entry for a window/default server from an internal list maintained by dGPLIB

Usage

N_MRUList( [hWnd] )

hWnd is the HWND for the window you wish to remove the default server entry for.  If no window is specified, the entry for the current active window is removed.

Return Values

Returns .T. if the windows HWND was found in the MRU list and removed, .F. otherwise.

Comments

Please read the section entitled About Default Servers before using this function.  It is critical to understanding how to use dGPLIB in a multi-server environment.


N_MRUListRemove See Also
About Default Servers

N_DefaultServer()


N_MRUListRemove Example
N_MRUListRemove() Example

Private aInfo, aAllServers, n, cLastServer

cLastServer=N_DefaultServer()

aInfo=New object()

N_ScanBindery(aInfo,4)

aSort(aInfo)

declare aAllServers[alen(aInfo,1)]

for n=1 to alen(aInfo,1)

    aAllServers[n]=aInfo[n,1]

endfor

** END HEADER -- do not remove this line*

* Generated on 08/04/94

*

LOCAL f

f = NEW ALLSERVFORM()

f.Open()

CLASS ALLSERVFORM OF FORM

   this.Text = "All Servers"

   this.Top =          2

   this.Height =         19.2344

   this.Width =         65.5

   this.HelpFile = ""

   this.Left =          2

   this.MDI = .F.

   this.HelpId = ""

   this.OnClose = CLASS::FORM_ONCLOSE

   DEFINE LISTBOX LISTBOX1 OF THIS;

       PROPERTY;

         DataSource "ARRAY AALLSERVERS",;

         ColorNormal "N/W*",;

         Sorted .T.,;

         TabStop .F.,;

         Multiple .T.,;

         ID        100,;

         Top          2,;

         Height         12,;

         Width         51.835,;

         Left          6.665,;

         ColorHighLight "W+/B"

   DEFINE PUSHBUTTON PBCANCEL OF THIS;

       PROPERTY;

         ColorNormal "N/W",;

         OnClick {form.close()},;

         Text "Cancel",;

         Default .T.,;

         UpBitmap "RESOURCE #28",;

         Top         16,;

         Group .T.,;

         Height          2,;

         Width         17.835,;

         HelpFile "dgplib.hlp",;

         Left         23.665

   Procedure Form_OnClose

   N_MRUListRemove(form.hwnd)

ENDCLASS


About Default Servers See Also
N_DefaultServer()

N_Logoff()

N_MRUListRemove()

N_ServerDetach()


N_DriveList See Also
N_DriveBase()

N_DriveCount()

N_DrivePath()

N_DriveRel()

N_MapDelete()

N_MapDrive()

N_ServerFromDrive()


N_SerialNo See Also
N_MaxConns()

N_ServerVers()


N_ServerVers See Also
N_MaxConns()

N_SerialNo()


Ofs2RecNo
Ofs2RecNo -  Convert file lock offset to record number

See Also:	Example

Description

The purpose of this function is to convert a file lock offset to it's corresponding record number.

Usage

Ofs2RecNo( cStart, cEnd )

cStart is the starting offset as a character string.

cEnd is the ending offset as a character string.

Return Values

Returns the record number corresponding to the starting and ending offset values.  In the case of an FLOCK() the function returns 0.  In the case of an RLOCK() the function returns the record number.


Ofs2RecNo See Also
N_GetLocks()


N_DirInfo See Also
N_FileInfo()