Substr.. Substring traditionally takes a start and length parameter and
extracts the portion of a string.

 

If the ip address is 192.168.x.x, then the substr grabs the 2nd octet. The
starting position is a char position (the first char is at position 1. in
.NET the first char is at position 0).

From: listsad...@lists.myitforum.com [mailto:listsad...@lists.myitforum.com]
On Behalf Of Marcum, John
Sent: Monday, November 25, 2013 7:44 am
To: Scripting List (scripting@lists.myITforum.com)
Subject: [scripting] Simple KIX Question

 

Can someone explain to me what this is doing? Specifically how does
"$mysubnet=SubStr($myaddress,5,3)" become "$mysubnet="200""? I assume it's
doing some math there or something????

 

 

   $myaddress=@ipaddress0

   $mysubnet=SubStr($myaddress,5,3)

;

   Select

;

; Local Office

                Case      $mysubnet="200"

                                $officelocation="BHM"

                                SetTime "\\SERVER02 <file:///\\SERVER02> "

                Case      $mysubnet="108"

                                $officelocation="BHM"

                                SetTime "\\SERVER02 <file:///\\SERVER02> "

 

  _____  

John Marcum
Sr. Desktop Architect

Bradley Arant Boult Cummings LLP

  _____  

 

 

  _____  


Confidentiality Notice: This e-mail is from a law firm and may be protected
by the attorney-client or work product privileges. If you have received this
message in error, please notify the sender by replying to this e-mail and
then delete it from your computer.

 



Reply via email to