Dec 212017
 
LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper.
File LXNET.ZIP from The Programmer’s Corner in
Category Dbase Source Code
LXNet Ver. 1.2 – Novell bindery/printing functions for Clipper.
File Name File Size Zip Size Zip Type
LXNET.DOC 30451 6730 deflated
LXNET.LIB 42496 10310 deflated
LXNET.NG 22041 6753 deflated

Download File LXNET.ZIP Here

Contents of the LXNET.DOC file















LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper

Copyright 1990 Randy Proulx.
1618 Marion Rd. SE #47
Rochester, MN 55904

LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper i



Table of Contents

License Information . . . . . . . . . . . . 1

How to use this library . . . . . . . . . . 2

Features and limitations. . . . . . . . . . 3

Changes from version 1.0. . . . . . . . . . 4

Function Descriptions . . . . . . . . . . . 5

A_Groups(). . . . . . . . . . . . . . . 5

A_Members() . . . . . . . . . . . . . . 6

A_Queues(), . . . . . . . . . . . . . . 7

A_Servers() . . . . . . . . . . . . . . 8

A_Users() . . . . . . . . . . . . . . . 9

A_Volumes() . . . . . . . . . . . . . .10

Cancel_Cap(). . . . . . . . . . . . . .11

CanSpecCap(). . . . . . . . . . . . . .12

Capture() . . . . . . . . . . . . . . .13

ConnectNum(). . . . . . . . . . . . . .14

DefaultLpt(). . . . . . . . . . . . . .15

DefaultCon(). . . . . . . . . . . . . .16

EndCap(). . . . . . . . . . . . . . . .17

EndSpecCap(). . . . . . . . . . . . . .18

Flushcap(). . . . . . . . . . . . . . .19

FluSpecCap(). . . . . . . . . . . . . .20

GetBanUser(). . . . . . . . . . . . . .21

GetObjID(). . . . . . . . . . . . . . .22

GetObjName(). . . . . . . . . . . . . .23

GetObjType(). . . . . . . . . . . . . .24

IsInGroup() . . . . . . . . . . . . . .25

IsNovell(). . . . . . . . . . . . . . .26



LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper ii



Table of Contents
(continued)

NumGroups() . . . . . . . . . . . . . .27

NumMembers(). . . . . . . . . . . . . .28

NumQueues() . . . . . . . . . . . . . .29

NumServers(). . . . . . . . . . . . . .30

NumUsers(). . . . . . . . . . . . . . .31

NumVolumes(). . . . . . . . . . . . . .32

SecurEquiv(). . . . . . . . . . . . . .33

ServDate(). . . . . . . . . . . . . . .34

ServTime(). . . . . . . . . . . . . . .35

SetDefCon() . . . . . . . . . . . . . .36

UserName(). . . . . . . . . . . . . . .37

WhoAmI(). . . . . . . . . . . . . . . .38


LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 1


License Information

COPYRIGHT NOTICE

LXNet is copyrighted, and all rights are reserved. It is being released
as shareware. It may be tested, copied, uploaded to public access bulletin
boards, and distributed in any manner where the recipient pays for no more
than the cost of the distribution. All original files must be included.
LXNet may not be bundled with any other programs, libraries, or functions
without the written permission of the author.

RESTRICTIONS

LXNet functions may not be used in any application, for other than testing
purposes, by unregistered users. They may not be included in any application
that is in its final form, without registration.

DISCLAIMER

No guarantee of any kind is made in regards to these functions.

REGISTRATION

Use of LXNet may be registered by sending Twentyfive dollars to its author.
Any registered user may include the LXNet functions in any of his or her
applications that are for personal or corporate use, or that are distibuted
as .EXE applications. They are also entitled to make use of any upgrades
to the LXNet functions that are publicly available as shareware within
24 months of their original registration.

Note that registration does not provide the right to include LXNet
functions as part of any library of functions. Registration provides the
right to include LXNet functions only in applications distributed as .EXE
files.

To register, send $25.00 to: Randy Proulx
1618 Marion Rd. SE #47
Rochester, MN 55904



LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 2

How to use this library

This library needs no setup or special instructions. All you have
to do is include LXNet in you LIB or SEARCH parameters for PLINK.
If you don't use PLINK, you will have to follow the instructions for
your linker for adding libraries.

