Go to Post Is there a way to spotlight an entire thread? - ctt956 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #13   Spotlight this post!  
Unread 15-01-2003, 01:00
Don Reid Don Reid is offline
Registered User
#0997
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Corvallis, Oregon
Posts: 45
Don Reid will become famous soon enough
Loops, GoTos, states

What is needed for this is called a state machine.

The code goes through the main loop many times and does different things each times. Some information about the state of the system is kept from loop to loop (in variables).

There should only be one SERIN/SEROUT set in the loop.

The example posted with the SELECT command uses the counter variable as the only state. More complex machines can use additional state variables.

Flow charts are commonly used to understand the workings of state machines.

There are no gotos in the example because the SELECT-CASE command implies them for you (like IF-THEN-ELSE). Both are new with PB2.5.
__________________
Don Reid
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PBASIC Syntax Question Raven_Writer Programming 4 20-08-2003 08:07
Question Obtaining Pbasic 2.5 PyroPhin Programming 3 18-01-2003 01:26
PBasic Question Melissa H. Programming 28 17-11-2002 18:53
pbasic question archiver 2001 5 23-06-2002 23:50
Another PBASIC Question Ian W. Programming 4 31-01-2002 21:36


All times are GMT -5. The time now is 12:16.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi