Regards
Vikas
Function PrintInterval(byVal dblMilliSecond) |
Dim intMilliSecond, intSeconds, intMinute, intHour |
intMilliSecond = Int(dblMilliSecond*1000) mod 1000 |
intSecond = Int(dblMilliSecond) |
intMinute = Int(intSecond / 60) |
intSecond = intSecond mod 60 |
intHour = Int(intMinute / 60) |
intMinute = intMinute mod 60 |
PrintInterval = intHour &" hours " & _ |
intMinute &" minutes " & _ |
intSecond &" seconds " & _ |
intMilliSecond &" milliseconds" |
End Function |
(Monday, 11 October 2004) - Written by Paul McKinney - Last Updated (Tuesday, 12 October 2004)
Many of the application I work on capture data at a high rate of speed. I am working on an application that captures data
from a PLC into a SQL Server database, then I copy the data to another database. For various reasons I decided that I
would need to do this with VBScript. When I copied the data I wanted to make sure I didn?t loose the milliseconds from
the datetime stamp.
You may be aware that none of the formatting functions within VBScript will display the milliseconds. Dates are stored in
what is called a vardate format. The vardate is really just a Double. A value of 0.0 is January 1, 1900 12:00 AM, a value
of 1.0 is January 2, 1900 12:00 AM, and a value of 1.5 is January 2, 1900 12:00 noon. So I started doing the math. I
thought I could easily calculate the milliseconds from the Double. My ingenious code looked something like this.
dim ms1
d = cdate(now)
ms1 = fix( (cdbl(d) - fix(cdbl(d))) * 86400000.0 ) - (hour(d)*60*60*1000 + minute(d)*60*1000 + second(d) * 1000)
I would chop off the fraction then calculate the milliseconds in the current day from the Double. Then using the
information VBScript gives me I would calculate the milliseconds up to the hour, minute, and second. If I subtracted the
two I would get the number of milliseconds remaining, Right? Wrong?
You?ll never guess what I got? 0. That?s right. Even in the Double value VBScript does not hold the precision out to the
millisecond. Oh well. Back to the drawing board
Thanks Shirish for helping me......for being so patient.
The problem of my script recording PS-1, PS-2 ,PS-3 to PS got solved by
changing the settings .
Tools>options>Web>Page/Frames option>Select Radio button different test obj
description. for both PAGE & FRAME.Also a webtable is to be added exactly
below page P S
And the following code for
Dim NumRow
NumRow=Browser("P S").Page("P S").WebTable("First Name").GetROProperty
("rows")
'If the items are present in List
if NumRow<>1 Then
'checkbox on
Browser("P S").Page("P S").WebCheckBox("ctl00$ContentPlaceHolder1$Data").Set
"ON"
'Click DELETE button
Browser("P S").Page("P S").WebButton("Delete").Click
'Do you want to Delet click Yes
Browser("P S").Dialog("Microsoft Internet Explorer").WinButton("OK").Click
else
'Log out of screen
Browser("P S").Page("P S").Link("Log Out").Click
End if
Browser("P S").Dialog("Microsoft Internet Explorer").WinButton("OK").Click
_________________________________________________________________
Palate teasers: Straight from Master Chef Sanjeev Kapoor
http://content.msn.co.in/Lifestyle/Moreonlifestyle/LifestylePT_101106_1530.htm