NetBasic API Reference


NET:Bindery:First

Module:NET.NLM
Purpose:Get the bindery object for the first item that matches a specified pattern.
Syntax:<oBindery> = NET:Bindery:First (<sName>,[<iType>])
Description:NET:Bindery:First gets the bindery object for the first item in the bindery list in which the name attribute matches the specified string <sName>. The wildcard characters asterisk "*" and question mark "?" may be used to specify a search pattern. The asterisk matches any length string and the question mark matches only one character. The integer <iType> specifies the type attribute of the bindery object being retrieved (see Appendix C - Reserved Network Names). When the optional parameter <iType> is not supplied, the wildcard type is presumed and the object for the first item matching the name <sName> will be returned. NET:Bindery:First returns the object <oBindery> that is used to access the bindery object attributes.
Outputs:Bindery object
Attributes:[Read-Write]: Name, Type, Security.Read, Security.Write, Password; [Read-Only]: Error, Flag, ID, Internet.Socket, Internet.Node, Internet.Network
Note:NET.H must be included in the program in order to take advantage of the reserved constants for the attributes <iType>.
See Also:NET:Bindery:Next, NET:Bindery:Get, Bindery, Appendicies
Example:BindObj = NET:Bindery:First("*", NET_USER)
Do While (True)
If (BindObj.Error != 0)
Quit
EndIf
Print(BindObj.ID, " ", BindObj.Name); Newline
BindObj = NET:Bindery:Next(BindObj)
EndDo

Go to Table of Contents

NET:Bindery:Get

Module:NET.NLM
Purpose:Get the bindery object for the item that matches a specified name.
Syntax:<oBindery> = NET:Bindery:Get ([<sName>,[<iType>]])
Description:NET:Bindery:Get gets the bindery object for the item in the bindery list in which the name matches a specified name <sName>. The integer <iType> specifies the type attribute for the bindery object being retrieved (see Appendix C - Reserved Network Names). When the optional parameter <iType> is not supplied, the wildcard type is presumed, and the object for the first item matching the name <sName> will be returned. The NET:Bindery:Get command, without any parameter, returns a null bindery object which may be used to create a new bindery object in the bindery services. NET:Bindery:Get returns the object <oBindery> that is used to access the bindery object attributes.
Outputs:Bindery object.
Attributes:[Read-Write]: Name, Type, Security.Read, Security.Write, Password; [Read-Only]: Error, Flag, ID, Internet.Socket, Internet.Node, Internet.Network
Note:NET.H must be included in the program in order to take advantage of the reserved constants for the attributes <iType>.
See Also:NET:Bindery:Set, Bindery, Appendicies
Example:BindObj = NET:Bindery:Get("BOB", NET_USER)
If (BindObj.Error = 0)
BindObj.Name = "ROBERT"
BindObj = NET:Bindery:Set(BindObj)
If (BindObj.Error = 0)
Print("The user BOB is changed to ROBERT")
EndIf
EndIf

Go to Table of Contents

NET:Bindery:Next

Module:NET.NLM
Purpose:Get the next bindery object item listed after a specified bindery object.
Syntax:<oBindery2> = NET:Bindery:Next (<oBindery1>)
Description:NET:Bindery:Next gets the bindery object for the next item listed immediately after the item that is represented by bindery object <oBindery1> in the bindery list. The next bindery object is found based on the criteria specified by the previous NET:Bindery:First command. NET:Bindery:Next returns the object <oBindery2> that contains the attributes for the new bindery object found.
Outputs:Bindery object
Attributes:[Read-Write]: Name, Type, Security.Read, Security.Write, Password; [Read-Only]: Error, Flag, ID, Internet.Socket, Internet.Node, Internet.Network
Note:NET.H must be included in the program in order to take advantage of the reserved constants for the attributes <iType>.
See Also:NDS:Session:Select(NewSession)
See Also:NET:Bindery:First, NET:Bindery:Get, Bindery, Appendicies
Example:BindObj = NET:Bindery:First("*", NET_USER)
Do While (True)
If (BindObj.Error != 0)
Quit
EndIf
Print(BindObj.ID, " ", BindObj.Name); Newline
BindObj = NET:Bindery:Next(BindObj)
EndDo

Go to Table of Contents

NET:Bindery:Property:Member:Add

Module:NET.NLM
Purpose:Add object information to a bindery object property
Syntax:<lAdd> = NET:Bindery:Property:Member:Add (<oBin1>, <sProp>, <oBin2>)
Description:Net:Bindery:Property:Member:Add adds the object <oBin2> to the property <sProp> of the bindery object <oBin1>. The property <sProp> must be attachable to the object <oBin1>, and the object <oBin2> must be of the correct type for the property <sProp> (see Bindery Objects). The returned logical <lAdd> is true when <oBin2> is added to <oBin1>, and false otherwise. When the returned logical is false Err is assigned a value which may be used to identify the cause of the failure.
Outputs:Logical
Note:When the object <oBin2> is added to the property <sProp> of the bindery object <oBin1>, the object <oBin1> inherits all privileges associated with the property <sProp> of bindery object <oBin2>.
See Also:NET:Bindery:Property:Member:Delete, NET:Bindery:Property:Member:Exist, SYS:Error:Number, Bindery
Example:Prop = "SECURITY_EQUALS"
Bin1 = NET:Bindery:Get("BOB", NET_USER)
Bin2 = NET:Bindery:Get("SUPERVISOR", NET_USER)
If (!NET:Bindery:Property:Member:Add(Bin1, Prop, Bin2))
Print("Error adding the property")
Else
Print("Supervisory security is added to Bob")
EndIf

Go to Table of Contents

NET:Bindery:Property:Member:Delete

Module:NET.NLM
Purpose:Delete object information from a bindery object property
Syntax:<lDel> = NET:Bindery:Property:Member:Delete (<oBin1>, <sProp>, <oBin2>)
Description:Net:Bindery:Property:Member:Delete deletes the object <oBin2> from the property <sProp> of the bindery object <oBin1>. The string <sProp> is the name of the property attached to the object <oBin1>. The object <oBin2> is a bindery object listed in the property <sProp> (See: Bindery Objects). The returned logical <lDel> is true when the object is deleted from the property, and false otherwise. When the returned logical is false Err is assigned a value which may be used to identify the cause of the failure.
Outputs:Logical
Note:When the object <oBin2> is deleted from the property <sProp> of the bindery object <oBin1>, the object <oBin1> forfeits all privileges associated with the property <sProp> of the bindery object <oBin2>.
See Also:NET:Bindery:Property:Member:Add, NET:Bindery:Property:Member:Exist, SYS:Error:Number, Bindery
Example:Prop = "SECURITY_EQUALS"
Bin1 = NET:Bindery:Get("BOB", NET_USER)
Bin2 = NET:Bindery:Get("SUPERVISOR", NET_USER)
If (!NET:Bindery:Property:Member:Exist(Bin1,Prop,Bin2))
Print("Bob does not have supervisory security")
EndIf
If (!NET:Bindery:Property:Member:Delete(Bin1,Prop,Bin2))
Print("Error deleting the property")
Else
Print("Supervisory security is removed.")
EndIf

Go to Table of Contents

NET:Bindery:Property:Member:Exist

Module:NET.NLM
Purpose:Determine if an object exists as a bindery object property
Syntax:<lExist> = NET:Bindery:Property:Member:Exist (<oBin1>, <sProp>, <oBin2>)
Description:Net:Bindery:Property:Member:Exist determines if the object <oBin2> exists in the property <sProp> of the bindery object <oBin1>. The string <sProp> is the name of the property attached to the object <oBin1>. The object <oBin2> is a bindery object possibly listed in the property <sProp> (See: Bindery Objects). When the returned logical <lExist> is true the object exists in the property, and is false otherwise. When the returned logical is false Err is set to a value which may be used to identify the cause of the failure.
Outputs:Logical
See Also:NET:Bindery:Property:Member:Add, NET:Bindery:Property:Member:Delete, SYS:Error:Number, Bindery, Appendicies
Example:NET:Bindery:Property:Member:Exist(Bin1,Prop,Bin2)

Go to Table of Contents

NET:Bindery:Set

Module:NET.NLM
Purpose:Set the information in the bindery list according to the specified bindery object.
Syntax:<oBindery2> = NET:Bindery:Set (<oBindery1>)
Description:NET:Bindery:Set sets the information in the bindery list according to the specified bindery object <oBindery1>. The returned bindery object <oBindery2> contains the updated attributes for the bindery object <oBindery1>. NET:Bindery:Set is the object manager for bindery objects, and all changes to the bindery list are made by this command. When an object with a null name attribute is supplied to NET:Bindery:Set, that object will be deleted from bindery services. To add a new object to the bindery services, retrieve a null object using the NET:Bindery:Get command, assign all the required attributes, and supply the new object to the NET:Bindery:Set command.
Outputs:Bindery object
Attributes:[Read-Write]: Name, Type, Security.Read, Security.Write, Password; [Read-Only]: Error, Flag, ID, Internet.Socket, Internet.Node, Internet.Network
Note:The NET:Bindery:Set command does not manage the properties of bindery objects. The NET:Bindery:Property:.. commands are used to add, delete or check the existence of a property of a bindery object.
See Also:NET:Bindery:Get, Bindery
Example:BindObj = NET:Bindery:Get("BOB", NET_USER)
If (BindObj.Error = 0)
BindObj.Name = "ROBERT"
BindObj = NET:Bindery:Set(BindObj)
If (BindObj.Error = 0)
Print("The user BOB is changed to ROBERT")
EndIf
EndIf

Go to Table of Contents

NET:Broadcast:Receive

Module:NET.NLM
Purpose:Retrieve message from the message buffer.
Syntax:<sMessage> = NET:Broadcast:Receive
Description:NET:Broadcast:Receive returns the string <sMessage> that represents the message in the message buffer. During program execution, broadcast is disabled, and the incoming message is stored in the message buffer. When the message buffer is empty, the NET:Broadcast:Receive command returns a null string.
Outputs:String
See Also:NET:Broadcast:Send
Example:Do While (True)
Message = NET:Broadcast:Receive
If (Message != Null)
Print(Message); Newline
EndIf
Sys:Delay(3000)
EndDo

Go to Table of Contents

NET:Broadcast:Send

Module:NET.NLM
Purpose:Broadcast a message to a specified connection.
Syntax:<lSend> = NET:Broadcast:Send (<sMessage>,[<iConnection>])
Description:Broadcast a message <sMessage> to the connection number <iConnection>. The string <sMessage> can be up to 78 characters. The integer <iConnection> is the connection number for the logged-in client that is to receive the message. When the optional parameter <iConnection> is not specified, the message is sent to all logged-in clients. The returned logical <lSend> is true if the message is successfully delivered, and false otherwise. When the returned logical is false Err is set to a value which may be used to identify the cause of failure.
Outputs:Logical
See Also:NET:Broadcast:Receive, NET:Connection:Info, SYS:Error:Number, Appendicies
Example:ConNo = 1
Found = False
Do While (ConNo <=250)
ConObj = NET:Connection:Info(ConNo)
If (ConObj.Name = "BOB")
If (NET:Broadcast:Send("Hello Bob", ConNo))
Print("Message was sent")
Else
Print("Error sending the message")
EndIf
Found = True
EndIf
ConNo = ConNo + 1
EndDo
If (!Found)
Print("BOB is not logged in")
EndIf

Go to Table of Contents

NET:Connection:Clear

Module:NET.NLM
Purpose:Disconnect a specified connection.
Syntax:<lConnect> = NET:Connection:Clear (<iConnection>)
Description:NET:Connection:Clear disconnects the connection specified by the connection number <iConnection>. The returned logical <lConnect> is true if the connection is properly disconnected, and is false otherwise. When the returned logical is false, the Err command returns a number which may be used to identify the cause of failure.
Outputs:Logical
Note:Only authorized console operators can issue the NET:Connection:Clear command.
See Also:NET:Logout, NET:Login, NET:Connection:Get, NET:Connection:Info, SYS:Error:Number
Example:ConNo = 1
AllClear = True
MyConnection = NET:Connection:Get
Do While (ConNo <=250)
If (ConNo != Data:Integer(MyConnection.Number))
If (!NET:Connection:Clear(ConNo))
Print("Cannot clear Connection# ",ConNo)
AllClear = False
EndIf
EndIf
ConNo = ConNo + 1
EndDo
If (AllClear)
Print("All other connections are cleared")
EndIf

Go to Table of Contents

NET:Connection:Get

Module:NET.NLM
Purpose:Returns an object referencing the default file server connection
Syntax:<oConnection> = NET:Connection:Get
Description:NET:Connection:Get returns the connection object <oConnection> containing the ID, and error attributes for the connection currently used to communicate with the default file server.
Outputs:Connection object
Attributes:[Read-Write]: ID; [Read-Only]: Number,Server.Name, Server.ID, Error
See Also:NET:Connection:Info, Connection, Appendicies
Example:ServerID = NET:Server:Attach("HITECSOFT2")
ConObj = NET:Connection:Get
If (ConObj.Error != 0); Print("Error"); Return; EndIf
ConObj.ID = ServerID
ConObj = Net:Connection:Set(ConObj)
If (ConObj.Error !=0); Print("Error"); Return; EndIf
If (NET:Login("BOB",NET_USER,"MYSECRET"))
Print("Login successful")
Else
Print("Unable to login")
EndIf

Go to Table of Contents

NET:Connection:Info

Module:NET.NLM
Purpose:Return an object referencing a specified connection number
Syntax:<oInfo> = NET:Connection:Info ([<iConnection>])
Description:Return an object <oInfo> containing information on the specified connection number <iConnection>. When a client attaches to a file server that file server assigns a connection number uniquely identifying a client among all others. A client connection is used to communicate with the default file server. When the optional parameter <iConnection> is not specified, the current connection is presumed. Connection objects contain the same attributes as a bindery object plus the Date, Time and Day attributes. All connection object attributes are read-only.
Outputs:Connection information object
Attributes:[Read-Only]: Date, Time, ID, Name, Type, Flag,
Security.Read, Security.Write, Internet.Socket, Internet.Node, Internet.Network, Error
Note:When a client connects to more than one file server, each file server assigns its own connection number to the client. The number assigned may or may not be the same number assigned to the client by other file servers.
See Also:NET:Connection:Get, Connection, Appendicies
Example:ConNo = 1
Do While (ConNo <=250)
ConObj = NET:Connection:Info(ConNo)
If ((ConObj.Error = 0) & (ConObj.Bindery.Name = "BOB"))
NET:Broadcast:Send("Hello Bob", ConNo)
EndIf
ConNo = ConNo + 1
EndDo

Go to Table of Contents

NET:Connection:Set

Module:NET.NLM
Purpose:Reset the connection ID for a specified client
Syntax:<oConn2> = NET:Connection:Set (<oConn1>)
Description:Reset a clients connection ID to a value specified in <oConn1>. The connection ID identifies the default file server. Network commands for which the target file server is not specified are presumed to be for the default file server. The returned connection object <oConn2> contains the updated attributes for the connection object <oConn1>. NET:Connection:Set serves as an object manager. Any changes to the connection ID are made by this command.
Outputs:Connection object
Attributes:[Read-Write]: ID; [Read-Only]: Number, Server.Name, Server.ID, Error
Note:Each client can only change their connection ID.
See Also:NET:Connection:Get, Connection, Appendicies
Example:ServerID = NET:Server:Attach("HITECSOFT2")
ConObj = NET:Connection:Get
If (ConObj.Error !=0); Print("Error"); Return; EndIf
ConObj.ID = ServerID
ConObj = Net:Connection:Set(ConObj)
If (ConObj.Error !=0); Print("Error"); Return; EndIf
If (NET:Login("BOB",NET_USER,"MYSECRET"))
Print("Login successful")
Else
Print("Unable to login")
EndIf

Go to Table of Contents

NET:Console:Rights

Module:NET.NLM
Purpose:Determine if the current connection has console rights.
Syntax:<lConsoleRight> = NET:Console:Rights
Description:NET:Console:Rights returns the logical <lConsoleRight>, which is true if the current connection has console rights, and is false otherwise. The current connection is the connection that is currently used to communicate with the default file server.
Outputs:Logical
See Also:**
Example:If (NET:Console:Rights)
Print("I have console rights")
Else
Print("I do not have console rights")
EndIf

Go to Table of Contents

NET:Internet:Address

Module:NET.NLM
Purpose:Get the Internet object for a specified connection number.
Syntax:<oInternet> = NET:Internet:Address ([<iConnection>])
Description:NET:Internet:Address returns the Internet object <oInternet> for the connection specified by the connection number <iConnection>. Internet objects contain the network number, node address and socket address used to locate a workstation or a process running on a computer within an internetwork system. When the optional parameter<iConnection> is not specified, the current connection is presumed. The current connection is the connection that is currently used to communicate with the default file server.
Outputs:Internet Object
Attributes:[Read-Only]: Network, Node, Socket, Error
Note:The Socket attribute is only available for the current connection, and for all other connections it is zero.
See Also:Internet
Example:InternetObj = NET:Internet:Address
Print("Socket address is ", InternetObj.Socket); Newline
Print("Node address is ", InternetObj.Node); Newline
Print("Network address is ", InternetObj.Network); Newline

Go to Table of Contents

NET:Link:Advertise:Start

Module:NET.NLM
Purpose:Advertise the server services and add server information to the bindery list on all file servers.
Syntax:<lAdvertised> = NET:Link:Advertise:Start (<oLink>)
Description:NET:Link:Advertise:Start advertises the services of the server specified by the link object <oLink> and adds the server information to the bindery list on all file servers. The client application can search the bindery list to retrieve the server information and create the communication link. The returned logical <lAdvertised> is true when the service is properly advertised, and is false otherwise. When the returned logical is false, the Err command returns a number which may be used to identify the cause of failure. When the server services are terminated, the NET:Link:Advertise:Stop command must be issued to remove the server information from the bindery.
Outputs:Logical
See Also:NET:Link:Advertise:Stop, SYS:Error:Number, Link
Example:See: example for NET:Link:Server:Open command

Go to Table of Contents

NET:Link:Advertise:Stop

Module:NET.NLM
Purpose:Stop advertising a specified server and remove the server information from the bindery list.
Syntax:<lAdvertised> = NET:Link:Advertise:Stop (<oLink>)
Description:NET:Link:Advertise:Stop stops advertising the server specified by the link object <oLink> and removes the server information from the bindery list. When the server services are terminated, the NET:Link:Advertise:Stop command must be issued to remove the server information from the bindery list. The returned logical <lAdvertised> is true when the advertising is properly stopped, and is false otherwise. When the returned logical is false, the Err command returns a number which may be used to identify the cause of failure.
Outputs:Logical
See Also:NET:Link:Advertise:Start, SYS:Error:Number, Link
Example:See example for NET:Link:Server:Open command

Go to Table of Contents

NET:Link:Client:Close

Module:NET.NLM
Purpose:Close the client communication link for a specified link object.
Syntax:<lClosed> = NET:Link:Client:Close (<oLink>)
Description:NET:Link:Client:Close closes the client communication link specified by the link object <oLink>. When the client application has finished communicating with the server, the NET:Link:Client:Close command must be issued to properly end the communication link. The returned logical <lClosed> is true when the communication link is properly closed, and is false otherwise. When the returned logical is false, the Err command returns a number which may be used to identify the cause of failure.
Outputs:Logical
See Also:NET:Link:Client:Open, SYS:Error:Number, Link
Example:See example for NET:Link:Client:Open command

Go to Table of Contents

NET:Link:Client:Open

Module:NET.NLM
Purpose:Open a client communication link to a specified server application.
Syntax:<oLink> = NET:Link:Client:Open (<sProtocol>, <oBindery>)
Description:Open a client communication link with the communication protocol <sProtocol> to the server application specified by the bindery object <oBindery>. Information on a server application is added to the bindery by using the NET:Link:Advertise:Start command. A client references a server name and type to search the bindery for a server application. If found a bindery object <oBindery> representing the server application is returned. Since the bindery list does not contain information about the server's communication protocol, the client application must know the protocol <sProtocol> in order to create a link. The returned link object <oLink> is used to communicate with the server application. When a client application has finished communicating with the server, the NET:Link:Client:Close command must be issued to properly end the communication link.
Outputs:Link object
Attributes:[Read-Write]: Name, Type, Data, Internet.Socket, Internet.Node, Internet.Network; [Read-Only]: Protocol.Name, Protocol.Handle, Error
See Also:NET:Link:Client:Close, Link
Example:BindObj = NET:Bindery:Get("SHOWLINE", 1000)
LinkObj = NET:Link:Client:Open("IPX", BindObj)
LinkObj.Data = "Testing server link"
LinkObj = NET:Link:Data:Send(LinkObj)
If (LinkObj.Error) = ERR_DISCONNECTED
Print("Error sending message")
Else
If (!NET:Link:Client:Close(LinkObj))
Print("Error closing link")
EndIf
EndIf

Go to Table of Contents

NET:Link:Data:Receive

Module:NET.NLM
Purpose:Receive data from a specified communication link.
Syntax:<oLink2> = NET:Link:Data:Receive (<oLink1>)
Description:NET:Link:Data:Receive receives data from the communication link specified by the link object <oLink1>. The Data attribute of the returned link object <oLink2> contains the data, which is a string with a maximum of 512 characters.
Outputs:Link object
Attributes:[Read-Write]: Name, Type, Data, Internet.Socket, Internet.Node, Internet.Network; [Read-Only]: Protocol.Name, Protocol.Handle, Error
See Also:NET:Link:Data:Send, Link
Example:See example for the NET:Link:Server:Open command

Go to Table of Contents

NET:Link:Data:Send

Module:NET.NLM
Purpose:Send data to a specified communication link.
Syntax:<oLink2> = NET:Link:Data:Send (<oLink1>)
Description:NET:Link:Data:Send sends data to the communication link specified by the link object <oLink1>. The data is a string with a maximum of 512 characters and is contained in the Data attribute of the link object <oLink1>. The Error attribute for the returned link object <oLink2> determines if the data was properly sent.
Outputs:Link Object
See Also:NET:Link:Data:Receive, SYS:Error:Number, Link
Example:See example for the NET:Link:Client:Open command

Go to Table of Contents

NET:Link:Server:Close

Module:NET.NLM
Purpose:Close the server communication link for a specified link object.
Syntax:<lClosed> = NET:Link:Server:Close (<oLink>)
Description:NET:Link:Server:Close closes the server communication link specified by the link object <oLink>. When the server application has finished communicating with the client, the NET:Link:Server:Close command must be issued to properly end the communication link. The returned logical <lClosed> is true when the communication link is properly closed, and is false otherwise. When the returned logical is false, the Err command returns a number which may be used to identify the cause of failure.
Outputs:Logical
See Also:NET:Link:Server:Open, SYS:Error:Number, Link
Example:See example for the NET:Link:Server:Open command

Go to Table of Contents

NET:Link:Server:Open

Module:NET.NLM
Purpose:Create a communication link server
Syntax:<oLink> = NET:Link:Server:Open (<sProtocol>, <sName>, <iType>, <iSocket>])
Description:Create a communication link server using communication protocol <sProtocol>, bindery name <sName>, bindery type <iType> and socket address <iSocket>. The optional socket address <iSocket> is usually not supplied (or supplied as zero). Instead, the first available socket address is used. The returned link object <oLink> must be supplied to the NET:Link:Advertise:Start command to advertise server services and add server information to the bindery. Once server information has been added to the bindery, a client application can search the bindery, retrieve server information, and create a client communication link.
Outputs:Link object
Attributes:[Read-Write]: Name, Type, Data, Internet.Network, Internet.Node, Internet.Socket; [Read-Only]: Protocol.Name, Protocol.Handle, Error
Note:The communication protocol <sProtocol> can be either "IPX" or "SPX".
See Also:NET:Link:Server:Close, NET:Link:Data:Send, Bindery
Example:LinkObj=NET:Link:Server:Open("IPX","SHOWLINE",1000)
If (!NET:Link:Advertise:Start(LinkObj)); Quit; EndIf
Do While (True)
LinkObj = Net:Link:Data:Receive(LinkObj)
If (LinkObj.Error = ERR_DISCONNECTED);Exit;EndIf
Print(LinkObj.Data); Newline
SYS:Delay(1000)
EndDo
NET:Link:Advertise:Stop(LinkObj)
Net:Link:Server:Close(LinkObj)

Go to Table of Contents

NET:Login

Module:NET.NLM
Purpose:Log in to the default file server.
Syntax:<lLogged> = NET:Login (<sName>, <iType>, <sPassword>)
Description:NET:Login logs in a client to the default file server. The type of client logging in is specified by its type <iType>, name <sName>, and Password <sPassword>. Prior to logging in, a client must attach to a file server using the NET:Server:Attach command and select the default file server using the NET:Connection:Get and NET:Connection:Set commands. A client can log in to a maximum of eight file servers. The returned logical <lLogged> is true when a client has successfully logged in to a file server, and false otherwise. When the returned logical is false, Err is set to a value which may be used to identify the cause of failure.
Outputs:Logical
Note:The connection ID identifies the default file server. When a client is logged in to a file server under the DOS Operating System, the first available network drive letter is mapped to the server SYS: volume. Make sure that after logging in, a client has full access rights to all necessary program source code and temporary files.
See Also:NET:Logout, NET:Server:Attach, NET:Connection:Get, NET:Connection:Set, SYS:Error:Number, Bindery
Example:ServerID = NET:Server:Attach("HITECSOFT2")
ConObj = NET:Connection:Get
ConObj.ID = ServerID
ConObj = Net:Connection:Set(ConObj)
If (NET:Login("BOB",NET_USER,"MYSECRET"))
Print("Login successful")
EndIf

Go to Table of Contents

NET:Login:Disable

Module:NET.NLM
Purpose:Prevent new clients from logging in to the default file server.
Syntax:<lDisabled> = NET:Login:Disable
Description:NET:Login:Disable prevents new clients from logging in to the default file server. The returned logical <lDisabled> is true when the login is properly disabled, and is false otherwise. When the returned logical is false, the Err command returns a number which may be used to identify the cause of failure.
Outputs:Logical
Note:The connection ID is used to identify the default file server. Only authorized console operators can issue the NET:Login:Disable command.
See Also:NET:Login:Enable, NET:Login:Status, NET:Login, NET:Connection:Get, NET:Connection:Set, SYS:Error:Number, Bindery, Connection
Example:If (NET:Login:Disable)
Print("Login is disabled for this server")
Else
Print("Can not disable login")
EndIf

Go to Table of Contents

NET:Login:Enable

Module:NET.NLM
Purpose:Allow new clients to log in to the default file server.
Syntax:<lEnabled> = NET:Login:Enable
Description:NET:Login:Enable allows new clients to log in to the default file server. The returned logical <lEnabled> is true when the login is properly enabled, and is false otherwise. When the returned logical is false, the Err command returns a number which may be used to identify the cause of failure.
Outputs:Logical
Note:The connection ID is used to identify the default file server. Only authorized console operators can issue the NET:Login:Enable command.
See Also:NET:Login:Disable, NET:Login:Status, NET:Login, NET:Connection:Get, NET:Connection:Set, SYS:Error:Number, Bindery
Example:If (NET:Login:Enable)
Print("Login is enabled for this server")
Else
Print("Can not enable login")
EndIf

Go to Table of Contents

NET:Login:Status

Module:NET.NLM
Purpose:Determine the login status of the default file server.
Syntax:<lStatus> = NET:Login:Status
Description:NET:Login:Status returns the logical <lStatus>, which indicates whether new clients are allowed to log in to the default file server. When the logical <lStatus> is true, new clients are allowed to log in to the default file server. When the logical <lStatus> is false, new clients are not allowed to log in to the default file server.
Description:Logical
Note:The connection ID is used to identify the default file server.
See Also:NET:Login:Disable, NET:Login:Enable, NET:Login, NET:Connection:Get, NET:Connection:Set, Bindery
Example:If (NET:Login:Status)
Print("Login is enabled")
Else
Print("Login is disabled")
EndIf

