A few more state machine options to add: - use an array to manage the task list as Uwe mentioned - use a queue to do the same thing, but with a little different 'flavor'
- a slightly 'odd ball' implementation I have experimented with is with user defined events (using the state machine's type def enum as my data type). This allows control of the state machine from anywhere in your program - including the various parallel loops. Just in case we didn't have enough options already. :) John Howard >>> Uwe Frenz 01/19/04 03:36AM >>> Scott and all, I am a bit late here, but... "Scott Serlin" <[EMAIL PROTECTED]> wrote on Fri, 16 Jan 2004 11:17:53 -0600 ... > Also, does anyone have any state machine > tips that they can share? I typically use a string driven state > machine. I then call out each state from other states. I also use a > "nextstate" local variable so that I can reuse particular states in the > machine over and over again and not have to replicate the state > throughout the machine. Let me and the email list know your tips. ... My last devellopment of a rather 'big' (e.g. complicated) state machine is some month ago. So my memoried details are fading, but one point I remember being very important was that I used an 'array of steps/states' instead of just 'nextstate'. This was very importand in cases where (in my case transmission) errors my damage data in a given state AND there's a way to recall that data within a given time frame (e.g. to recover from specific errors). Whenever the data receiving state detected an error it switched to the error recover state by putting that error state in front of the array of steps. And a finished step is removed from the array whenever it is really finished, e.g. afterwards. This way one could also 'script' such a state machine by calling it with more than one element in the step array. Just what I remember. At the moment I can not access that project code to recall more details. Greetings from Germany! -- Uwe Frenz ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Dr. Uwe Frenz Entwicklung getemed Medizin- und Informationtechnik AG Oderstr. 59 D-14513 Teltow Tel. +49 3328 39 42 0 Fax +49 3328 39 42 99 [EMAIL PROTECTED] www.Getemed.de
