AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Incompatible types

Ein Thema von WojTec · begonnen am 1. Dez 2012 · letzter Beitrag vom 2. Dez 2012
Antwort Antwort
WojTec

Registriert seit: 17. Mai 2007
480 Beiträge
 
Delphi XE6 Professional
 
#1

Incompatible types

  Alt 1. Dez 2012, 21:20
Delphi-Version: 2010
I have:

type TBoolans = array of Boolean;

Now function uses it. In var I have:

var Data: array [1..5] of Boolean.

Why I can't use it in function?
Is possible to make it usable (TBooleans and array of)?
  Mit Zitat antworten Zitat
Benutzerbild von jaenicke
jaenicke

Registriert seit: 10. Jun 2003
Ort: Berlin
9.350 Beiträge
 
Delphi 11 Alexandria
 
#2

AW: Incompatible types

  Alt 1. Dez 2012, 22:14
You have declared TBoolans as dynamic array, but your variable Data is a fixed size array.

You need to declare both as TBoolans to make them compatible.
Sebastian Jänicke
Alle eigenen Projekte sind eingestellt, ebenso meine Homepage, Downloadlinks usw. im Forum bleiben aktiv!
  Mit Zitat antworten Zitat
Benutzerbild von uligerhardt
uligerhardt

Registriert seit: 19. Aug 2004
Ort: Hof/Saale
1.735 Beiträge
 
Delphi 2007 Professional
 
#3

AW: Incompatible types

  Alt 1. Dez 2012, 22:25
If I understand you correctly you have function Func(const AArray: TBooleans); . I'd change that to function Func(const AArray: array of Boolean); . The first one accepts only dynamic arrays, the second all Boolean arrays. See Rudy's article about open arrays.
Uli Gerhardt
  Mit Zitat antworten Zitat
WojTec

Registriert seit: 17. Mai 2007
480 Beiträge
 
Delphi XE6 Professional
 
#4

Re: Incompatible types

  Alt 2. Dez 2012, 11:57
Ok, I'm no longer using TBooleans in parameters, just in results, thanks
  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 11:30 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