2006/6/21, Darius Blaszijk <[EMAIL PROTECTED]>:


Ive got a question about codetools.

I have tried to add a method to the folowing code;


<<SNIP>>
unit Unit1;

{$mode objfpc}{$H+}

interface

type
  Ttest = class(Tobject)
  private

  public
    constructor Create;
  end;

implementation

constructor Ttest.Create;
begin
end;

end.
<<SNAP>>

My test code is the folowing;

<<SNIP>>
  CodeBuffer:=CodeToolBoss.LoadFile(FileName, false, false);

  ti.Kind := tkMethod;
  ti.Name := 'name';
  codetoolboss.CreatePublishedMethod(codebuffer, 'Ttest',
'NewMethodName', @ti);

  codebuffer.SaveToFile('test.pas');
<<SNAP>>

The problem however is that when I execute the code I get an exception
message like: "unit not found: ObjPas".

Is there a way to prevent the codetool to parse all units in the uses clause
and simply just stick to the unit provided? Or am I misinterpreting the
errormessage in some way?

Maybe. ObjPas is added by the compiler, if you use mode objfpc or mode
delphi. Kind of like a second system unit.

Vincent

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to