Skip to main content

mikeem em's Library tagged vbscript   View Popular

VBScript Select Case

  • Select Case statement only allows you to check if a variable is equal to a value - you can't test to see if it is greater than, less than etc. Also, you can only test against one variable. If you have multiple variables to test against, you'll need to use an If statement.
27 Jan 09

Hey, Scripting Guy! How Can I Search for Two Items in a Text File?

  • If InStr(strContents, "Windows 2000") Then
    blnFound = True
    End If

    If InStr(strContents, "Windows XP") Then
    blnFound = True
    End If
26 Jan 09

Hey, Scripting Guy! How Can I Search for a Word in a Text File and Return the Entire Line Where That Word Was Found?

  • Close method and never touch Test.txt again. Why not? Because we don’t need it anymore; instead, we’ll conduct all our searches on the virtual copy of Test.txt stored in the variable strTargetText.

Hey, Scripting Guy! How Can I Increment the Last Line in a Text File?

  • replace the existing contents of Test.txt with a brand-new file. That new file will include the first x lines (unchanged) in Test.txt plus a new, modified last line.
  • FileSystemObject doesn’t allow us to change a single line in a text file;

Hey, Scripting Guy! How Can I Find and Replace Text in a Text File?

  • use the ReadAll method to read the contents of the entire file into the variable strText.
11 Feb 08

Quick Test Professional(QTP): VB Script and QTP - Part1

    • Variables

      A variable is a placeholder that refers to a memory location that stores program information that may change at run time. A variable is referred to by its name for accessing the value stored or to modify its value.

      Variable Declaration

      Variables in VBScript can be declared in three ways:

      1. Dim Statement
      2. Public Statement
      3. Private Statement

      For example:
      Dim No_Passenger

      Multiple variables can be declared by separating each variable name with a comma. For example:
      Dim Top, Left, Bottom, Right

  • Note:

    Variables declared with Dim at the script level are available to all procedures within the script. At the procedure level, variables are available only within the procedure.

    Public statement variables are available to all procedures in all scripts.

    Private statement variables are available only to the script in which they are declared.

  • 3 more annotations...
1 - 10 of 10
Showing 20 items per page

Highlighter, Sticky notes, Tagging, Groups and Network: integrated suite dramatically boosting research productivity. Learn more »

Join Diigo