codetools: added example file for methodjumping

git-svn-id: trunk@22943 -
This commit is contained in:
mattias 2009-12-03 11:38:21 +00:00
parent 3b25d319c3
commit 0c3ffe4f45
3 changed files with 23 additions and 2 deletions

1
.gitattributes vendored
View File

@ -483,6 +483,7 @@ components/codetools/examples/scanexamples/emptymethods1.pas svneol=native#text/
components/codetools/examples/scanexamples/getcontextexample.pas svneol=native#text/plain
components/codetools/examples/scanexamples/identcomplexample.pas svneol=native#text/plain
components/codetools/examples/scanexamples/indentation.pas svneol=native#text/plain
components/codetools/examples/scanexamples/methodjump1.pas svneol=native#text/plain
components/codetools/examples/scanexamples/missingh2pasdirectives.pas svneol=native#text/plain
components/codetools/examples/scanexamples/modemacpas.pas svneol=native#text/plain
components/codetools/examples/scanexamples/overloadedfunction.pas svneol=native#text/plain

View File

@ -37,11 +37,11 @@ var
NewX, NewY, NewTopLine: integer;
RevertableJump: boolean;
begin
ExpandedFilename:=ExpandFileNameUTF8('scanexamples/tgeneric2.pas');
ExpandedFilename:=ExpandFileNameUTF8('scanexamples/methodjump1.pas');
CodeBuf:=CodeToolBoss.LoadFile(ExpandedFilename,true,false);
if CodeBuf=nil then
raise Exception.Create('failed loading '+ExpandedFilename);
if CodeToolBoss.JumpToMethod(CodeBuf,3,15,NewCode,NewX,NewY,NewTopLine,
if CodeToolBoss.JumpToMethod(CodeBuf,14,10,NewCode,NewX,NewY,NewTopLine,
RevertableJump)
then
writeln(NewCode.Filename,' ',NewX,',',NewY,' TopLine=',NewTopLine,

View File

@ -0,0 +1,20 @@
unit methodjump1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils;
procedure DoSomething;
implementation
procedure DoSomething;
begin
end;
end.