Вниз
Скачать: CL | DM;

Создание и использование своего юнита с процедурами и функциями   Найти похожие ветки 

 
allrussia   (2006-06-03 20:00) [0]

unit Imp;

interface

uses SysUtils, Windows, Forms, Dialogs;

type TImp = class (TOBject)
 protected
   function AddS: integer;
 public
   function AddX: integer;
 end;

implementation

uses Unit1;

function TImp.AddS: integer;
begin
result := 1;
end;

function TImp.AddX: integer;
begin
result := 1;
end;

end.


Нужно чтобы я мог подключить этот юнит к проекту и спользовать функции

получается только так:
with TImp.Create do Addx;

а мне нужно просто Addx

что я не так делаю. спасибо


 
antonn ©   (2006-06-03 20:05) [1]

может так?
без классов и объектов:
unit Imp;

interface

uses SysUtils, Windows, Forms, Dialogs;

 function AddS: integer;

implementation

function AddS: integer;
begin
result := 1;
end;

end.


 
Iehbr ©   (2006-06-03 20:08) [2]

unit MyUnit;

interface
function AddS : Integer;
implementation
Function AddS : Integer;
 begin
   Result := 1;
 end;
end.


 
Iehbr ©   (2006-06-03 20:10) [3]


> antonn ©   (03.06.06 20:05) [1]


опередил :)


 
antonn ©   (2006-06-03 20:11) [4]

Iehbr ©   (03.06.06 20:10) [3]
ага:)
а еще я тегами пользуюсь ;)


 
allrusia   (2006-06-03 20:14) [5]

antonn, Iehbr

Спасибо за оперативный ответ!



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.46 MB
Время: -0.914 c
3-1146632130
thvfrjd
2006-05-03 08:55
2006.06.25
странный результат выполнения запроса


15-1149230575
Prohodil_Mimo
2006-06-02 10:42
2006.06.25
что такое: полевая сторона?


2-1149347708
AlexanderMS
2006-06-03 19:15
2006.06.25
Показывать амперсанд (&)


15-1149171523
antonn
2006-06-01 18:18
2006.06.25
Обстановка изменилась?..


2-1149274678
deplhi
2006-06-02 22:57
2006.06.25
EOleSysError: Class not registered(и снова про СОМ)




   Наверх