Home > Net >  Explanation of RAD Studio source code markers/visualizations
Explanation of RAD Studio source code markers/visualizations

Time:08-24

I was interested to know if the code markers shown at the end of some lines (see screenshot) are explained or documented anywhere (for RAD Studio 10.4). I notice that the first 3 (for Halt, Continue and Break) will disappear when these items are prefixed with the unit name System..

As for raise, it's not clear to me what the little red up arrow signifies or how it should be addressed. Code compiles fine without errors, warnings or hints.

procedure TForm1.FormCreate(Sender: TObject);
var
  I: Integer;
begin
  if False then Halt(99);

  for I := 0 to 2 do
  begin
    if I = 0 then Continue;
    if I = 1 then Break;
  end;

  try
    Transaction.StartTransaction;
    //update database
    Transaction.Commit;
  except
    Transaction.Rollback;
    raise;
  end;
end;

Code in editor with markers

CodePudding user response:

Those arrows belong to Flow Control Highlighting. They are visual cues that illustrate jumps (interruptions) in the regular, linear, code flow.

For instance, Break arrow points down and it visually shows that code execution will jump out of the current loop down to the first next code line outside the loop.

raise arrow symbolizes jumping out of the current code (bubbling up) to the next exception handler.

The fact some of them disappear when they are prefixed with System namespace is merely a bug in the parser responsible for painting the highlighting. Actual behavior of the code will be the same.

  • Related