IS IT Possible to evaluate two expressions in an IF Statetment? 
Author Message
 IS IT Possible to evaluate two expressions in an IF Statetment?

for example?

if o.ismember("WinNT://domain/" & onet.username & "") =  true AND ClientIP =
"172.22" then
   Wscript.Echo "New YORK"  'clientIP is a function



Sun, 02 May 2004 23:33:37 GMT  
 IS IT Possible to evaluate two expressions in an IF Statetment?
It's possible and you just did it... Your code looks fine.

Clarence

--
Win32Scripting...
Not that one by Duke Publishing. The ORIGINAL!
Over 500 scripts and over 50 COM objects to download and use FREE of charge.
Also check out the public online forum and chat rooms for community based
technical support.
.

http://cwashington.netreach.net

Quote:
> for example?

> if o.ismember("WinNT://domain/" & onet.username & "") =  true AND ClientIP
=
> "172.22" then
>    Wscript.Echo "New YORK"  'clientIP is a function



Mon, 03 May 2004 00:21:09 GMT  
 IS IT Possible to evaluate two expressions in an IF Statetment?
Thanks clarence.
that's what i thought. Actually the problem i'm having is that my function
keeps returning nothing.
however, i'm running the same exact function in my production script and it
works fine.
very odd....
should functions be at the top of a script? does it matter?


Quote:
> It's possible and you just did it... Your code looks fine.

> Clarence

> --
> Win32Scripting...
> Not that one by Duke Publishing. The ORIGINAL!
> Over 500 scripts and over 50 COM objects to download and use FREE of
charge.
> Also check out the public online forum and chat rooms for community based
> technical support.
> .

> http://cwashington.netreach.net


> > for example?

> > if o.ismember("WinNT://domain/" & onet.username & "") =  true AND
ClientIP
> =
> > "172.22" then
> >    Wscript.Echo "New YORK"  'clientIP is a function



Mon, 03 May 2004 00:43:19 GMT  
 IS IT Possible to evaluate two expressions in an IF Statetment?

Post the code in your function and we might be able to help.

Clarence
--
Win32Scripting...
Not that one by Duke Publishing. The ORIGINAL!
Over 500 scripts and over 50 COM objects to download and use FREE of charge.
Also check out the public online forum and chat rooms for community based
technical support.

http://cwashington.netreach.net

Quote:

> Thanks clarence.
> that's what i thought. Actually the problem i'm having is that my function
> keeps returning nothing.
> however, i'm running the same exact function in my production script and it
> works fine.
> very odd....
> should functions be at the top of a script? does it matter?



> > It's possible and you just did it... Your code looks fine.

> > Clarence

> > --
> > Win32Scripting...
> > Not that one by Duke Publishing. The ORIGINAL!
> > Over 500 scripts and over 50 COM objects to download and use FREE of
> charge.
> > Also check out the public online forum and chat rooms for community based
> > technical support.
> > .

> > http://cwashington.netreach.net


> > > for example?

> > > if o.ismember("WinNT://domain/" & onet.username & "") =  true AND
> ClientIP
> > =
> > > "172.22" then
> > >    Wscript.Echo "New YORK"  'clientIP is a function



Mon, 03 May 2004 00:52:26 GMT  
 IS IT Possible to evaluate two expressions in an IF Statetment?

clarence..
it is working now.. bizarre.

  Post the code in your function and we might be able to help.

  Clarence
  --
  Win32Scripting...
  Not that one by Duke Publishing. The ORIGINAL!
  Over 500 scripts and over 50 COM objects to download and use FREE of charge.
  Also check out the public online forum and chat rooms for community based
  technical support.

  http://cwashington.netreach.net


  > Thanks clarence.
  > that's what i thought. Actually the problem i'm having is that my function
  > keeps returning nothing.
  > however, i'm running the same exact function in my production script and it
  > works fine.
  > very odd....
  > should functions be at the top of a script? does it matter?
  >
  >
  >
  >


  > > It's possible and you just did it... Your code looks fine.
  > >
  > > Clarence
  > >
  > > --
  > > Win32Scripting...
  > > Not that one by Duke Publishing. The ORIGINAL!
  > > Over 500 scripts and over 50 COM objects to download and use FREE of
  > charge.
  > > Also check out the public online forum and chat rooms for community based
  > > technical support.
  > > .
  > >
  > > http://cwashington.netreach.net


  > > > for example?
  > > >
  > > > if o.ismember("WinNT://domain/" & onet.username & "") =  true AND
  > ClientIP
  > > =
  > > > "172.22" then
  > > >    Wscript.Echo "New YORK"  'clientIP is a function
  > > >
  > > >
  > > >
  > > >
  > >
  > >
  >
  >



