AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Object-Pascal / Delphi-Language Delphi Incompatible Typen??? Was mach ich nu wieder falsch?
Thema durchsuchen
Ansicht
Themen-Optionen

Incompatible Typen??? Was mach ich nu wieder falsch?

Ein Thema von Kedariodakon · begonnen am 24. Sep 2004 · letzter Beitrag vom 24. Sep 2004
Antwort Antwort
Seite 1 von 2  1 2      
Benutzerbild von Kedariodakon
Kedariodakon

Registriert seit: 10. Sep 2004
Ort: Mönchengladbach
833 Beiträge
 
Delphi 7 Enterprise
 
#1

Incompatible Typen??? Was mach ich nu wieder falsch?

  Alt 24. Sep 2004, 08:23
ich bekomme bei der Zeile:

IF ADODataSet1.RecordsetState = stClosed Then Label1.Caption := 'stClosed'; den Fehler: [Fehler] MainUnit.pas(220): Inkompatible Typen

Weshalb?


Zitat von Delphi Hilfe:
Delphi-Syntax:
property RecordsetState: TObjectStates;
Und weiter:
Zitat von Delphi Hilfe:
type
TObjectState = (stClosed, stOpen, stConnecting, stExecuting, stFetching);
TObjectStates = set of TObjectState;
was hab ich nu falsch gemacht? Darf ich ADODataSet1.RecordsetState nicht mit stClosed vergleichen?
Ich peil nix mehr...


MFG Keda
Christian
  Mit Zitat antworten Zitat
Benutzerbild von sakura
sakura

Registriert seit: 10. Jun 2002
Ort: München
11.412 Beiträge
 
Delphi 11 Alexandria
 
#2

Re: Incompatible Typen??? Was mach ich nu wieder falsch?

  Alt 24. Sep 2004, 08:25
