Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


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
    

Article ID:   W13439
Filename:   Binary versus Logical Operators.txt