AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Programmieren allgemein Delphi how can I call a function with parameter record in another unit ?
Thema durchsuchen
Ansicht
Themen-Optionen

how can I call a function with parameter record in another unit ?

Ein Thema von obiwankby · begonnen am 29. Jul 2010 · letzter Beitrag vom 29. Jul 2010
Antwort Antwort
obiwankby

Registriert seit: 4. Jun 2010
15 Beiträge
 
RAD-Studio 2010 Arc
 
#1

how can I call a function with parameter record in another unit ?

  Alt 29. Jul 2010, 12:00
Hi,

How can I call a function with parameter record in another unit?

For example:
TGrUser = record
Name : string [20];
Descr : string [100];
R1 : boolean;
end;

function fGrUser(sS:string;writeUser: TGrUser);
begin
...
end;

If I call the function in the unit1 where is create type record and function it work; if I call the function from unit2 I have the message error: "E2010 incompatible types ...".

The type record from unit2 is declarated in unit2.

bye

ObiWanKby
obi wan kby
  Mit Zitat antworten Zitat
Benutzerbild von cherry
cherry

Registriert seit: 14. Nov 2005
561 Beiträge
 
RAD-Studio 2009 Ent
 
#2

AW: how can I call a function with parameter record in another unit ?

  Alt 29. Jul 2010, 12:23
is the type declared twice?
if yes, try to declare it only in one unit!
Ist das nur mein Gefühl, oder ist die ganze Welt verrückt geworden!?
  Mit Zitat antworten Zitat
Benutzerbild von DeddyH
DeddyH

Registriert seit: 17. Sep 2006
Ort: Barchfeld
27.540 Beiträge
 
Delphi 11 Alexandria
 
#3

AW: how can I call a function with parameter record in another unit ?

  Alt 29. Jul 2010, 12:47
That' s it. You can either declare the type in the interface-section of one of your units or create a separate unit for this type, which you add in both "uses"-clauses.
Detlef
"Ich habe Angst vor dem Tag, an dem die Technologie unsere menschlichen Interaktionen übertrumpft. Die Welt wird eine Generation von Idioten bekommen." (Albert Einstein)
Dieser Tag ist längst gekommen
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:58 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz