Page 1 of 1 1
Topic Options
#56718 - 2001-06-25 01:54 PM @IPADDRESS0
attiahia Offline
Hey THIS is FUN

Registered: 2000-03-27
Posts: 268
When I Ping a specific PC I get the following IP Address “10.12.236.15”
Which is correct. But when I use @IPADDRESS0 to read the IP Address for the same PC, I got “10. 12.236. 15”.

Why I get here space after 10. And before 12?
What is the way to get rid of this space?

I am using the IP Address to map the target pc to nearest server, this space confuse me.

thank you.

Top
#56719 - 2001-06-25 02:33 PM Re: @IPADDRESS0
attiahia Offline
Hey THIS is FUN

Registered: 2000-03-27
Posts: 268
Thanks, I think I found the solution which wrote by Scott Harrison.

$IP = @IPADDRESS0
$IPNOSPACES = LTRIM(SUBSTR($IP,1,4))+LTRIM(SUBSTR($IP,5,4))+LTRIM(SUBSTR($IP,9,4))+LTRIM(SUBSTR($IP,13,3))
http://kixtart.org/board/Forum2/HTML/000295.html

Top
#56720 - 2001-06-26 05:32 AM Re: @IPADDRESS0
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

For other readers of the board. The @ipaddressX macro will always
return its value in a fixed format.
The format will be:

code:

999.999.999.999


and the length of each ip-address part is always three positions.
f.e. "256.256.256.256" or " 1. 1. 1. 1".

Greetings.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#56721 - 2001-06-26 07:42 AM Re: @IPADDRESS0
attiahia Offline
Hey THIS is FUN

Registered: 2000-03-27
Posts: 268
MCA.
Thank you a lot for your help.
I am getting 0 by implementing @ipaddressX, I might did some thing wrong. if this worked, it will be much better than using Ltrim. Pleas advice.

Thank you.

Top
#56722 - 2001-06-26 10:35 AM Re: @IPADDRESS0
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Attiahia,

think MCA should say @IPADDRESSx
where [x] is a value from 0-3 and refers to
different NIC adapters, so in the most cases
a @ipaddress0 is ok ...
The return string is always padded !

hth

Jochen

_________________________



Top
#56723 - 2001-06-27 05:20 AM Re: @IPADDRESS0
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Thanks JPols for additional information.

Attiahia, you must need the LTRIM function to strip unwanted
spaces from returned values.
Greetings.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.035 seconds in which 0.016 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org