I originally wrote the functions for a client that wanted security
within their application that would follow their Novell groups and
security equivilances. After writing these functions, including
security in my menus was a snap. I hope you find them useful also.




LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 3

Future Features and Current Limitations
These function will only work on Novell Networks, I have no idea what
would happen on another network operating system. This Library has been
tested with Novell Netware V2.12. It should work with all Netware
versions 2.0 and later (with the exception of some queue option and the
capture command) since the system calls are the same. It has
not been tested with Clipper 5.0 either, no Clipper internals are called,
so it may work.

Changes from 1.0 (CLPNET)
Printing functions were added including Capture(), EndCap(),
FlushCap(), EndSpecCap(), FlushSCap(), CancelCap(), CanSpecCap(),
DefaultLPT(), GetBanUser(), A_Queues(), NumQueues().

A_Servers() and NumServers() were added.

IsNovell() was added.

Problem in A_Members was fixed. The problem caused A_Members to
return scambled user ids.

Changes from 1.1 (LXNet (9-24-90)
Multiple server functions were added including DefaultCon() and
SetDefCon().

A_Volume() and NumVolumes() were added to get volume names.

UserName() was added to get the full user name.

ServTime() and ServDate were added to get the server date and time.

Bug in IsNovell was fixed. This was called by many internals and
may have caused many functions to not work.


Future releases will include the following:

A function to login to any file server

A function to attach to another file server

A function to logout

A function to map drives

A function to get the user on any workstation

A function to send a message to another workstation

A function to get messages from other workstations

A function to caston and castoff (set broadcast mode)


LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 4

Changes from version 1.0
IsNovell() function has been added. This function calls a Novell
function call and checks for DOS's error code to see if it failed.
The function call should never have an error unless the Netware Shell
is not loaded. Limited testing of this function has been done, please
let me know if there is a problem with it.

Numerous printing functions have been added, the most usefull being
the capture command. You can now capture to a queue using most of
Novell's capture commands. Commands not supported yet are queueing
to a non-primary server, queueing to a file, specifying a jobname,
and setting the KEEP flag.


LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 5

Function :A_Groups

Syntax :A_Groups(a_var)

Description :A_Groups returns the Novell user groups in the array a_var.
a_var must be declared and have enough elements to hold all
the groups. NumGroups() can be used when declaring a_var
to set the correct number of elements.

Example :public groups[NumGroups()]
A_Groups(groups)
for i=1 to NumGroups()
? groups[i]
next



LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 6

Function :A_Members

Syntax :A_Members(a_var,groupname)

Description :A_Members returns all the members of the group groupname in
the array a_var. a_var must be declared and have enough
elements to hold all the groups. NumMembers() can be used
when declaring a_var to set the correct number of elements.


Example :public members[NumMembers('EVERYONE')]
A_Members(members,'EVERYONE')
for i=1 to NumMembers('EVERYONE')
? members[i]
next


LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 7

Function :A_Queues

Syntax :A_Queues(a_var)

Description :A_Queues returns all the print queues available on the
default server in the array a_var. a_var must be declared
and have enough elements to hold all the queues. NumQueues()
can be used when declaring a_var to set the correct number
of elements.


Example :public queues[NumQueues()]
A_Queues(queues)
for i=1 to NumQueues()
? queues[i]
next



LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 8

Function :A_Servers

Syntax :n_var=A_Servers(a_var)

Description :A_Servers returns all the server names that the workstation
is logged into in the array a_var. a_var must be declared
and have enough elements to hold all the servers. The File
Server Table has a maximum size of eight values and a_var
can be sized to 8 elements or NumServers() can be used to
size the array. A_Servers will return the number of file
servers found in the File Server Table.


Example :public servers[NumServers()] &&or public servers[8]
n_servs=A_Servers(servers)
for i=1 to n_servs
? servers[i]
next




LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 9

Function :A_Users

Syntax :A_Users(a_var)

Description :A_Users returns all the usernames for the default server.
a_var must be declared and have enough elements to hold all
the users. NumUsers() can be used when declaring a_var to
set the correct number of elements.


Example :public users[NumUsers()]
A_Users(users)
for i=1 to NumUsers()
? users[i]
next

LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 10

Function :A_volumes

Syntax :A_volumes(a_var)

Description :A_volumes returns all the volume names for the default server.
a_var must be declared and have enough elements to hold all
the volumes. NumVolumes() can be used when declaring a_var to
set the correct number of elements.


Example :public volumes[NumVolumes()]
A_Volumes(users)
for i=1 to NumVolumes()
? volumes[i]
next


LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 11

Function :Cancel_Cap

Syntax :Cancel_Cap()

Description :Cancel_Cap cancels the capture in progress for the default
LPT printer port. Any output not already printed will be
removed from the queue.


Example :capture('/q=myqueue /ti=0 /nb /nt')
set device to print
&&report begins
.
. user presses to cancel report
. and set cancel_report to .t.
.
if cancel_report
cancel_cap()
else
endcap()
endif
set device to screen






LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 12

Function :CanSpecCap

Syntax :CanSpecCap(lptport)

Description :CanSpecCap cancels the capture in progress for the specified
LPT printer port. Any output not already printed will be
removed from the queue. lptport can have the values of 1, 2,
or 3 for ports LPT1, LPT2, or LPT3.


Example :capture('/q=myqueue /ti=0 /nb /nt /l=2')
&& /l=2 will set capture to for LPT2
set device to print
set printer to LPT2 &&tells Clipper to use LPT2
&&report begins
.
. user presses to cancel report
. and set cancel_report to .t.
.
if cancel_report
CanSpecCap(2)
else
EndSpecCap(2)
endif
set device to screen
set printer to







LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 13

Function :Capture

Syntax :Capture(option_string)

Description :Capture will end the current capture and start a new one
using the options specified in option_string. Options
available are:

/q=
/b=
/ti=
/t=
/ff formfeed after capture
/nff no formfeed after capture
/p=
/l= /f=

/nam=
/a auto endcap (endcap when job is done)
/na no auto endcap
/c=
/nt no tab expansion

The / and the = are optional, all options must be seperated
by a space though. If you specify a queue name, you shouldn't
specify a server printer number. Specifing conflicting options
(such as both /a and /na) will have unpredictable results. The
banner name, queue name, and the form name cannot have any
spaces in them

Example :capture('/q=laser2 /ti=0 /nb /nt /l=2 /bBal_stmnt ff')







LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 14
ConnectNum()

Function :ConnectNum

Syntax :n_var=ConnectNum()

Description :ConnectNum returns the Novell connection number (1-250) of the
workstation making the call on the default file server. This
number is unique to the station on the default file server.
The connection number is often useful in generating unique
filenames for temporary files. This number is determined by
the file server and can change for the workstation when the
station is powered down (although Novell will try to reserve
the same number for the station).


Example :tmpfilename='TMP'+ltrim(str(connectnum()))
use customer index customer
copy to (tmpfilename) for state='MN'


LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 15

Function :DefaultLPT

Syntax :n_var=DefaultLpt()

Description :DefaultLPT will return the default LPT number (1-3) used
with the capture command.

Example :if defaultlpt()<>2
set printer to LPT2
endif


LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 16

Function :DefaultCon

Syntax :n_var=DefaultCon()

Description :DefaultCon will return the preferred connection ID number (1-8)
that correspondse with the server list. This function is used
to get the preferred server number when multiple servers are
available. Defaultcon will return 0 if no preferred server
is set.

How the active server is determined:

1) if the server is specified in the function, that
server will be used.