Mon, 03 May 2004 03:15:28 GMT  
 IS IT Possible to evaluate two expressions in an IF Statetment?

thanks again.
Basically, I'm would like a popup (html page) letting my traveling users know that they should be using VoIP when they log on, however, the sGETIP() function.. always returns nothing.. it's the same function in my production script.

Also are there any script debuggin tools where i could see what is happening in my script..line by line?

set onet = Createobject("Wscript.Network")

  Set GroupNY = GetObject("WinNT://mydomain/GL ALL STAFF NY")
  Set GroupNJ = GetObject("WinNT://mydomain/GL ALL STAFF NJ")
  Set GroupPA = GetObject("WinNT://mydomain/GL ALL STAFF PA")

IF ClientIP = "172.22" Then
Call CheckGroupMembershipforNY
Elseif ClientIP = "172.21" Then
Call CheckGroupMembershipforNJ
Elseif ClientIP = "172.20" Then
Call CheckGroupMemberShipforPA
End if

sub CheckGroupMembershipforNY
if GroupNewyork.ismember("WinNT:/MYDOMAIN/" & onet.username & "") = true Then
Exit Sub
Else
Call IEPOPUP
End if
End Sub

sub CheckGroupMembershipforNJ
if GroupLondon.ismember("WinNT://mydomain/" & onet.username & "") = true Then
Exit Sub
Else
Call IEPOPUP
End if
End Sub

Sub CheckGroupMembershipforPA
if GroupBahrain.ismember("WinNT://mydomain/" & onet.username & "") = True Then
Exit Sub
Else
Call IEPOPUP
End if
End Sub

sub IEPOPUP
set objIE = wscript.createobject("InternetExplorer.Application")
objIE.Visible=1 ' //1 is for visible  0 is for non-visiable
objIE.Navigate "c:\voip.html"  '//this can be a local URL or a remote address.
End Sub

'***************************************************************************
' This Function retrieves the clients IP Address using WMI
'
'***************************************************************************
Function sGetIP()

  set IPConfigSet = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery _
  ("select IPAddress from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")

  FOR EACH IPConfig in IPConfigSet
    If Not IsNull(IPConfig.IPAddress) then
      For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
  If IPConfig.IPAddress(i) <> "10.0.0.1" AND TRIM(IPConfig.IPAddress(i)) <> "" then ClientIP = Mid(IPConfig.IPAddress(i), 1, 6)
Next
    End If
  NEXT  

End Function


  Post the code in your function and we might be able to help.

  Clarence
  --
  Win32Scripting...
  Not that one by Duke Publishing. The ORIGINAL!
  Over 500 scripts and over 50 COM objects to download and use FREE of charge.
  Also check out the public online forum and chat rooms for community based
  technical support.

  http://cwashington.netreach.net


  > Thanks clarence.
  > that's what i thought. Actually the problem i'm having is that my function
  > keeps returning nothing.
  > however, i'm running the same exact function in my production script and it
  > works fine.
  > very odd....
  > should functions be at the top of a script? does it matter?
  >
  >
  >
  >


  > > It's possible and you just did it... Your code looks fine.
  > >
  > > Clarence
  > >
  > > --
  > > Win32Scripting...
  > > Not that one by Duke Publishing. The ORIGINAL!
  > > Over 500 scripts and over 50 COM objects to download and use FREE of
  > charge.
  > > Also check out the public online forum and chat rooms for community based
  > > technical support.
  > > .
  > >
  > > http://cwashington.netreach.net


  > > > for example?
  > > >
  > > > if o.ismember("WinNT://domain/" & onet.username & "") =  true AND
  > ClientIP
  > > =
  > > > "172.22" then
  > > >    Wscript.Echo "New YORK"  'clientIP is a function
  > > >
  > > >
  > > >
  > > >
  > >
  > >
  >
  >



Mon, 03 May 2004 03:11:57 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. IS IT Possible to evaluate two expressions in an IF Statetment?

2. Evaluating javascript expressions using Script Control?

3. Evaluating javascript expressions using Script Control?

4. Evaluating string expression

5. Announce: COM DLL for evaluating logical and arithmetical expressions

6. Regular expression - It should be easy, but I am having a bad time

7. I am trying to feed a text field with data from two other fields

8. checking if the string can be evaluated as a DATE

9. Cookie won't evaluate

10. Evaluating Dynamically-created Radio Buttons

11. If-Then-Else - Once I evaluate the parameter I can't display it

12. evaluating vbscript expr's in VB without the script control

 

 
Powered by phpBB® Forum Software