Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Use comparison operators in variables in VBScript

Featured Replies

In the following VBScript code I'm trying to compare two numbers and pass the operator from the command line. I substitute the words "greater", "less" and "equal" instead of the symbols to not upset the shell. However the If..Then statement doesn't like me using the variable for the operator. Any ideas. Thanks for the help.

Set objShell = WScript.CreateObject("WScript.Shell")
Set colArgs = WScript.Arguments

str1stnumber = colArgs.Item(0)
str2ndnumber = colArgs.Item(1)
strOperator = colArgs.Item(2)


If strOperator = "less" Then
   strOperator = "<"
ElseIf strOperator = "greater" Then
   strOperator = ">"
ElseIf strOperator = "equal" Then
   strOperator = "="
End If


If str1stnumber strOperator str2ndnumber Then
   wscript.echo "it works"
End If


maybe this is an option ?

gr /\/\o\/\/

If strOperator = "greater" AND str1stnumber < str2ndnumber Then

wscript.echo "it works greater"

ElseIf strOperator = "less" AND str1stnumber > str2ndnumber Then

wscript.echo "it works less"

ElseIf strOperator = "equal" AND str1stnumber = str2ndnumber Then

wscript.echo "it works equal"

endif

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.