tsd10123
Programmer
- Feb 4, 2009
- 2
Hi,
I'm using 2 types of objects and need the some same procedures for both types, how can I pass them as parameter?
Small Example to show what I mean:
type
obj1=object
nr:int64;
procedure p;
end;
obj2=object
nr:integer;
procedure p;
end;
[...]
var abj1; bbj2;
procedure proc3(var c);(*I Don't know what type I should use, or can I say that's type obj1 or obj2?*)
begin
c.p;
end;
Begin
proc3(a);
proc3(b);
end.
Without a defined type (like it is showed now), it gives an Error62: record, object or class type required. on the c.p; -line
Thx,
Pieter
PS:The solution isn't putting both types togheter.
I'm using 2 types of objects and need the some same procedures for both types, how can I pass them as parameter?
Small Example to show what I mean:
type
obj1=object
nr:int64;
procedure p;
end;
obj2=object
nr:integer;
procedure p;
end;
[...]
var abj1; bbj2;
procedure proc3(var c);(*I Don't know what type I should use, or can I say that's type obj1 or obj2?*)
begin
c.p;
end;
Begin
proc3(a);
proc3(b);
end.
Without a defined type (like it is showed now), it gives an Error62: record, object or class type required. on the c.p; -line
Thx,
Pieter
PS:The solution isn't putting both types togheter.