Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- NetLib for Clipper, Version 6.0 - n_server( [ <cserver> | <nserver> ] ) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_SERVER( [ <cServer> | <nServer> ] )


Parameters

<cServer>
File server name.

<nServer>
Alternative to server name, number of a server in the station's server 
table.


Returns

Name of the current preferred file server. That is, if the preferred 
file server was previously set to FS1, then N_SERVER() will return 
accepted or 'FS1' if the change was not accepted. Common reasons for 
failure are that the current station is not attached to the requested 
file server, or the server name requested is not a valid file server 
name.

If no preferred file server has been specified, the function will 
return the name of the default file server. The default server is the 
one associated with the current default drive.


Description

If <cServer> is specified, it is selected as the preferred file server. 
If an invalid server is specified, or if the station is not attached to 
the server, then no action is taken.

If <nServer> is specified, then the server occupying that slot in the 
station's server table is selected as the preferred server. In general, 
N_SERVER(1) selects the primary server, that is, the one the station 
attached and logged into first.

Note  Remember that values such as N_STANUM(), N_STAMAX(), and 
N_WHOAMI() may vary from server to server.

Do not use N_SERVER() to select a print server. Instead, use 
N_CAPSET().


Examples

// Create top line status bar containing
// userid and current server header

PROCEDURE
   @ 1, 0 SAY 'Server name: ' + N_SERVER()
   @ 1, 64 SAY 'User id: ' + N_WHOAMI()
RETURN

// Select Server 'SALES-2'
N_SERVER('SALES-2')

// Select primary server
N_SERVER(1)




See Also: N_ASERVER() N_SERVNUM()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson