+ Reply to Thread
Results 1 to 4 of 4

Different syntax for Application.Wait

  1. #1
    Forum Contributor
    Join Date
    11-20-2005
    Posts
    256

    Different syntax for Application.Wait

    Hi all,

    Of these three lines of Syntax:
    What is the difference from Serial vs Value?
    What are the differencs in preformance?
    Which is better and why?

    Application.Wait Now + TimeValue("00:00:10")

    Application.Wait Now + TimeSerial(0, 0, 10)

    Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) + 10)
    Thx
    Dave
    "The game is afoot Watson"

  2. #2
    Bob Phillips
    Guest

    Re: Different syntax for Application.Wait

    TimeSerial - Returns a Variant (Date) containing the time for a specific
    hour, minute, and second

    TimeValue - Returns a Variant (Date) containing the time. The required time
    argument is normally a string expression representing a time from 0:00:00
    (12:00:00 A.M.) to 23:59:59 (11:59:59 P.M.), inclusive. However, time can
    also be any expression that represents a time in that range.

    Just taken from Help, which does what it says on the packet.

    The third is totally redundant IMO. Why break now down into its constituent
    parts, to just re-assemble them.

    As to performance, you won't notice it, and better is subjective, so use
    what is appropriate for your application.

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "Desert Piranha"
    <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi all,
    >
    > Of these three lines of Syntax:
    > What is the difference from Serial vs Value?
    > What are the differencs in preformance?
    > Which is better and why?
    >
    > Application.Wait Now + TimeValue("00:00:10")
    >
    > Application.Wait Now + TimeSerial(0, 0, 10)
    >
    > Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) +
    > 10)
    >
    >
    > --
    > Desert Piranha
    >
    >
    > ------------------------------------------------------------------------
    > Desert Piranha's Profile:

    http://www.excelforum.com/member.php...o&userid=28934
    > View this thread: http://www.excelforum.com/showthread...hreadid=494006
    >




  3. #3
    Forum Contributor
    Join Date
    11-20-2005
    Posts
    256
    Hi Bob,
    Thx for this,
    I did think the third one was kinda screwey.
    It looks like i have a choice between:
    Application.Wait Now + TimeValue("00:00:10")
    Application.Wait Now + TimeSerial(0, 0, 10)
    Looks like the Serial would be just a tad easier to work with.
    So if the both do the same thing than that will be my choice.
    Thx Bob
    Dave
    Quote Originally Posted by Bob Phillips
    TimeSerial - Returns a Variant (Date) containing the time for a specific
    hour, minute, and second

    TimeValue - Returns a Variant (Date) containing the time. The required time
    argument is normally a string expression representing a time from 0:00:00
    (12:00:00 A.M.) to 23:59:59 (11:59:59 P.M.), inclusive. However, time can
    also be any expression that represents a time in that range.

    Just taken from Help, which does what it says on the packet.

    The third is totally redundant IMO. Why break now down into its constituent
    parts, to just re-assemble them.

    As to performance, you won't notice it, and better is subjective, so use
    what is appropriate for your application.

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "Desert Piranha"
    <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi all,
    >
    > Of these three lines of Syntax:
    > What is the difference from Serial vs Value?
    > What are the differencs in preformance?
    > Which is better and why?
    >
    > Application.Wait Now + TimeValue("00:00:10")
    >
    > Application.Wait Now + TimeSerial(0, 0, 10)
    >
    > Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) +
    > 10)
    >
    >
    > --
    > Desert Piranha
    >
    >
    > ------------------------------------------------------------------------
    > Desert Piranha's Profile:

    http://www.excelforum.com/member.php...o&userid=28934
    > View this thread: http://www.excelforum.com/showthread...hreadid=494006
    >

  4. #4
    Bob Phillips
    Guest

    Re: Different syntax for Application.Wait

    I tend to use TimeValue as you input time in the same way as you do in a
    spreadsheet, but that is just a personal thing.

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "Desert Piranha"
    <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi Bob,
    > Thx for this,
    > I did think the third one was kinda screwey.
    > It looks like i have a choice between:
    > Application.Wait Now + TimeValue("00:00:10")
    > Application.Wait Now + TimeSerial(0, 0, 10)
    > Looks like the Serial would be just a tad easier to work with.
    > So if the both do the same thing than that will be my choice.
    > Thx Bob
    > Dave
    > Bob Phillips Wrote:
    > > TimeSerial - Returns a Variant (Date) containing the time for a
    > > specific
    > > hour, minute, and second
    > >
    > > TimeValue - Returns a Variant (Date) containing the time. The required
    > > time
    > > argument is normally a string expression representing a time from
    > > 0:00:00
    > > (12:00:00 A.M.) to 23:59:59 (11:59:59 P.M.), inclusive. However, time
    > > can
    > > also be any expression that represents a time in that range.
    > >
    > > Just taken from Help, which does what it says on the packet.
    > >
    > > The third is totally redundant IMO. Why break now down into its
    > > constituent
    > > parts, to just re-assemble them.
    > >
    > > As to performance, you won't notice it, and better is subjective, so
    > > use
    > > what is appropriate for your application.
    > >
    > > --
    > > HTH
    > >
    > > Bob Phillips
    > >
    > > (remove nothere from email address if mailing direct)
    > >
    > > "Desert Piranha"
    > > <[email protected]> wrote in
    > > message
    > > news:[email protected]...
    > > >
    > > > Hi all,
    > > >
    > > > Of these three lines of Syntax:
    > > > What is the difference from Serial vs Value?
    > > > What are the differencs in preformance?
    > > > Which is better and why?
    > > >
    > > > Application.Wait Now + TimeValue("00:00:10")
    > > >
    > > > Application.Wait Now + TimeSerial(0, 0, 10)
    > > >
    > > > Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now())

    > > +
    > > > 10)
    > > >
    > > >
    > > > --
    > > > Desert Piranha
    > > >
    > > >
    > > >

    > > ------------------------------------------------------------------------
    > > > Desert Piranha's Profile:

    > > http://www.excelforum.com/member.php...o&userid=28934
    > > > View this thread:

    > > http://www.excelforum.com/showthread...hreadid=494006
    > > >

    >
    >
    > --
    > Desert Piranha
    >
    >
    > ------------------------------------------------------------------------
    > Desert Piranha's Profile:

    http://www.excelforum.com/member.php...o&userid=28934
    > View this thread: http://www.excelforum.com/showthread...hreadid=494006
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1