Go to Table of Contents

NET:Logout

Module:NET.NLM
Purpose:Log out from a specified file server.
Syntax:<lLogOut> = NET:Logout (<[iConnectionID>])
Description:NET:Logout logs out the client from the file server specified by the connection ID <iConnectionID>. When the optional parameter <iConnectionID> is not supplied, the NET:Logout command logs out the client from all file servers. The returned logical <lLogOut> is true when the client is properly logged out from the file server, and is false otherwise. When the returned logical is false, the Err command returns a number which may be used to identify the cause of failure.
Outputs:Logical
Note:When a client has logged out of a file server, the client remains attached to the file server and NET:Server:Detach must be issued in order to detach the client from that file server. Make sure that after the NET:Logout command is issued, the client continues to have full access to all program source code and temporary files.
See Also:NET:Login, NET:Server:Detach, SYS:Error:Number
Example:ConObj = NET:Connection:Get
If (ConObj.Error = 0)
If (NET:Logout(ConObj.ID))
Print("Logout successful")
Else
Print("Unable to logout")
EndIf
Else
Print("Unable to get connection ID")

Go to Table of Contents

NET:Ncp:Call

Module:NET.NLM
Purpose:Communicate directly with NetWare Operating System (OS) via NetWare Core Protocol (NCP)
Syntax:<sReply> = NET:Ncp:Call (<iFunction>, <sPacket>, <iSize>)
Description:NET:Ncp:Call serves as an function for access to NetWare Core Protocol commands. Input the NCP function number <iFunction>, the request packet <sPacket>, and the length of the return packet <iSize>. NCP:Call is intended for experienced users familiar with NCP structures. NCP requests are passed directly to the NetWare Operating System and are therefore executed outside of NetBasic's protected environment. When an NCP request is successfully made, the global NetBasic system variable Err returns zero. Otherwise, it is set to the error number matching that returned by the NetWare Operating System.
Outputs:String
Note:For more detailed information on NCP calls, obtain NetWare Client API For Assembly Volumes 1 and 2 from Novell, Inc. at 1-800-REDWORD. Information on NCP calls is also available from Novell via CD-Rom.
See Also:Appendicies
Example:Local("ReqP","RepP")
Local("ServObj")
' Build request packet for NCP call - Get File Server Information.
' Append character with ASCII value 17 to end of string ReqP.
ReqP = DATA:Char(17)
' Attach string length of ReqP to the front of string ReqP.
' Length is represented by ASCII characters.
Reqp = DATA:Char(STR:Length(Reqp) / 256) +DATA:Char(MATH:Mod(STR:Length (Reqp),256)) + ReqP
' Request NCP call - Get File Server Information.
RepP = NET:Ncp:Call( 23,ReqP,256)
' If NetWare reported an error make an error object and return it in place of a server object.
If (Err != 0)
ServObj = Object:Make("ERROR",-101)
Return ( ServObj)
EndIf
' Extract subset strings from string RepP, and use them to make a server object.
ServObj = OBJECT:Make ( "ERROR", 0)
ServObj = ServObj + OBJECT:Make ( "SERVER.NAME", STR:Sub( RepP, 1, 48))
ServObj = ServObj + OBJECT:Make ( "SERVER.VERSION", DATA:Ascii( STR:SUB ( RepP,49,1)))
ServObj = ServObj + OBJECT:Make ( "SERVER.SUBVERSION", DATA:Ascii( STR:SUB ( RepP,50,1)))
ServObj = ServObj + OBJECT:Make ( "SERVER.CONNECTION.MAX", (DATA:Ascii ( STR:SUB ( RepP,52,1)) + ( DATA:Ascii ( STR:SUB ( RepP,51,1)) * 256)))
ServObj = ServObj + OBJECT:Make ( "SERVER.CONNECTION.USED",( DATA:Ascii ( STR:SUB ( RepP,54,1)) +( DATA:Ascii ( STR:SUB ( RepP,53,1)) * 256)))
ServObj = ServObj + OBJECT:Make ( "SERVER.CONNECTION.PEAK",( DATA:Ascii ( STR:SUB ( RepP,61,1)) +( DATA:Ascii ( STR:SUB ( RepP,60,1)) * 256)))
ServObj = ServObj + OBJECT:Make ( "SERVER.VOLUME.MAX",( DATA:Ascii ( STR:SUB ( RepP,56,1)) +( DATA:Ascii ( STR:SUB ( RepP,55,1)) * 256)))
ServObj = ServObj + OBJECT:Make ( "SERVER.REVISION", DATA:Ascii( STR:SUB ( RepP,57,1)))
ServObj = ServObj + OBJECT:Make ( "SERVER.SFTLEVEL",DATA:Ascii( STR:SUB ( RepP,58,1)))
ServObj = ServObj + OBJECT:Make ( "SERVER.TTSLEVEL", DATA:Ascii( STR:SUB ( RepP,59,1)))
Return ( ServObj)

Go to Table of Contents

NET:Queue:Attach

Module:NET.NLM
Purpose:Attach a job server to a specified queue.
Syntax:<lAttached> = NET:Queue:Attach (<oBindery>)
Description:NET:Queue:Attach attaches a job server to a queue specified by the bindery object <oBindery>. Prior to placing a job in a queue or retrieving a job from a queue, a job server must first be attached. The returned logical <lAttached> is true when a job server is sucessfully attached to a queue, and false otherwise. When the returned logical is false Err is set to a value which may be used to identify the cause of failure.
Outputs:Logical
Note:NET:Queue:Attach assumes the calling process is the job server.
See Also:NET:Queue:Detach, SYS:Error:Number, Bindery
Example:QueName = "Job_Server_Number_One"
QueType = NET_PRINT_QUEUE
BinObj = NET:Bindery:Get(QueName, QueType)
If (BinObj.Error != 0)
Print("Cannot get queue bindery object"); Quit
EndIf
If (!NET:Queue:Attach(BinObj))
Print("Cannot attach to queue"); Quit
EndIf
If (!NET:Queue:Job:Retrieve(BinObj,"OUTPUT.TXT"))
Print("Cannot retrieve the job"); Quit
EndIf
If (!NET:Queue:Detach(BinObj) )
Print("Cannot detach from queue"); Quit
EndIf

Go to Table of Contents

NET:Queue:Create

Module:NET.NLM
Purpose:Create a specified queue.
Syntax:<oBindery> = NET:Queue:Create (<sQueName>, <iQueType>)
Description:NET:Queue:Create creates a queue of type <iQueType> with the name <sQueName>. When a queue is created, it will be added to the bindery list. The queue name <sQueName> is a string of up to 48 characters and will be passed to the name attribute of the bindery object created for the queue. The queue type is an integer that specifies the type for the queue and will be passed to the type attribute of the bindery object created for the queue (see the name and type attributes in Bindery Objects). The returned bindery object <oBindery> contains information that is used to access the created queue.
Outputs:Bindery object
Attributes:[Read-Write]: Name, Type, Security.Read, Security.Write; [Read-Only]: ID, Flag, Error
See Also:NET:Queue:Delete, Bindery
Example:QueName = "Job_Queue_Number_One"
QueType = NET_JOB_QUEUE
BinObj = NET:Queue:Create(QueName, QueType)
If (BinObj.Error=0)
Print("Job queue #1 is created")
Else
Print("Cannot create the job queue")
End

Go to Table of Contents

NET:Queue:Delete

Module:NET.NLM
Purpose:Delete a specified queue.
Syntax:<lDeleted> = NET:Queue:Delete (<oBindery>)
Description:Deletes a queue specified by the bindery object <oBindery>. When a queue is deleted, it will be removed from the bindery. The returned logical <lDeleted> is true when the queue is deleted, and false otherwise. When the returned logical is false Err is set to a value which may be used to identify the cause of failure.
Outputs:Logical
See Also:NET:Queue:Create, SYS:Error:Number, Bindery
Example:QueName = "Job_Queue_Number_One"
QueType = NET_JOB_QUEUE
BinObj = NET:Bindery:Get(QueName, QueType)
If (BinObj.Error=0)
NET:Queue:Delete (BindObj)
EndIf

Go to Table of Contents

NET:Queue:Detach

Module:NET.NLM
Purpose:Detach a job server from a specified queue.
Syntax:<lDetached> = NET:Queue:Detach (<oBindery>)
Description:Detach a job server from a queue specified by the bindery object <oBindery>. When the job server has finished servicing the queue, it must be detached from the queue. The returned logical <lDetached> is true when the job server is properly detached, and false otherwise. When the returned logical is false Err is set to a value which may be used to identify the cause of failure.
Outputs:Logical
Note:NET:Queue:Attach assumes the calling process is the job server.
See Also:NET:Queue:Attach, SYS:Error:Number, Bindery
Example:QueName = "Job_Server_Number_One"
QueType = NET_JOB_QUEUE
BinObj = NET:Bindery:Get(QueName, QueType)
If (BinObj.Error != 0)
Print("Cannot get queue bindery object"); Quit
EndIf
If (!NET:Queue:Attach(BinObj))
Print("Cannot attach to queue"); Quit
EndIf
If (!NET:Queue:Job:Retrieve(BinObj,"OUTPUT.TXT"))
Print("Cannot retrieve the job"); Quit
EndIf
If (!NET:Queue:Detach(BinObj))
Print("Cannot detach from queue"); Quit
EndIf

Go to Table of Contents

NET:Queue:Job:Close

Module:NET.NLM
Purpose:Close and remove a specified queue job opened by the NET:Queue:Job:Read command.
Syntax:<lClosed> = NET:Queue:Job:Close (<oQueueJob>)
Description:NET:Queue:Job:Close closes the job specified by the queue job object <oQueueJob>. After a job is read directly from the queue using the NET:Queue:Job:Read command, the NET:Queue:Job:Close command must be issued to properly close the job and remove it from the queue list. The returned logical <lClosed> is true when the job is properly closed, and is false otherwise. When the returned logical is false, the Err command returns a number which may be used to identify the cause of failure.
Outputs:Logical
See Also:NET:Queue:Job:Open, SYS:Error:Number
Example:NET:Queue:Job:Close(QueJobObj)

Go to Table of Contents

NET:Queue:Job:Create

Module:NET.NLM
Purpose:Write a job to a specified queue.
Syntax:<oQueueJob> = NET:Queue:Job:Create (<oBindery>)
Description:NET:Queue:Job:Create returns the queue job object <oQueueJob> that writes a job to the queue specified by the bindery object <oBindery>. The NET:Queue:Job:Create command writes the information directly to the queue job rather than writing to a file and submitting the file to the queue. The returned queue job object <oQueueJob> contains the attribute Job.File.Handle, the parameter to the FIO:Write:Byte (need to be converted into integer using DATA:Integer) command, that writes the information directly to the queue job. After the information is written to the job, the NET:Queue:Job:Post command must be issued to properly close the job and post it for service.
Outputs:Queue job object
Attributes:[Read-Write]: Target.Jobserver.Bindery.ID, Target.Service.Date, Target.Service.Time, Job.Type, Job.Position, Job.Name, Job.Text; [Read-Only]: ID, Client.Connection.Number, Client.Task, Client.Bindery.ID, Jobserver.Connection.Number, Jobserver.Task, Jobserver.Bindery.ID, Job.Create.Date, Job.Create.Time, Job.File.Name, Job.File.Handle, Job.Number, Error
Note:The job created by the NET:Queue:Job:Create command is placed at the bottom of the queue list.
See Also:NET:Queue:Job:Post, NET:Queue:Job:Submit, Queue, Bindery
Example:NET:Queue:Job:Create(BindObj)

Go to Table of Contents

NET:Queue:Job:Delete

Module:NET.NLM
Purpose:Delete a specified queue job from a queue list.
Syntax:<lDeleted> = NET:Queue:Job:Delete (<oQueueJob>)
Description:Delete the job specified by the queue job object <oQueueJob> from the queue list. The returned logical <lDeleted> is true when the job is deleted, and false otherwise. When the returned logical is false Err is set to a value which may be used to identify the cause of failure.
Outputs:Logical
Note:Jobs opened by NET:Queue:Job:Create must be properly closed using NET:Queue:Job:Post prior to deletion. Do not use NET:Queue:Job:Delete to delete jobs opened by the NET:Queue:Job:Open command. NET:Queue:Job:Close will automatically remove jobs from the queue.
See Also:NET:Queue:Job:Create, NET:Queue:Job:Open, NET:Queue:Job:Close, SYS:Error:Number, Queue
Example:QueName = "Job_Server_Number_One"
QueType = NET_JOB_QUEUE
QueObj = NET:Bindery:Get(QueName, QueType)
If (QueObj.Error = 0)
JobNumber = 1
Do While (True)
JobObj = NET:Queue:Job:Get(QueObj, JobNumber)
If (JobObj.Error != 0); Exit; EndIf
If (NET:Queue:Job:Delete(JobObj))
Print("Job No ",JobNumber," is deleted")
Newline
EndIf
JobNumber = JobNumber + 1
EndDo
EndIf

Go to Table of Contents

NET:Queue:Job:Get

Module:NET.NLM
Purpose:Get a queue job object for a specified job.
Syntax:<oQueueJob> = NET:Queue:Job:Get (<oBindery>, <iPosition>)
Description:NET:Queue:Job:Get gets the queue job object <oQueueJob> for the job specified by the position number <iPosition> within the queue, indicated by the bindery object <oBindery>. Jobs are ordered sequentially from 1 through 250 where job number 1 is positioned at the top of the queue.
Outputs:Queue job object
Attributes:[Read-Write]: Target.Jobserver.Bindery.ID, Target.Service.Date, Target.Service.Time, Job.Type, Job.Position, Job.Name, Job.Text; [Read-Only]: ID, Client.Connection.Number, Client.Task, Client.Bindery.ID, Jobserver.Connection.Number, Jobserver.Task, Jobserver.Bindery.ID, Job.Create.Date, Job.Create.Time, Job.File.Name, Job.File.Handle, Job.Number, Error
See Also:NET:Queue:Job:Set, Queue, Bindery
Example:NET:Queue:Job:Get(BindObj,10)

Go to Table of Contents

NET:Queue:Job:Open

Module:NET.NLM
Purpose:Read a job from a specified queue.
Syntax:<oQueueJob> = NET:Queue:Job:Open (<oBindery>)
Description:NET:Queue:Job:Open returns the queue job object <oQueueJob> that reads a job from the queue, specified by the bindery object <oBindery>. The NET:Queue:Job:Open command allows the user to read the information directly from the queue job rather than retrieving the job into a file. The returned queue job object <oQueueJob> contains the attribute Job.File.Handle, the parameter to the FIO:Read:Byte command, that reads the information directly from the queue job. When the information has been read from the job, the NET:Queue:Job:Close command must be issued to properly close the job and remove it from the queue list.
Outputs:Queue job object
Attributes:[Read-Write]: Target.Jobserver.Bindery.ID, Target.Service.Date, Target.Service.Time, Job.Type, Job.Position, Job.Name, Job.Text; [Read-Only]: ID, Client.Connection.Number, Client.Task, Client.Bindery.ID, Jobserver.Connection.Number, Jobserver.Task, Jobserver.Bindery.ID, Job.Create.Date, Job.Create.Time, Job.File.Name, Job.File.Handle, Job.Number, Error
Note:The NET:Queue:Job:Open command opens the first available job from the top of the queue list.
See Also:NET:Queue:Job:Close, NET:Queue:Job:Retrieve, Queue, Bindery
Example:NET:Queue:Job:Open(BindObj)

Go to Table of Contents

NET:Queue:Job:Post

Module:NET.NLM
Purpose:Close and post a specified queue job created by the NET:Queue:Job:Create command.
Syntax:<lClosed> = NET:Queue:Job:Post (<oQueueJob>)
Description:NET:Queue:Job:Post closes the job specified by the queue job object <oQueJob>. After a job is written directly to the queue using the NET:Queue:Job:Create command, the NET:Queue:Job:Post command must be issued to properly close the job and post it for the service. The returned logical <lClosed> is true when the job is properly posted, and is false otherwise. When the returned logical is false, the Err command returns a number which may be used to identify the cause of failure.
Outputs:Logical
See Also:NET:Queue:Job:Create, SYS:Error:Number
Example:NET:Queue:Job:Close(QueJobObj)

Go to Table of Contents

NET:Queue:Job:Retrieve

Module:NET.NLM
Purpose:Retrieve a file from a specified queue.
Syntax:<lRetrieved> = NET:Queue:Job:Retrieve (<oBindery>, <sFileName>)
Description:NET:Queue:Job:Retrieve retrieves a job from the queue, specified by the bindery object <oBindery>, and writes it to the file indicated by the name <sFileName>. The returned logical <lRetrieved> is true when the file is properly retrieved, and is false otherwise. When the returned logical is false, the Err command returns a number which may be used to identify the cause of failure.
Outputs:Logical
Note:The job retrieved is the first available job from the top of the queue list. Prior to retrieving a job, the NET:Queue:Attach command must be issued to attach to the queue.
See Also:NET:Queue:Job:Submit, NET:Queue:Job:Create, NET:Queue:Attach, NET:Queue:Detach, SYS:Error:Number, Bindery
Example:NET:Queue:Job:Retrieve(BindObj,"C:\temp\quejob.txt")

Go to Table of Contents

NET:Queue:Job:Set

Module:NET.NLM
Purpose:Set the job information according to a specified queue job object.
Syntax:<oQueueJob2> = NET:Queue:Job:Set (<oQueueJob1>)
Description:NET:Queue:Job:Set sets the job information to match the queue job object <oQueueJob1>. The returned queue job object <oQueueJob2> contains the updated attributes for the queue job object <oQueueJob1>. NET:Queue:Job:Set is the object manager for the queue job objects, and any changes to the job information are made by this command.
Outputs:Queue Job object
Attributes:[Read-Write]: Target.Jobserver.Bindery.ID, Target.Service.Date, Target.Service.Time, Job.Type, Job.Position, Job.Name, Job.Text; [Read-Only]: ID, Client.Connection.Number, Client.Task, Client.Bindery.ID, Jobserver.Connection.Number, Jobserver.Task, Jobserver.Bindery.ID, Job.Create.Date, Job.Create.Time, Job.File.Name, Job.File.Handle, Job.Number, Error
See Also:NET:Queue:Job:Get, Queue
Example:NET:Queue:Job:Set(QueJobObj)

Go to Table of Contents

NET:Queue:Job:Submit

