Difference between revisions of "Execution Flag"

From WikiManual
Jump to: navigation, search
 
Line 1: Line 1:
 
= Overview =
 
= Overview =
 
Details are a bit sketchy at the moment since I don't have the source code with me.  Most of this is from memory, so its factual validity may be questionable.
 
  
 
In order to destructure the DNA language (so mutations can likewise be destructured), the way in which genes work had to be redone.
 
In order to destructure the DNA language (so mutations can likewise be destructured), the way in which genes work had to be redone.
  
= The Conditions Flag =
+
= The code that does it all =
 +
Instead of trying to explain it all, which I'm sure I'd fail at, I'll just post the code that does it.  This isn't exactly the same code that's in the program.  I modified it a bit to make it more readable.
  
= The Executon Flag =
+
Select Case n
Set to either: [[start]], [[else]], or NULL.  The [[store | stor]]age commands only work if the execution flag is set to start or else.
+
  Case 1 'cond
 +
    CurrentFlow = COND
 +
  Case 2, 3, 4 'assume a stop command, or it really is a stop command
 +
    'this is supposed to come before case 2 and 3, since these commands
 +
    'must be executed before start and else have a chance to go
 +
    If CurrentFlow = COND Then CurrentCondFlag = AddupCond() 'ANDs all conditions
 +
    CurrentFlow = CLEAR
 +
    Select Case n
 +
      Case 2 'start
 +
        If CurrentCondFlag = NEXTBODY Then CurrentFlow = BODY
 +
      Case 3 'else
 +
        If CurrentCondFlag = NEXTELSE Then CurrentFlow = ELSEBODY
 +
    End Select
 +
End Select
  
Upon encountering a [[stop]] command, the execution flag is cleared.
+
The [[store]] commands will only operate if CurrentFlow is set to something other than CLEAR.

Revision as of 13:20, 19 September 2005

Overview

In order to destructure the DNA language (so mutations can likewise be destructured), the way in which genes work had to be redone.

The code that does it all

Instead of trying to explain it all, which I'm sure I'd fail at, I'll just post the code that does it. This isn't exactly the same code that's in the program. I modified it a bit to make it more readable.

Select Case n
  Case 1 'cond
    CurrentFlow = COND
  Case 2, 3, 4 'assume a stop command, or it really is a stop command
    'this is supposed to come before case 2 and 3, since these commands
    'must be executed before start and else have a chance to go
    If CurrentFlow = COND Then CurrentCondFlag = AddupCond() 'ANDs all conditions
    CurrentFlow = CLEAR
    Select Case n
      Case 2 'start
        If CurrentCondFlag = NEXTBODY Then CurrentFlow = BODY
      Case 3 'else
        If CurrentCondFlag = NEXTELSE Then CurrentFlow = ELSEBODY
    End Select
End Select

The store commands will only operate if CurrentFlow is set to something other than CLEAR.