Sunday, September 27, 2015

Triangler Reverse given integer

strVal = 54321
for IntIcounter = len(strVal) to 1 step -1
strInd=  Left(strVal,IntIcounter)
strFinal = strFinal + strInd &VBCRLF
Next
msgbox strFinal

Weekdayname using VB Script

msgbox weekdayname(weekday("09-july-1985"))

How to get IE Version using QTP script

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & _
    "\root\cimv2\Applications\MicrosoftIE")

Set colIESettings = objWMIService.ExecQuery _
    ("Select * from MicrosoftIE_Summary")

For Each strIESetting in colIESettings
    Wscript.Echo "Version: " & strIESetting.Version
    Wscript.Echo "Product ID: " & strIESetting.ProductID
    Wscript.Echo "Cipher strength: " & strIESetting.CipherStrength
Next

QTP : Swapping Example in VB script


X = 10
y = 15

X = X+Y = 10 + 15 = 25
Y = X- Y = 25 - 15 = 10
X = X -Y = 25 - 10 = 15

Now X becomes = 15 and Y = 10 Values are swapped.