SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Advanced Member
    Join Date
    Mar 2002
    Location
    Earth, USA, New York, Western
    Posts
    759
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Sleep for half a second

    All,
    Can TP sleep for a fraction of a second like?

    Sub SandH()
    Sleep (0.2)
    End Sub

    Thanks,
    BMD

  2. #2
    Senior Member
    Join Date
    Apr 2003
    Location
    Wisconsin, USA
    Posts
    5,338
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Sleep for half a second

    Yes. Did you look in help?

    Straight out of the help file -

    object.Sleep( Duration As Long, [PauseType As tpPauseType] )

    where tpPauseType can be tpPauseSeconds (default) or tpPauseMilliSeconds.

  3. #3
    Advanced Member
    Join Date
    Mar 2002
    Location
    Earth, USA, New York, Western
    Posts
    759
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Sleep for half a second

    I do not believe this will work in my context
    <font class="small">Code:</font><hr /><pre>
    'SECTION 32
    Set TP = TextPanel("Recording Section 32", 600, 335): TP.Show
    R = R + 1
    writeExcel R, 1, "Section 32 = ": writeExcel R, 2, ("'" &amp; Section_32)
    SandH

    'IS NEGAM
    Set TP = TextPanel("Recording Is Negam", 600, 335): TP.Show
    R = R + 1
    writeExcel R, 1, "Is Negam = ": writeExcel R, 2, ("'" &amp; Is_Negam)
    SandH
    </pre><hr />
    I call the sleep sub only to slow the script down only when displaying the textpanel.
    <font class="small">Code:</font><hr /><pre>
    Sub SandH()
    Sleep (0.1)
    End Sub
    </pre><hr />
    If I have 0.9 or 0.1 there is no different in the two, also I do not have the object that is required in the example in the help.

    Any Pointers,
    BMD

  4. #4
    Senior Member
    Join Date
    Apr 2003
    Location
    Wisconsin, USA
    Posts
    5,338
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Sleep for half a second

    Since the argument to Sleep is a long, you obviously cannot use decimals such as you have in your example.

    However, you can change the pausetype to tpPauseMilliseconds and use 900 or 100 as the pause time.

    Why are you using the sleep command instead of the pause command? Pause doesn't require an object.

  5. #5
    Advanced Member
    Join Date
    Mar 2002
    Location
    Earth, USA, New York, Western
    Posts
    759
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Sleep for half a second

    Darrel,
    I'm very interested in the pause command but in the help of TP 5.4.0 build 185 all the duration are set as long. In the code above how and where would I initiate the pause? I have the sleep as a separate sub so I can slow down or speed up the script from a simple change.

    Please point me in the right direction.
    BMD

    I did
    Sub SandH()
    'Sleep (0.1)
    Pause 500, tpPauseMilliSeconds
    End Sub
    but have not yet tested it

  6. #6
    Advanced Member
    Join Date
    Mar 2002
    Location
    Earth, USA, New York, Western
    Posts
    759
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Sleep for half a second GOT IT

    Thanks Darrel, I think I was making it harder then it was!

    Thanks For The Help.
    BMD

 

 

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 Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.11%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 01:51 AM.

Copyright BetaSoft Inc.