Difference between revisions of "Execution Flag"
From WikiManual
Line 1: | Line 1: | ||
= Overview = | = Overview = | ||
− | |||
− | |||
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 | + | = 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. |
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.