learner
8th November 2010, 19:36
Hi,

We are on baan 5 ( sp19 ) , I have developed a session using which i am creating a txt file and depending upon where i am running ( Baan Prod. Server or Baan Test Server ) it should generate a file name accordingly.... unfortunately i am unable to locate a function which can tell my baan server name or ip address ... do u guys know any of this function or similar one ?

One option which i have thought as a backup plan is to write a shell script and call this shell script via baan program which will return the server name via standard unix binary "hostname", but i would like to avoid this option so just wondering if there is a function directly available in baan to do the same.

Note : My $BSE path on both the servers are same , so i cant use $BSE related function to identify the server.

Regards

Learner

bdittmar
8th November 2010, 20:26
Hi,

We are on baan 5 ( sp19 ) , I have developed a session using which i am creating a txt file and depending upon where i am running ( Baan Prod. Server or Baan Test Server ) it should generate a file name accordingly.... unfortunately i am unable to locate a function which can tell my baan server name or ip address ... do u guys know any of this function or similar one ?

One option which i have thought as a backup plan is to write a shell script and call this shell script via baan program which will return the server name via standard unix binary "hostname", but i would like to avoid this option so just wondering if there is a function directly available in baan to do the same.

Note : My $BSE path on both the servers are same , so i cant use $BSE related function to identify the server.

Regards

Learner

Hello,

try:

BaanERP Programmers Guide


hostname$()

--------------------------------------------------------------------------------

Syntax
string hostname$( )

Description
This returns the host name of the local machine.

If no host name is found, the function returns an empty string. If the host name is incorrect, the user can change it by setting the environment variable BSE_HOSTNAME.

Context
Bshell function.

Example
field.ttaad410.syst:
before.input:
if isspace(ttaad410.syst) then
ttaad410.syst = hostname$()
endif

Regards

learner
8th November 2010, 23:57
thanks for the info. i saw this function earlier and got confused ... i thought it's suppose to return dir on user machine where baan is installed , but nevertheless after using it i found that it returns baan server name.

thanks once again.

-Learner

bdittmar
9th November 2010, 11:09
thanks for the info. i saw this function earlier and got confused ... i thought it's suppose to return dir on user machine where baan is installed , but nevertheless after using it i found that it returns baan server name.

thanks once again.

-Learner

Hello,
the function, you mean is:

get.client.hostname()
Syntax:

function long get.client.hostname (ref string hostname)

Description


This returns the hostname of the local client (if available). In case of Baan Windows this is the client machine on which BW is running. In case of Webtop, this is the client machine on which the Internet Browser is running.


Arguments

ref string hostname Output argument which will contain the fully qualified hostname of the client on return of this function.


Return values

true Function succeeded, hostname is filled.
false Function failed, client hostname is unknown.

Context

This function can be used in all script types.

Regards