Shop OBEX P1 Docs P2 Docs Learn Events
Bs2 DoEvents Code — Parallax Forums

Bs2 DoEvents Code

ArchiverArchiver Posts: 46,084
edited 2003-10-10 14:40 in General Discussion
Somebody know any information about processing events like Visual
Basic DoEvents for Basic Stamp application.




Thanks!!




Vanderson

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-10-10 14:40
    The BS2 is a single-tasking processor.
    It doesn't do 'Events'.

    In VB, you are in a windowing environment, where
    'events' are passed around to windows, so the
    code for that window can respond and update the
    window. It's inherently multi-tasking. You
    have multiple windows, with one or more
    window event-handler apps behind them.

    The BS2 comes from an earlier processing model,
    that of the single execution stream. Now, you
    CAN implement a 'state machine' in PBasic, and
    cycle the 'state machine' fast enough so all
    'pseudotasks' get some time.

    Like:
    MyState = 1
    StateMachine:
    BRANCH MyState, (IdleTask, Task1, Task2, Task3)

    IdleTask:
    ' Wait for time tick
    GOTO StateMachine

    Task1:
    ' Do task 1
    GOTO StateMachine
    'etc.


    --- In basicstamps@yahoogroups.com, "kloggerr" <loggerr@b...> wrote:
    > Somebody know any information about processing events like Visual
    > Basic DoEvents for Basic Stamp application.
    >
    >
    >
    >
    > Thanks!!
    >
    >
    >
    >
    > Vanderson
Sign In or Register to comment.