versuche mal
Code:
IF ADODataSet1.RecordsetState = [color=#ff0000][[/color]stClosed[color=#ff0000]][/color] Then Label1.Caption := 'stClosed';
......
Daniel W.
Ich bin nicht zurück, ich tue nur so
  Mit Zitat antworten Zitat
mumu

Registriert seit: 28. Okt 2003
Ort: Bamberg
519 Beiträge
 
#3

Re: Incompatible Typen??? Was mach ich nu wieder falsch?

  Alt 24. Sep 2004, 08:25
probier mal

IF ADODataSet1.RecordsetState = [stClosed] Then Label1.Caption := 'stClosed';
  Mit Zitat antworten Zitat
Benutzerbild von Kedariodakon
Kedariodakon

Registriert seit: 10. Sep 2004
Ort: Mönchengladbach
833 Beiträge
 
Delphi 7 Enterprise
 
#4

Re: Incompatible Typen??? Was mach ich nu wieder falsch?

  Alt 24. Sep 2004, 08:55
Das geht...

Danke für die schnelle Antwort


MFG Keda
Christian
  Mit Zitat antworten Zitat
Benutzerbild von sakura
sakura

Registriert seit: 10. Jun 2002
Ort: München
11.412 Beiträge
 
Delphi 11 Alexandria
 
#5

Re: Incompatible Typen??? Was mach ich nu wieder falsch?

  Alt 24. Sep 2004, 08:57
Hi,

jetzt suche in der Delphi-Hilfe mal nach Delphi-Referenz durchsuchensets, dann lernst Du näheres dazu. Damit Dein Code jetzt immer funktioniert, wenn das Recordset zu ist, ändere ihn wie folgend:
IF stClosed in ADODataSet1.RecordsetState Then Label1.Caption := 'stClosed'; ......
Daniel W.
Ich bin nicht zurück, ich tue nur so
  Mit Zitat antworten Zitat
Benutzerbild von Kedariodakon
Kedariodakon

Registriert seit: 10. Sep 2004
Ort: Mönchengladbach
833 Beiträge
 
Delphi 7 Enterprise
 
#6

Re: Incompatible Typen??? Was mach ich nu wieder falsch?

  Alt 24. Sep 2004, 09:04
Zitat von sakura:
Hi,

jetzt suche in der Delphi-Hilfe mal nach Delphi-Referenz durchsuchensets, dann lernst Du näheres dazu. Damit Dein Code jetzt immer funktioniert, wenn das Recordset zu ist, ändere ihn wie folgend:
IF stClosed in ADODataSet1.RecordsetState Then Label1.Caption := 'stClosed'; ......

wie wen das Recordset zu ist?
Das bedarf mehr Input...

Wenn ich in der Delphi-Hilfe nach sets suche bekomm ich keine Informationen die in dem Zusamenhang stehen... (oder ich gbin zu plöd zum suchen...)

MFG Keda
Christian
  Mit Zitat antworten Zitat
Benutzerbild von sakura
sakura

Registriert seit: 10. Jun 2002
Ort: München
11.412 Beiträge
 
Delphi 11 Alexandria
 
#7

Re: Incompatible Typen??? Was mach ich nu wieder falsch?

  Alt 24. Sep 2004, 09:06
Zitat von Kedariodakon:
wie wen das Recordset zu ist?
Das bedarf mehr Input...
Was ist jetzt Deine Frage, bzw. was hast Du jetzt nicht verstanden?

......
Daniel W.
Ich bin nicht zurück, ich tue nur so
  Mit Zitat antworten Zitat
Benutzerbild von Kedariodakon
Kedariodakon

Registriert seit: 10. Sep 2004
Ort: Mönchengladbach
833 Beiträge
 
Delphi 7 Enterprise
 
#8

Re: Incompatible Typen??? Was mach ich nu wieder falsch?

  Alt 24. Sep 2004, 09:10
Zitat von sakura:
... Damit Dein Code jetzt immer funktioniert, wenn das Recordset zu ist...
Versteh ich nicht, was du damit meinst.

Auch finde ich unter sets in der Delphi-hilfe ziehmlich viel, aber nix wirklich was in dem Zusammenhang steht.


MFG Keda
Christian
  Mit Zitat antworten Zitat
Benutzerbild von sakura
sakura

Registriert seit: 10. Jun 2002
Ort: München
11.412 Beiträge
 
Delphi 11 Alexandria
 
#9

Re: Incompatible Typen??? Was mach ich nu wieder falsch?

  Alt 24. Sep 2004, 09:19
Zitat von Kedariodakon:
Versteh ich nicht, was du damit meinst.
Ein Set kann mehrere Werte gleichzeitig haben, daher solltest Du nicht vergleichen, ob ein Set einer bestimmten Menge entspricht, sondern ob Dein Zielwert im Set enthalten ist.

Zitat von Kedariodakon:
Auch finde ich unter sets in der Delphi-hilfe ziehmlich viel, aber nix wirklich was in dem Zusammenhang steht.
Du sollst auch nach sets suchen, nicht nach RecordSet Sets ist ein Sprachelement von Delphi. Hier der entsprechende Teil:
Die englische Delphihilfe schreibt dazu
A set is a collection of values of the same ordinal type. The values have no inherent order, nor is it meaningful for a value to be included twice in a set.

The range of a set type is the power set of a specific ordinal type, called the base type; that is, the possible values of the set type are all the subsets of the base type, including the empty set. The base type can have no more than 256 possible values, and their ordinalities must fall between 0 and 255. Any construction of the form

set of baseType

where baseType is an appropriate ordinal type, identifies a set type.

Because of the size limitations for base types, set types are usually defined with subranges. For example, the declarations

type
TSomeInts = 1..250;
TIntSet = set of TSomeInts;

create a set type called TIntSet whose values are collections of integers in the range from 1 to 250. You could accomplish the same thing with

type TIntSet = set of 1..250;

Given this declaration, you can create a sets like this:

var Set1, Set2: TIntSet;
...
Set1 := [1, 3, 5, 7, 9];
Set2 := [2, 4, 6, 8, 10]

You can also use the set of ... construction directly in variable declarations:

var MySet: set of 'a'..'z';
...
MySet := ['a','b','c'];

Other examples of set types include

set of Byte
set of (Club, Diamond, Heart, Spade)
set of Char;

The in operator tests set membership:

if 'a' in MySet then ... { do something } ;

Every set type can hold the empty set, denoted by [].

Copyright © Borland.


......
Daniel W.
Ich bin nicht zurück, ich tue nur so
  Mit Zitat antworten Zitat
Benutzerbild von Kedariodakon
Kedariodakon

Registriert seit: 10. Sep 2004
Ort: Mönchengladbach
833 Beiträge
 
Delphi 7 Enterprise
 
#10

Re: Incompatible Typen??? Was mach ich nu wieder falsch?

  Alt 24. Sep 2004, 09:32
Ahh jetzt verstehe ich

Dann hab ich gerade wieder was gelernt

aber unter sets finde ich echt nicht das was du da angegeben hast! Wenn ich aber unter Mengentypen suche, find ich das


MFG Keda
Christian
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 1 von 2  1 2      


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 08:08 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