Module:NET.NLM
Purpose:Submit a file to a specified queue.
Syntax:<lSubmitted> = NET:Queue:Job:Submit (<oBindery>, <sFileName>[, <sPrintFormat>])
Description:NET:Queue:Job:Submit reads the contents of the file, specified by the name <sFileName>, and adds the file's contents as a job to the queue, indicated by bindery object <oBindery>. The returned logical <lSubmitted> is true when the file is submitted, and false otherwise. When the returned logical is false, Err is set to a value which may be used to identify the cause of failure.
Outputs:Logical
Note:NET:Queue:Job:Submit has an optional third parameter <sPrintFormat> when used for print servers. If the third parameter is provided a banner page is printed in addition to printing one copy of the submitted file.

NET:Queue:Job:Submit has an optional 3rd parameter, which is used for print servers. If the 3rd parameter is not given the default would be 1 copy with no banner print.

This data applies only to print jobs. All of these fields must be setup by the client and may be changed by the client. The 3rd parameter has the following format:

Format [Offset][length]

[1][1] Means first character and length of it is one, so by using DATA:CHAR command you can assemble this string and use it as 3rd parameter of NET:Queue:Job:Submit . Use High-Low format for words (2 Bytes).
The example program will print 1 copy of the print job with banner.

[1][1]Client Record Area version number Current version is 0.
[2][1]Tab Size. Number of spaces that tabs will be expanded to.
Minimum is 0. Maximum of 13.
[3][2] Number of copies.

[5][2] Control Flags.
0128: Set if banner should be printed
0064: Set if text stream. If set tabs are expanded
and the lines per page and character per line
field are ignored.
0016: Set if notify user when print job completed!
0008: Set if from feeds should be suppressed
0004: Print job if interrupted during capture process.

[7][2] Maximum lines per page. Default 60.
[9][2] Maximum characters per Line. Default 132.
[11][16] Null terminated from name
[27][6] Reserved for future use. Should be set to zero.
[33][13]Banner Name Field. Text to be printed on the banner. This
is usually the user name,but the user should be able to
change it.
[46][13] Banner File Field. Text to be printed in second box on
banner.This is currently used for the file name,but the user
should be able to change it.
[59][14] Header File Name. File name printed in header of banner.
[73][80] Directory Path. Full path name of the file to be printed.
See Also:NET:Queue:Job:Retrieve, NET:Queue:Job:Create, SYS:Error:Number, Bindery
Example:#include "net.h"
#include "FIO.H"

Sub main
win:clear
obj1 =net:bindery:first("QTEST",NET_PRINT_QUEUE)
if (obj1.error!=0)
print("can not get the queue test from bindery."); newline
quit
endif
PrintFormat=DATA:CHR(0)+ DATA:CHR(8)+ HighLow(1)+ HighLow(128)+ HighLow(60) + HighLow(132) +STR:Repeat(DATA:CHR(0),16)
PrintFormat=PrintFormat+ STR:Repeat(DATA:CHR(0),6) + STR:Repeat("A",13) + STR:Repeat("B",13) + STR:Repeat("C",14)
print(Net:queue:Job:submit(obj1,"SYS:ERROR.LOG",PrintFormat))
End Sub

Sub HighLow
local("HI","LO")
' change the integer and return it as binary string
LO=DATA:CHAR( MATH:MOD(Param(1),256) )
HI=DATA:CHAR( Param(1)/256 )
return(HI+LO)
End Sub

Go to Table of Contents

NET:Queue:Rights:Change

Module:NET.NLM
Purpose:Change the job server's rights to match the rights of the client that placed the job in the queue.
Syntax:<lChanged> = NET:Queue:Rights:Change (<oQueueJob>)
Description:NET:Queue:Rights:Change changes the job server's rights to match the rights of the client that placed the job in the queue. Prior to servicing any job, the job server must assume the identity of the client that placed the job in the queue. This identity change prevents any underprivileged clients from accessing the network resources via the queue mechanism. When the service is ended, the NET:Queue:Rights:Restore command must be issued to restore the job server's original rights. The returned logical <lChanged> is true when the rights of the job server are properly changed to match the rights of the client and false otherwise. When the returned logical is false, the Err command returns a number which may be used to identify the cause of the failure.
Outputs:Logical
See Also:NET:Queue:Rights:Restore, SYS:Error:Number, Queue
Example:NET:Queue:Rights:Change(QueJobObj)

Go to Table of Contents

NET:Queue:Rights:Restore

Module:NET.NLM
Purpose:Restore the job server's rights.
Syntax:<lRestored> = NET:Queue:Rights:Restore
Description:NET:Queue:Rights:Restore restores the job server's rights to match its own original identity. Prior to servicing any job, the job server must assume the identity of the client that placed the job in the queue. This identity change prevents any underprivileged clients from accessing the network resources via the queue mechanism. When the service is ended, the NET:Queue:Rights:Restore command must be issued to restore the job server's original rights. The returned logical <lRestored> is true when the rights of the job server are properly restored and false otherwise. When the returned logical is false, the Err command returns a number which may be used to identify the cause of the failure.
See Also:NET:Queue:Rights:Change, SYS:Error:Number, Queue
Example:NET:Queue:Rights:Restore

Go to Table of Contents

Net:Semaphore:Check

Module:NETSEMAP.NLM
Purpose:Check a global semaphore.
Syntax:<lSuccess> = Net:Semaphore:Check(<iSemaphoreHandle>)
Description:Check the status of a global semaphore.
Outputs:logical
See Also:Net:Semaphore:Local:Check
Example:Value = NET:Semaphore:Check(Handle)

Go to Table of Contents

Net:Semaphore:Local:Check

Module:NETSEMAP.NLM
Purpose:Check a local semaphore
Syntax:<iSemaphoreHandle> = Net:Semaphore:Local:Check(iSemaphoreID)
Description:Check the status of a local semaphore
Outputs:integer
See Also:Net:Semaphore:Check
Example:Value = NET:Semaphore:Local:Check(1)

Go to Table of Contents

Net:Semaphore:Local:Lock

Module:NETSEMAP.NLM
Purpose:Locks a local semaphore.
Syntax:<lSuccess> = Net:Semaphore:Local:Lock(<iSemaphoreID>)
Description:Locks the local semaphore <iSemaphoreID>.
Outputs:logical
See Also:Net:Semaphore:Lock
Example:Success = NET:Semaphore:Local:Lock(1)

Go to Table of Contents

Net:Semaphore:Local:Unlock

Module:NETSEMAP.NLM
Purpose:Unlocks a local semaphore.
Syntax:<lSuccess> = Net:Semaphore:Local:Unlock(<iSemaphoreID>)
Description:Unlocks the local semaphore <iSemaphoreID>.
Outputs:logical
See Also:Net:Semaphore:Unlock
Example:Success = NET:Semaphore:Local:Unlock(1)

Go to Table of Contents

Net:Semaphore:Lock

Module:NETSEMAP.NLM
Purpose:Locks a global semaphore.
Syntax:<iSemaphoreHandle> = Net:Semaphore:Lock(<sSemaphoreName>, <iTimeOut>)
Description:Locks a global semaphore <sSemaphoreName>. If the semaphore is already locked and not available, it waits <sTimeOut> seconds. If the semaphore is still locked it will return an invalid handle. The Err variable will be set to 0 if handle is valid.
Outputs:integer
See Also:Net:Semaphore:Local:Lock
Example:Handle = NET:Semaphore:Lock("test",1)
If (Err = 0)
Print("Semaphore is locked")
Else
Print("Time out, Could not lock semaphore")
EndIf
Newline

Go to Table of Contents

Net:Semaphore:Unlock

Module:NETSEMAP.NLM
Purpose:Unlocks a global semaphore.
Syntax:<lSuccess> = Net:Semaphore:Unlock(<iSemaphoreHandle>)
Description:Unlocks the global semaphore <iSemaphoreHandle>.
Outputs:logical
See Also:Net:Semaphore:Local:Unlock
Example:Success = NET:Semaphore:Unlock(handle)

Go to Table of Contents

NET:Server:Attach

Module:NET.NLM
Purpose:Attach the client to a specified file server.
Syntax:<iConnectionID> = NET:Server:Attach (<sServerName>)
Description:Attach a client to a file server specified by the name <sServerName>. Prior to logging in, a client must attach to the file server. Clients can attach to a maximum of eight file servers. Each file server is identified by a unique connection ID. NET:Server:Attach returns the integer <iConnectionID>, representing the clients unique connection ID. When a client connects to more than one file server, each file server assigns its own connection number to the client, which may or may not be the same as other connection numbers assigned to that client.
Outputs:Integer
Note:The client should be attached to at least one file server at any given time. When the NetWare shell is loaded into memory, the client is automatically attached to a specified file server. If the client is detached from all file servers, the NetWare shell will issue error notification messages to the client.
See Also:NET:Server:Detach, NET:Login, Connection, Appendicies
Example:ServerID = NET:Server:Attach("HITECSOFT2")
ConObj = NET:Connection:Get
If (ConObj.Error != 0); Print("Error getting object"); Return; EndIf
ConObj.ID = ServerID
ConObj = Net:Connection:Set(ConObj)
If (ConObj.Error != 0); Print("Error setting connection ID"); Return; EndIf
If (NET:Login("BOB",NET_USER,"MYSECRET"))
Print("Login successful")
Else
Print("Unable to login")
EndIf

Go to Table of Contents

NET:Server:Date:Get

