WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Miscellaneous

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Binary versus Logical relational operators

Keywords:   logical and binary and

Question:

I'm trying to create a script as follows:
        If param3 >= 64 & <= 71 Then Message("Your office is", "CON")
        If param3 >= 72 & <= 79 Then Message("Your office is", "SFR")
without any luck. Param3 is the 3rd octet of a workstation's IP address. I want to create a section of If Then statements that recognize param3 as an integer being greater than or equal to 64 AND less than or equal to 71 and so forth..... Thanks for your help.

Answer:

	If param3 >= 64 && param3 <= 71 Then Message("Your office is", "CON")
	If param3 >= 72 && param3 <= 79 Then Message("Your office is", "SFR")
  1. Need logical AND && not binary AND &

  2. Each compare operator required two items to compare. It does not inherit a missing item from a previous compare operation.

    Here's another example of using Logical OR:

    	if day=="Mon" || day=="Tue" || day=="Wed" || day=="Thu" || day=="Fri"
    	   Run("filedata.bat","")
    	else
    	   Display (5, "Backup Message", "No Backup Scheduled Weekends")
    	endif
    	return
    

For more see: Binary and Logical Operators Explained


Article ID:   W13439
Filename:   Binary versus Logical Operators.txt
File Created: 2014:07:18:09:51:38
Last Updated: 2014:07:18:09:51:38