2) if no server is specified, the preferred server (if
specified) will be used.

3) if no server is specified and no preferred server
is set, the server that the current drive
(if networked) is logged into is used

4) if no server is specified, no preferred server is set,
and the current drive is not a network drive, then the
primary server is used (the primary server is the server
that the user logged into).

5) finally, if the primary server connection is lost, the
first server in the server table is used.


Example :&&to capture to a non-preferred (if available)
private servers[numservers()]
a_servers(servers)
if ascan(servers,'SERVER-2')<>0
oldserver=defaultcon()
setdefcon(ascan(servers,'SERVER-2'))
capture('qlaser nb ti0 nt')
setdefcon(oldserver)
else
capture('qokidata_3 nb ti0 nt')
endif






LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 17

Function :EndCap

Syntax :l_var=EndCap()

Description :EndCap will end and release the capture for the default LPT
port. L_var will return .t. if successfull, otherwise .f.


Example :capture('qlaser nt nb ff')
*print report
endcap()




LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 18

Function :EndSpecCap

Syntax :l_var=EndSpecCap(lptport)

Description :EndSpecCap will end and release the capture for the specified
LPT port. L_var will return .t. if successfull, otherwise .f.


Example :capture('qlaser nt nb ff l2')
*print report
endspeccap(2)




LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 19

Function :FlushCap

Syntax :l_var=FlushCap()

Description :FlushCap will release the capture for the default LPT port.
A new capture with the same parameters will be issued for
the LPT port. L_var will return .t. if successfull, otherwise
.f.


Example :capture('qlaser nt nb ff')
*print report
flushcap()
*print another report
endcap()




LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 20

Function :FluSpecCap

Syntax :l_var=FluSpecCap(lptport)

Description :FluSpecCap will release the capture for the specified LPT port.
A new capture with the same parameters will be issued for
the LPT port. L_var will return .t. if successfull, otherwise
.f.


Example :capture('qlaser nt nb ff l2')
*print report
fluspeccap(2)
*print another report
endcap(2)





LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 21

Function :GetBanUser

Syntax :c_var=GetBanUser()

Description :GetBanUser will return the banner user name that prints on the
banner page of captured printouts. Use the Capture command to
set the banner user name.


Example :buser=getbanuser()
capture('qlaser nt ff b'+trim(left(buser,5))+'_AP')





LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 22

Function :GetObjID

Syntax :n_var=GetObjID(obj_type,obj_name)

Description :Novell's bindery consist of entirely of objects. Each object
has an object type (either user, group, queue, etc.) and
one or more properties. The properties can have either a value
or a set of values. For a user, the object will have
properties for the user_name (just a value), a property for
the groups the user belongs to (a set of values) and gobs of
other properties for the user. Each object can be
identified by either it's object ID number or by its name and
the type. It is often useful to know the object ID of an
object such as a print queue (if you desire to write your
own capture, or something) but all of the LXNet functions
use names and types. The GetObjID is used mostly internally
by functions to convert from name to object ID for you.

Object Types:
FFFFh wildcard
0 Unknown
1 User
2 User Group
3 Print Queue
4 File Server
5 Job Server
6 Gateway
7 Print Server
8 Archive Queue
9 Archive Server
Ah Job Queue
Bh Administration
26h Remote Bridge Server
47h Advertising Print Server
thru 8000h Reserved



Example :maildir='\system\'+makehex(getobjid(1,whoami()))
if !file(maildir+'\*.ML')
? 'no mail in you mail directory'
endif





LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 23

Function :GetObjName

Syntax :c_var=GetObjName(objectid)

