Jump to content
Sign in to follow this  
gcue

Or statement

Recommended Posts

gcue

how can i accurately write an OR statment that would make for all these conditions?

If $user <> "SYSTEM" Or $user <> "LOCAL SERVICE" Or $user <> "NETWORK SERVICE" Then
    FileWrite($file,  '' &@CRLF & _
                 $assets[$x] & "," & $user & ", date")
EndIf

Share this post


Link to post
Share on other sites
gcue

that worked..

trying to understand how that makes sense tho.

it would seem that because of the AND, all conditions must be met in order for it not to FileWrite

Share this post


Link to post
Share on other sites
Monamo

how can i accurately write an OR statment that would make for all these conditions?

If $user <> "SYSTEM" Or $user <> "LOCAL SERVICE" Or $user <> "NETWORK SERVICE" Then
    FileWrite($file,  '' &@CRLF & _
                 $assets[$x] & "," & $user & ", date")
EndIf
Try AND in place of OR. Your current conditions wouldn't allow for the correct distinction between the $user value.

- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]

Share this post


Link to post
Share on other sites
Jos

that worked..

trying to understand how that makes sense tho.

it would seem that because of the AND, all conditions must be met in order for it not to FileWrite

It helps when you read it out loud, but your are testing for "Not Equal To" so when you use Or it means that it is Always true since there is always one of the tests True.

Jos


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
gcue

gotcha!

thanks fellas!!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×