(Execution) Termination bit, Alternation bit.

Skybuck Flying skybuck2000 at hotmail.com
Mon Dec 21 07:40:21 EST 2015


The original idea I posted is less about sending a signal to another 
processor.

It is more about how to break out of an instruction sequence.

Example of problem:

Main:
while Condition1 do
begin
    while Condition2 do
    begin
        while Condition3 do
        begin
            Routine1
        end
    end;
end;

Routine1:

while Condition4 do
begin
    while Condition5 do
    begin
        Routine2:
    end;
end;

Routine2:

while Condition6 do
begin
    while Condition7 do
    begin

    end;
end;

Breaking out of these kinds of loops, routines, code currently requires 
something like:

Current cumbersome solution for problem:

Main:
while Condition1 and not Terminated do
begin
    while Condition2 and not Terminated do
    begin
        while Condition3 and not Terminated do
        begin
            Routine1
        end
    end;
end;

Routine1:

while Condition4 and not Terminated do
begin
    while Condition5 and not Terminated do
    begin
        Routine2:
    end;
end;

Routine2:

while Condition6 and not Terminated do
begin
    while Condition7 and not Terminated do
    begin

    end;
end;

It can take a long while before all this code exits, plus the Terminated 
boolean is probably placed on wrong side.

It should be on the left side in case the Conditions are actual functions 
otherwise those would unnecessarily be executed as well.

Having something that can immediatly exit all of this code would be a nice 
feature to have.

Perhaps something like an exception block, perhaps it could be called a 
termination block.

Routine1:
Result = False

Execute
    while True do
    begin

    end;
    Result = True
Termination
    OnTerminate:
    begin

    end;
end;

return Result

Preferrably , optionally this can be omitted/left out.

Bye,
  Skybuck. 




More information about the Python-list mailing list