Description :GetObjName will return the name of an Object ID (see GetObjID
for description of Object ID's). This function is used
internally for the most part but can be called by clipper if
needed.


Example ๐Ÿ˜• GetObjName(GetObjID(2,'EVERYONE'))





LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 24

Function :GetObjType

Syntax :n_var=GetObjType(objectid)

Description :GetObjType will return the type of an Object ID (see GetObjID
for description of Object ID's). This function is used
internally for the most part but can be called by clipper if
needed.


Example :if GetObjType(GetObjID(find_object))=2
? find_object+' is a group'
else
? find_object+' not is a group'
endif


LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 25

Function :IsInGroup

Syntax :l_var=IsInGroup(username,groupname)

Description :IsInGroup will return a true if username is a member of
groupname. This function is useful for setting up
module security based on Novell's groups.


Example :if IsInGroup(WhoAmI(),'ADMINISTRATION')
FinReport()
else
? 'You do not have rights to print financial reports'
endif


LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 26

Function :IsNovell

Syntax :l_var=IsNovell()

Description :IsNovell returns .t. if the Novell Shell is loaded.


Example :if isnovell()
capture('qlaser nb ti10')
endif
set device to print
*print report
set device to screen
if isnovell()
endcap()
endif







LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 27

Function :NumGroups

Syntax :n_var=NumGroups()

Description :NumGroups returns the number of groups in the bindery. This
list includes the groups the current user does NOT belong to.
It is usually used in conjunction with A_Groups().


Example :public groups[NumGroups()]
A_Groups(groups)
for i=1 to NumGroups()
? groups[i]
next


LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 28

Function :NumMembers

Syntax :n_var=NumMembers(groupname)

Description :NumMembers returns the number of members in groupname.
It is usually used in conjunction with A_Members().


Example :public members[NumMembers('EVERYONE')]
A_Members(members,'EVERYONE')
for i=1 to NumMembers('EVERYONE')
? members[i]
next

LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 29

Function :NumQueues

Syntax :n_var=NumQueues()

:NumQueues returns the number of print queues for the default
file server. It is usually used in conjunction with A_Queues().


Example :public queues[NumQueues()]
A_Queues(queues)
for i=1 to NumQueues()
? queues[i]
next


LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 30

Function :NumServers

Syntax :n_var=NumServers()

:NumServers returns the number of servers that are reporting to
the workstation. It is usually used in conjunction with
A_Servers().


Example :public servers[NumServers()]
A_Servers(servers)
for i=1 to NumServers()
? servers[i]
next



LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 31

Function :NumUsers

Syntax :n_var=NumUsers()

Description :NumUsers returns the number of users for the default file
server. It is usually used in conjunction with A_Users().


Example :public users[NumUsers()]
A_Users(users)
for i=1 to NumUsers()
? users[i]
next


LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 32

Function :NumVolumes

Syntax :n_var=NumVolumes()

Description :NumVolumes returns the number of volumes for the default file
server. It is usually used in conjunction with A_Volumes().


Example :public volumes[NumVolumes()]
A_Volumes(users)
for i=1 to NumVolumes()
? volumes[i]
next



LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 33

Function :SecurEquiv

Syntax :l_var=SecurEquiv(username,objectname)

Description :SecurEquiv will return true if username has the security
equivilance as objectname. Objectname can be either a
user or a group.


Example :if SecurEquiv(WhoAmI(),'SUPERVISOR')
maint_menu()
else
? 'Must be Supervisor to run maintenance'
endif


LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 34

Function :ServDate

Syntax :d_var=ServDate()

Description :ServDate will return the server date in clipper date format.
Server date and times are not synchronized on an inter-
network, so the server date will come from the default file
server. Use SetDefCon() to designate which server to get
the date (or time) from if you have multiple servers available.
Any year before 1980 is assumed to be in the 21st century.


Example :replace accessdate with servdate()






LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 35

Function :ServTime

Syntax :c_var=ServTime()

Description :ServTime will return the server time in clipper 99:99:99
character format. Server date and times are not synchronized
on an internetwork, so the server time will come from the
default file server. Use SetDefCon() to designate which
server to get the time (or date) from if you have multiple
servers available.


Example :replace accesstime with servtime()







LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 34

Function :SetDefCon

Syntax :SetDefCon(connection_ID)

Description :SetDefCon will set the preferred connection ID to the server
in the connection_IDth slot in the server table. The
server table can be read with A_Servers. All request to
a server will go to the new preferred after this call.
Setting the preferred connection ID to 0 will reset the
preferred server to the first server on the list.

*see DEFAULTCON() for description of server priority.


Example :&&to capture to a non-preferred (if available)
private servers(numservers())
a_servers(servers)
if ascan(servers,'SERVER-2')<>0
oldserver=defaultcon()
setdefcon(ascan(servers,'SERVER-2'))
capture('qlaser nb ti0 nt')
setdefcon(oldserver)
else
capture('qokidata_3 nb ti0 nt')
endif





LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 35

Function :UserName

Syntax :c_var=UserNamt([loginname])

Description :UserName returns the full name of the specified loginname or
the user logged into the current workstation if no loginname
is specified.




Example ๐Ÿ˜• 'Hello, '+UserName()
? username('RFP')





LXNet Ver. 1.2 - Novell bindery/printing functions for Clipper 36

Function :WhoAmI

Syntax :c_var=WhoAmI()

Description :WhoAmI returns the name of the object logged into the
workstation. *Note* It is not always a user logged into
a workstation as print servers and job servers can also
login to a workstation.




Example ๐Ÿ˜• 'Hello, '+WhoAmI()













 December 21, 2017  Add comments

Leave a Reply