Page 2 of 2 <12
Topic Options
#16770 - 2002-01-29 01:04 AM Re: To Shell or not to Shell?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Yeah, easy for you when you're holding all the cards!

Sounds like you got it beat.

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#16771 - 2002-01-29 01:25 AM Re: To Shell or not to Shell?
Anonymous
Unregistered


Here's how to do it

Use the function the link points to to pull back the IP address :
$ping=Ping(%clientname%,1)
Then you can use the SPLIT command in kix 4.x to split the IP address up into octets and grab the one you want.

As Jpols says, it does not work on win9x though....

Top
#16772 - 2002-01-29 05:32 PM Re: To Shell or not to Shell?
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
Hey now we are talking.. can you expand on that thought for me.. or maybe point me towards some information that I can make this method work? This looks promising to me.
_________________________
Austin Henderson

Top
#16773 - 2002-01-29 05:34 PM Re: To Shell or not to Shell?
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
$ping=Ping(%clientname%,1)
$octetarray=split("@ipaddress0",".")
$location=val($octetarray[1])
goto tsprtmap

How does this look... if I am after X in A.X.A.X

_________________________
Austin Henderson

Top
#16774 - 2002-01-29 05:36 PM Re: To Shell or not to Shell?
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
oops.. make that A.X.A.A

Sorry guys.. little typo there

_________________________
Austin Henderson

Top
#16775 - 2002-01-29 05:39 PM Re: To Shell or not to Shell?
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
I am getting an unexpected expression.. is ping a valid function?
_________________________
Austin Henderson

Top
#16776 - 2002-01-29 05:53 PM Re: To Shell or not to Shell?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
it's udf... if you check mac's answer, you'll see that he pointed you to it.

ping udf is at http://kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=12&t=000012

cheers,

_________________________
!

download KiXnet

Top
#16777 - 2002-01-29 05:57 PM Re: To Shell or not to Shell?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
and btw, if you check it out, you can see that it uses:
shell '%Comspec% /q /e:1024 /c for /F "tokens=2 delims=[]" ...

so it does it with shell too and even uses temp file, which I would want to disclude.
anyway, when using this UDF, you don't need to code it yourself and you can just do ping()-calls.

_________________________
!

download KiXnet

Top
#16778 - 2002-01-29 06:01 PM Re: To Shell or not to Shell?
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
I see the link to the ping function put I do not know how to inlude that function can anyone advise?
_________________________
Austin Henderson

Top
#16779 - 2002-01-29 06:37 PM Re: To Shell or not to Shell?
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
I have it..!! Thank you all for your primo support here...

You stated that it uses a tmp file.. can you expand on that.. I am very new to kix

Thanks

_________________________
Austin Henderson

Top
#16780 - 2002-01-29 06:46 PM Re: To Shell or not to Shell?
Austin Offline
Seasoned Scripter

Registered: 2002-01-24
Posts: 439
correction it's

$ping=Ping(%clientname%,1)
$octetarray=split("$ping",".")
$location=val($octetarray[1])
goto tsprtmap

Thanks

_________________________
Austin Henderson

Top
#16781 - 2002-01-30 05:03 PM Re: To Shell or not to Shell?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
austin, the tmp-file means, that it creates temporary file during execution, when the same can be achieved without...
this just makes the function some 50 times slower. (not counted, but writing to disk is slow when all could be done in memory...)

cheers,

_________________________
!

download KiXnet

Top
Page 2 of 2 <12


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

Who's Online
0 registered and 1183 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.079 seconds in which 0.04 seconds were spent on a total of 13 queries. Zlib compression enabled.

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