Module:NET.NLM
Purpose:Get the server date object for the default file server.
Syntax:<oServerDate> = NET:Server:Date:Get
Description:NET:Server:Date:Get returns the server date object <oServerDate> that contains the date and time of the default file server.
Outputs:Server date object
Attributes:[Read-Write]: Date, Time; [Read-Only]: Error
See Also:NET:Server:Date:Set, Server
Example:DateObj = NET:Server:Date:Get
If (DateObj.Error = 0)
Print("The date is ", DateObj.Date)
Print("The time is ", DateObj.Time)
EndIf

Go to Table of Contents

NET:Server:Date:Set

Module:NET.NLM
Purpose:Set the date and time for the default file server according to a specified server date object.
Syntax:<oServerDate2> = NET:Server:Date:Set (<oServerDate1>)
Description:NET:Server:Date:Set sets the date and/or time for the default file server to match the server date object <oServerDate1>. The returned server date object <oServerDate2> contains the updated attributes for the server date object <oServerDate1>. NET:Server:Date:Set is the object manager for server date objects and any changes to the server date are made by this command.
Outputs:Server date object
Attributes:[Read-Write]: Date, Time; [Read-Only]: Error
See Also:NET:Server:Date:Get, Server
Example:DateObj = NET:Server:Date:Get
If (DateObj.Error = 0)
DateObj.Date = "01-01-1993"
DateObj.Time = "12:00:00"
DateObj = NET:Server:Date:Set(DateObj)
If (DateObj.Error = 0)
Print("Server date is set to 01-01-1993")
Else
Print("Unable to set the date")
EndIf
Else
Print("Unable to get the date.")
EndIf

Go to Table of Contents

NET:Server:Description

Module:NET.NLM
Purpose:Get the server description object for the default file server.
Syntax:<oServerDesc> = NET:Server:Description
Description:NET:Server:Description returns the server description object <oServerDesc> that contains the information about the company that distributed the NetWare Operating System which is currently running on the default file server.
Outputs:Server description object
Attributes:[Read-Only]: Company, Revision, Date, Copyright, Error
See Also:**
Example:InfObj = NET:Server:Description
If (InfObj.Error = 0)
Print(InfObj.Company); Newline
Print(InfObj.Revision," ", InfObj.Date); Newline
Print(InfObj.Copyright)
EndIf

Go to Table of Contents

NET:Server:Detach

Module:NET.NLM
Syntax:Detach the client from a specified file server.
Syntax:<lDetached> = NET:Server:Detach (<iConnectionID>)
Description:NET:Server:Detach detaches the client from the file server specified by the connection ID <iConnectionID>. Each file server is identified by a unique connection ID. The NET:Server:Detach command returns the logical <lDetached> as true when the client is properly detached from the specified file server and false otherwise. When the returned logical is false, the Err command returns a number which may be used to identify the cause of the failure.
Outputs:Logical
Note:The client should be attached to at least one file server at any given time. When the NetWare shell is loaded into memory, the client is automatically attached to a specified file server. If the client is detached from all file servers, the NetWare shell will issue notification messages to the client.
See Also:NET:Server:Attach, NET:Logout, SYS:Error:Number, Connection
Example:ConObj = NET:Connection:Get
If (ConObj.Error = 0 )
If (NET:Logout(ConObj.ID))
Print("Successful Logout"); Newline
If (NET:Server:Detach(ConObj.ID))
Print("Successful Detach")
EndIf
EndIf
EndIf

Go to Table of Contents

NET:Server:Down:Force

Module:NET.NLM
Purpose:Force the default file server to shut down.
Syntax:<lDown> = NET:Server:Down:Force
Description:Force the default file server to shut down. Before shutting down all open files on the default file server are closed. The returned logical <lDown> is true when the server is shut down, and false otherwise. When the returned logical is false, Err is set to a value which may be used to identify the cause of the failure.
Outputs:Logical
Note:If the source code and temporary files of the program requesting a server shutdown are located on the server shutting down, then the calling program will automatically terminate after the server is shut down.
See Also:NET:Server:Down:Normal, SYS:Error:Number
Example:If (NET:Server:Down:Normal)
Print("File server is down"); Quit
Else
If (Err = ERR_SERVER_FILE_OPEN)
If (NET:Server:Down:Force)
Print("File server is down"); Quit
EndIf
EndIf
EndIf

Go to Table of Contents

NET:Server:Down:Normal

Module:NET.NLM
Purpose:Shut down the default file server.
Syntax:<lDown> = NET:Server:Down:Normal
Description:NET:Server:Down:Normal shuts the default file server down. When files are open on the default server, the NET:Server:Down:Normal command returns false and the default file server is not shut down. The returned logical <lDown> is true when the server is shut down, and false otherwise. When the returned logical is false Err is set to a value which may be used to identify the cause of the failure.
Outputs:Logical
See Also:NET:Server:Down:Force, SYS:Error:Number
Example:If (NET:Server:Down:Normal)
Print("File server is down"); Quit
Else
If (Err = ERR_SERVER_FILE_OPEN)
If (NET:Server:Down:Force)
Print("File server is down"); Quit
EndIf
EndIf
EndIf

Go to Table of Contents

NET:Server:Name

Module:NET.NLM
Purpose:Get a file server name
Syntax:<sName> = NET:Server:Name (<iConnectionID>)
Description:Get the name of the file server specified by the connection ID <iConnectionID>. Each file server is identified by a unique connection ID.
Outputs:String
Note:The client should be attached to at least one file server at any given time. When the NetWare shell is loaded into memory, the client is automatically attached to a specified file server. If the client is detached from all file servers, the NetWare shell will issue error notification messages to the client.
See Also:Appendicies
Example:Sub FindConnectionID
Local("ServerName", "ConID")
If (Param:Count = 0)
Return(0)
EndIf
ServerName = Param(1)
ConID = 1
Do While (ConID <= 8)
If (NET:Server:Name(ConId) = ServerName)
Return(ConID)
EndIf
ConID = ConID + 1
EndDo
Return(0)
End Sub

Go to Table of Contents

NET:Stat:Bytes:Received

Module:NETSTAT.NLM
Purpose:Gets the number of bytes received
Syntax:<iNumber> = NET:STAT:Bytes:Received
Description:Returns the number of bytes the file server has received since it was brought up.
Outputs:Integer
See Also:Error! Reference source not found.
Example:Print("Bytes Received ",NET:STAT:Bytes:Received ); NewLine

Go to Table of Contents

NET:Stat:Bytes:Transmitted

Module:NETSTAT.NLM
Syntax:<iNumber> = NET:STAT:Bytes:Transmitted
Description:Returns the number of bytes the file server has transmitted since it was brought up.
Outputs:Integer
See Also:Error! Reference source not found.
Example:Print("Bytes Transmitted ",NET:STAT:Bytes:Transmitted ); NewLine

Go to Table of Contents

NET:Stat:Bytes:Written

Module:NETSTAT.NLM
Purpose:Gets number of bytes written to the disk.
Syntax:<iNumber> = NET:STAT:Disk:Bytes:Written
Description:Returns the number of bytes written to the server since the server was brought up.
Outputs:Integer
See Also:Error! Reference source not found., Error! Reference source not found., Error! Reference source not found.
Example:Print("Disk Bytes Written ",NET:STAT:Disk:Bytes:Written); NewLine

Go to Table of Contents

NET:Stat:Directory:Searches

Module:NETSTAT.NLM
Purpose:Gets number of directory searches.
Syntax:<iNumber> = NET:STAT:Directory:Searches
Description:Returns the number of directories searched on the server since the server was brought up.
Outputs:Integer
See Also:**
Example:Print("Directory Searches ",NET:STAT:Directory:Searches); NewLine

Go to Table of Contents

NET:Stat:Disk:Bytes:Read

Module:NETSTAT.NLM
Purpose:Gets number of bytes read from the disk.
Syntax:<iNumber> = NET:STAT:Disk:Bytes:Read
Description:Returns the number of bytes read from the server since the server was brought up.
Outputs:Integer
See Also:Error! Reference source not found., Error! Reference source not found., Error! Reference source not found.
Example:Print("Disk Bytes Read ",NET:STAT:Disk:Bytes:Read); NewLine

Go to Table of Contents

NET:Stat:Disk:Reads

Module:NETSTAT.NLM
Purpose:Gets the number of files read from the disk.
Syntax:<iNumber> = NET:STAT:Disk:Reads
Description:Returns the number of files read from the server since the server was brought up.
Outputs:Integer
See Also:Error! Reference source not found.
Example:Print("Disk Reads ",NET:STAT:Disk:Reads); NewLine

Go to Table of Contents

NET:Stat:Disk:Writes

Module:NETSTAT.NLM
Purpose:Gets the number of files written to the disk.
Syntax:<iNumber> = NET:STAT:Disk:Writes
Description:Returns the number of files written to the server since the server was brought up.
Outputs:Integer
See Also:Error! Reference source not found.
Example:Print("Disk Writes ",NET:STAT:Disk:Writes); NewLine

Go to Table of Contents

NET:Stat:Fat:Sectors:Dirty

Module:NETSTAT.NLM
Purpose:Gets the number of dirty sectors in the FAT table.
Syntax:<iNumber> = NET:STAT:FAT:Sectors:Dirty
Description:Returns the number of FAT sectors that have changed but not updated on the servers FAT table.
Outputs:Integer
See Also:Error! Reference source not found.
Example:Print("FAT Sectors Dirty ",NET:STAT:FAT:Sectors:Dirty); NewLine

