Changes

Jump to: navigation, search

The Queue of Events

261 bytes added, 16:57, 21 June 2017
Processing Events
= Processing Events =
In [https://en.wikipedia.org/wiki/Event-driven_programming Event-driven programming] the readmain main loop of a program
takes care of fetch, process and/or dispatch incoming events, the following code is an example of a minimal one.
switch( ev.opcode )
{
// <script stop > commandfrom console
//
case SevEmergExit:
}
// push button activate
//
case SevDinActive:
{
if( ev.p0 == 0 ) { dCursor( 0, 10 ); dPrintf("Button Pressed"); { }  // push button deactivate // case SevDinInactive: { if( ev.p0 == 0 ) { dCursor( 0, 10 ); dPrintf("Button Released"); {
}
}

Navigation menu