Dec 302017
 

Note to self:

If you get an access violation when setting IOTASourceEditor.BlockVisible to true in Delphi 6 or 7 e.g.:

procedure GxOtaSelectBlock(const Editor: IOTASourceEditor; const Start, After: TOTACharPos);
begin
  Assert(Assigned(Editor));
  Editor.BlockVisible := False;
  try
    Editor.BlockType := btNonInclusive;
    Editor.BlockStart := Start;
    Editor.BlockAfter := After;
  finally
    Editor.BlockVisible := True; // <---- BOOM
  end;
end;

Check that your source editor does not contain UTF-8 characters or a BOM. Delphi 6 and 7 allow you to paste those into the editor window (from an editor that supports them, like Notepad++ or Delphi >7) but cannot handle it correctly.