Shop OBEX P1 Docs P2 Docs Learn Events
Pause — Parallax Forums

Pause

ArchiverArchiver Posts: 46,084
edited 2003-08-16 16:38 in General Discussion
hi.........

I am new in BS2

Can I use Pause for 1 Hour with this comand?

PAUSE 1000 * 60000

thank you

Edson

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-08-12 20:13
    This was a recent topic of conversation on the list. For a very complete
    answer, search the archive for the thread "time delay". One of the best
    answers on how to do extended wait times comes from Jon (not
    surprisingly! [noparse]:)[/noparse] and I quote it here:

    >This is fairly simple. Pick a *base* delay (1 second, for example),
    >then run it in a loop. Here's a quick subroutine that will work
    >for you.
    >
    >Pause_1Sec:
    > FOR timer = 1 TO seconds
    > PAUSE 1000
    > NEXT
    > RETURN
    >
    >If you declare seconds as a Word variable, you can have delay of
    >up to 18 hours, 12 minutes, 15 seconds.
    >
    >-- Jon Williams
    >-- Parallax

    Vern [noparse]:)[/noparse]

    --
    Vern Graner CNE/CNA/SSE | "If the network is down, then you're
    Senior Systems Engineer | obviously incompetent so why are we
    Texas Information Services | paying you? Of course, if the network
    vern@t... www.txis.com | is up, then we obviously don't need
    Cell 507-7851 Desk 328-8947 | you, so why are we paying you?" VLG



    h40miami said:
    > hi.........
    >
    > I am new in BS2
    >
    > Can I use Pause for 1 Hour with this comand?
    >
    > PAUSE 1000 * 60000
    >
    > thank you
    >
    > Edson
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    > Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2003-08-12 20:26
    In a message dated 8/12/2003 11:47:00 AM Pacific Daylight Time,
    h40miami@y... writes:

    >
    > hi.........
    >
    > I am new in BS2
    >
    > Can I use Pause for 1 Hour with this comand?
    >
    > PAUSE 1000 * 60000
    >

    No you cannot do that.

    But you can set up a "FOR NEXT" loop to pause for 1000, 60000 times.
    The reason is that the maximum value one byte can hold is 65,535

    The basic stamp is not super acurate for time keeping. you MIGHT have less
    error if you pause 60000, and do that 10 times


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2003-08-12 20:29
    Sorry to nitpick ... one Byte can hold a value up to 255 -- a Word can
    hold up to 65535. All computations are done [noparse][[/noparse]internally] with 16-bit
    variables so you must be careful that any intermediate result does not
    exceed 65535.

    -- Jon Williams
    -- Parallax


    Original Message
    From: smartdim@a... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=cOp_cgEANCS49XYJZPPjQDk-pG2-C152FwDr90LAPtmEdO3crXiYr9fFrIQc0WtFmITegKp7wNej7Vg]smartdim@a...[/url
    Sent: Tuesday, August 12, 2003 2:27 PM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] PAUSE


    In a message dated 8/12/2003 11:47:00 AM Pacific Daylight Time,
    h40miami@y... writes:

    >
    > hi.........
    >
    > I am new in BS2
    >
    > Can I use Pause for 1 Hour with this comand?
    >
    > PAUSE 1000 * 60000
    >

    No you cannot do that.

    But you can set up a "FOR NEXT" loop to pause for 1000, 60000 times.
    The reason is that the maximum value one byte can hold is 65,535

    The basic stamp is not super acurate for time keeping. you MIGHT have
    less
    error if you pause 60000, and do that 10 times


    [noparse][[/noparse]Non-text portions of this message have been removed]


    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/




    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
  • ArchiverArchiver Posts: 46,084
    edited 2003-08-12 20:41
    In a message dated 8/12/2003 12:36:26 PM Pacific Daylight Time,
    jwilliams@p... writes:

    >
    >
    > Sorry to nitpick ... one Byte can hold a value up to 255 -- a Word can
    > hold up to 65535. All computations are done [noparse][[/noparse]internally] with 16-bit
    > variables so you must be careful that any intermediate result does not
    > exceed 65535.
    >
    > -- Jon Williams
    > -- Parallax

    I don't consider it nitpicking, if something is incorrect, by all means,
    correction is in order..... I know better ( a byte can hold 255). I made a
    simple
    goof.......thanks for the post so "new-combers" don't get mislead...<grin>


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2003-08-16 16:38
    Nope, you can only pause for 65,535 milli-seconds
    in a single pause.

    However, you CAN easily do:
    NumMinutes VAR BYTE

    NextHour:
    NumMinutes = 0
    TimeLoop:
    PAUSE 60000
    NumMinutes = NumMinutes + 1
    IF NumMinutes < 60 THEN TimeLoop

    '
    ' Put code to run every 60 minutes here...
    '
    END ' End of Program

    --- In basicstamps@yahoogroups.com, "h40miami" <h40miami@y...> wrote:
    > hi.........
    >
    > I am new in BS2
    >
    > Can I use Pause for 1 Hour with this comand?
    >
    > PAUSE 1000 * 60000
    >
    > thank you
    >
    > Edson
Sign In or Register to comment.