Go to Table of Contents

NET:Stat:Fat:Sectors:Written

Module:NETSTAT.NLM
Purpose:Gets the number of sectors written to the FAT table.
Syntax:<iNumber> = NET:STAT:FAT:Sectors:Written
Description:Returns the number of FAT sectors written to the FAT table since the server was brought up.
Outputs:Integer
See Also:Error! Reference source not found.
Example:Print("FAT Sectors Written ",NET:STAT:FAT:Sectors:Written); NewLine

Go to Table of Contents

NET:Stat:File:Bytes:Read

Module:NETSTAT.NLM
Purpose:Gets the number of bytes read from files.
Syntax:<iNumber> = NET:STAT:File:Bytes:Read
Description:Returns the number of bytes read from the server since the server was brought up.
Outputs:Integer
See Also:Error! Reference source not found.
Example:Print("File Bytes Read ",NET:STAT:File:Bytes:Read); NewLine

Go to Table of Contents

NET:Stat:File:Bytes:Written

Module:NETSTAT.NLM
Purpose:Gets number of bytes written to files.
Syntax:<iNumber> = NET:STAT:File:Bytes:Written
Description:Returns the number of bytes written to the server since the server was brought up.
Outputs:Integer
See Also:Error! Reference source not found.
Example:Print("File Bytes Written ",NET:STAT:File:Bytes:Written); NewLine

Go to Table of Contents

NET:Stat:File:Creates

Module:NETSTAT.NLM
Purpose:Gets the number of files created on the server.
Syntax:<iNumber> = NET:STAT:File:Creates
Description:Returns the number of files created on the server since the server was brought up.
Outputs:Integer
See Also:Error! Reference source not found., Error! Reference source not found., NET:STAT:Renames
Example:Print("File Creates ",NET:STAT:File:Creates); NewLine

Go to Table of Contents

NET:Stat:File:Deletes

Module:NETSTAT.NLM
Purpose:Gets number of files deleted on the server.
Syntax:<iNumber> = NET:STAT:File:Deletes
Description:Returns the number of files deleted on the server since the server was brought up.
Outputs:Integer
See Also:Error! Reference source not found., Error! Reference source not found.
Example:Print("File Deletes ",NET:STAT:File:Deletes ); NewLine

Go to Table of Contents

NET:Stat:File:Opens

Module:NETSTAT.NLM
Purpose:Gets the number files opened on the server.
Syntax:<iNumber> = NET:STAT:File:Opens
Description:Returns the number of files opened on the server since the server was brought up.
Outputs:Integer
See Also:Error! Reference source not found., Error! Reference source not found., Error! Reference source not found.
Example:Print("File Opens ",NET:STAT:File:Opens); NewLine

Go to Table of Contents

NET:Stat:File:Reads

Module:NETSTAT.NLM
Purpose:Gets the number of file reads.
Syntax:<iNumber> = NET:STAT:File:Reads
Description:Returns the number of times files have been read on the server since the server was brought up.
Outputs:Integer
See Also:Error! Reference source not found.
Example:Print("File Reads ",NET:STAT:File:Reads); NewLine

Go to Table of Contents

NET:Stat:File:Renames

Module:NETSTAT.NLM
Purpose:Gets the number of files renamed.
Syntax:<iNumber> = NET:STAT:File:Renames
Description:Returns the number of files renamed on the server since the server was brought up.
Outputs:Integer
See Also:Error! Reference source not found., Error! Reference source not found., Error! Reference source not found.
Example:Print("File Renames ",NET:STAT:File:Renames); NewLine

Go to Table of Contents

NET:Stat:File:Writes

Module:NETSTAT.NLM
Purpose:Gets the number writes to files.
Syntax:<iNumber> = NET:STAT:File:Writes
Description:Returns the number of times the servers files were written to since the server was brought up.
Outputs:Integer
See Also:Error! Reference source not found.
Example:Print("File Writes ",NET:STAT:File:Writes); NewLine

Go to Table of Contents

NET:Stat:Packets:Received

Module:NETSTAT.NLM
Purpose:Gets the number of packets received.
Syntax:<iNumber> = NET:STAT:Packets:Received
Description:Returns the number of packets received by the server since the server was brought up.
Outputs:Integer
See Also:Error! Reference source not found., Error! Reference source not found.Error! Reference source not found.
Example:Print("Packets Received ",NET:STAT:Packets:Received); NewLine

Go to Table of Contents

NET:Stat:Packets:Routed

Module:NETSTAT.NLM
Purpose:Gets the number of packets routed by the server.
Syntax:<iNumber> = NET:STAT:Packets:Routed
Description:Returns the number of packets routed by the server since the server was brought up.
Outputs:Integer
See Also:Error! Reference source not found., Error! Reference source not found.
Example:Print("Packets Routed ",NET:STAT:Packets:Routed); NewLine

Go to Table of Contents

NET:Stat:Packets:Transmitted

Module:NETSTAT.NLM
Purpose:Gets the number of packets transmitted by the server.
Syntax:<iNumber> = NET:STAT:Packets:Transmitted
Description:Returns the number of packets transmitted by the server since the server was brought up.
Outputs:Integer
Note:This function replaces NET:Stat:Packets:Sent.
See Also:Error! Reference source not found., Error! Reference source not found.
Example:Print("Packets Transmitted ",NET:STAT:Packets:Transmitted); NewLine

Go to Table of Contents

NET:Stat:Records:Locks

Module:NETSTAT.NLM
Purpose:Gets the number of records lock by the server.
Syntax:<iNumber> = NET:STAT:Record:Locks
Description:Returns the number of records locked by the server since the server was brought up.
Outputs:Integer
See Also:**
Example:Print("Record Locks ",NET:STAT:Record:Locks); NewLine

Go to Table of Contents

NET:Stat:Server:Requests

Module:NETSTAT.NLM
Purpose:Gets the number of requests serviced by the server.
Syntax:<iNumber> = NET:STAT:Requests
Description:Returns the number of disk requests the server is waiting to service.
Outputs:Integer
See Also:**
Example:Print("Server Requests ",NET:STAT:Server:Requests); NewLine

Go to Table of Contents

NET:Stat:Server:Utilization

Module:NETSTAT.NLM
Purpose:Gets the server utilization.
Syntax:<iNumber> = NET:STAT:Server:Utilization
Description:Returns the percent of time the processor is busy.
Outputs:Integer
See Also:**
Example:Print("Server Utilization ",NET:STAT:Server:Utilization," "); NewLine

Go to Table of Contents

NET:Stat:Transactions

Module:NETSTAT.NLM
Purpose:Gets the number of transactions processed by the server.
Syntax:<iNumber> = NET:STAT:Transactions
Description:Returns the number of transactions processed by the server since the server was brought up.
Outputs:Integer
See Also:**
Example:Print("Transactions ",NET:STAT:Transactions); NewLine

Go to Table of Contents

NET:Transaction:Off

Module:NET.NLM
Purpose:Disable the transaction tracking feature for the default file server.
Syntax:<lDisabled> = NET:Transaction:Off
Description:NET:Transaction:Off disables the transaction tracking feature for the default file server. The transaction tracking feature provides data integrity by assuring that all defined sets of operations are completed prior to updating the file; otherwise none of the changes will be made. The returned logical <lDisabled> is true when the transaction tracking feature is properly disabled and false otherwise. When the returned logical is false, the Err command returns a number which may be used to identify the cause of the failure.
Outputs:Logical
See Also:NET:Transaction:On, SYS:Error:Number
Example:If (NET:Transaction:Off)
Print("Transaction tracking is disabled")
Else
Print("Cannot disable transaction tracking")
EndIf

Go to Table of Contents

NET:Transaction:On

Module:NET.NLM
Purpose:Enable the transaction tracking feature for the default file server.
Syntax:<lEnabled> = NET:Transaction:On
Description:NET:Transaction:On enables the transaction tracking feature for the default file server. The transaction tracking feature provides data integrity by assuring that all defined sets of operations are completed prior to updating the file; otherwise, none of the changes will be made. The returned logical <lEnabled> is true when the transaction tracking feature is properly enabled, and is false otherwise. When the returned logical is false, the Err command returns a number which may be used to identify the cause of failure.
Outputs:Logical
See Also:NET:Transaction:On, SYS:Error:Number
Example:If (NET:Transaction:On)
Print("Transaction tracking is enabled")
Else
Print("Cannot enable transaction tracking")
EndIf

Go to Table of Contents

NET:Volume:Info

Module:NET.NLM
Purpose:Get the volume information object for a specified volume on the default file server.
Syntax:<oVolumeInfo> = NET:Volume:Info (<iNumber>)
Description:NET:Volume:Info returns the volume information object <oVolumeInfo> that contains the information about the volume specified by the number <iNumber> on the default file server. The volumes are numbered sequentially, starting with the first volume (SYS:) as number one.
Outputs:Volume information object
Attributes:[Read-Only]: Name, Blocks.Total, Blocks.Free, Blocks.Purgable, Blocks.Size, Dir.Total, Dir.Free, Hashing, Removable, Mounted, Error
See Also:**
Print("Available volumes are:); Newline
VolumeNo = 1
Do While (True)
VolObj = NET:Volume:Info(VolumeNo)
If (VolObj.Error !=0); Exit; EndIf
Print(VolObj.Name); Newline
VolumeNo = VolumeNo + 1
EndDo

Go to Table of Contents