Autor Beitrag
csigg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Do 21.07.05 14:07 
Ich hab ein dynmaisches Array, kann mir jemand sagen wie ich da draus ein normales bekomme??
TMonthCalendar.BoldDays nimmt nur normale arrays
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Do 21.07.05 14:12 
Das wird nicht gehen, weil du nicht zur Entwurfszeit weißt, wie groß das Array ist. Außerdem ist BoldDays IIRC ein set und kein Array :gruebel:

AXMD
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Do 21.07.05 14:23 
Das heisst es geht garnicht??
ausblenden Delphi-Quelltext
1:
BoldDays(Days: array of LongWord;					

ist doch ein normales Array, oder??
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Do 21.07.05 14:28 
Delphi-Hilfe? ;-)
Zitat:
public procedure BoldDays(Days: array of Cardinal, var MonthBoldInfo: Cardinal);


Zeige mal bitte Deinen Quellcode, dann kann man dir besser helfen :-)

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Do 21.07.05 14:33 
Hier mal mein Quellcode
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
    sqlstatement := 'SELECT * FROM ANWESENHEIT WHERE MANR=0';
  //Auslesen der Öffnungszeiten aus der Datenbank
 try
    with dmMesse.qryAnwesenheit do
    begin
      Close;
      SQL.Clear;
      SQL.Add(sqlstatement);
      Open;
      First;


      i := 10;
      SetLength(feld, i);
      i := 0;
      while not EOF do
      begin

           sdatum := fieldbyname('DATUM').AsString;
           feld[i] := StrToInt(copy(sdatum,0,2));
           i := i + 1;
           next;
      end;
   end;
   except
       ShowMessage('Fehler bei Verbindung mit der Datenbank');
   end;

   mcBeginDate.BoldDays(feld,7);
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Do 21.07.05 14:34 
Hab mich geäuscht, sorry. Aber normalerweise sollte das schon gehen. Wie Christian schon sagt: Code wäre nicht schlecht ;)

AXMD
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Do 21.07.05 14:35 
Code ist schon da *g*
War schneller mit Einfgen *g*
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Do 21.07.05 14:49 
Hallo!

Unabhängig von der Deklaration von werte, die vielleicht noch helfen könnte, kannst Du als zweiten Parameter keinen fest Wert übergebn, da der zweite Parameter ein VAR-Parameter ist und Delphi Dir dort hinein noch ein Ergebnis ausgibt.

Steht übrigens auch in der Delphi-Hilfe und Delphi sollte Dir auch einen entsprechenden Fehler ausgegeben haben ;-)

Grüße
Christian

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Do 21.07.05 14:55 
werte?? Es kam vorerst nur die eine Meldung dass das Array nicht passt.
Als zweites kann ich auch ne Variable reinschreiben.
Mir gehts im Moment vorwiegend darum wie ich im die Daten in Array übergib.
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Do 21.07.05 15:06 
user profile iconcsigg hat folgendes geschrieben:
werte??
Ach nee, hieß ja feld. Naja, allzu viel Auswahl an relevanten Arrays gibt's hier ja nicht, sollte also eigentlich klar gewesen sein ;-)

user profile iconcsigg hat folgendes geschrieben:
Es kam vorerst nur die eine Meldung dass das Array nicht passt.
Dann poste doch mal, wie oben gesagt, die Deklaration.

user profile iconcsigg hat folgendes geschrieben:
Als zweites kann ich auch ne Variable reinschreiben.
Du musst ;-)

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Do 21.07.05 15:07 
Also hier jetzt mal die zweite Version:
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
procedure Tfrm_buchung.fuelleDatum;
var feld: array of integer;
    sqlstatement: string;
    i: Integer;
    sdatum: String;
    MonthBoldInfo: LongWord;
begin
     sqlstatement := 'SELECT * FROM ANWESENHEIT WHERE MANR=0';
  //Auslesen der Öffnungszeiten aus der Datenbank
 try
    with dmMesse.qryAnwesenheit do
    begin
      Close;
      SQL.Clear;
      SQL.Add(sqlstatement);
      Open;
      First;

      //und hier kommt noch ein Kommentar rein

      i := 10;
      SetLength(feld, i);
      i := 0;
      while not EOF do
      begin
           sdatum := fieldbyname('DATUM').AsString;
           feld[i] := StrToInt(copy(sdatum,0,2));
           i := i + 1;
           next;
      end;
   end;
   except
       ShowMessage('Fehler bei Verbindung mit der Datenbank');
   end;

   mcBeginDate.BoldDays(feld,MonthBoldInfo);

end;
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Do 21.07.05 15:08 
An der Eigenwerbung komm ich nicht vorbei, sorry :mrgreen: www.delphi-forum.de/...ighlight=tdscalendar Vielleicht geht's damit ja besser ;)

AXMD
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Do 21.07.05 15:10 
Du hast feld als Array of Integer deklariert, erwartet wird wie auch die Hilfe sagt (wiederhole ich mich :gruebel:), ein Array of Cardinal.

//edit: @AXMD: Es geht auch mit diesem hier ;-)

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Do 21.07.05 15:14 
in meiner Hilfe steht:
array of LongWord; (Delphi 5)

und ich dachte LongWord ist zu integer kompatibel??
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Do 21.07.05 15:18 
Was steht in Deiner Delphi-Hilfe zu LongWord (der auf einem 32bit-System zu Cardinal identisch ist)? :roll:

Meine sagt:
Integer: -2147483648..2147483647
LongWord: 0..4294967295

Passt also nicht.

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Do 21.07.05 15:22 
OK, OK, überredet.
Er macht zwar noch nix fett, aber es wird mal kompiliert, danke
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Do 21.07.05 15:23 
Wenn's kompiliert kannst Du's ausliefern :D

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Do 21.07.05 15:26 
jaja, genau. Muss jetzt nur noch schaun warum er nix anzeigt, weil es auch mit dem Beispiel von der Hilfe nicht geht :?:
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Do 21.07.05 15:28 
user profile iconcsigg hat folgendes geschrieben:
jaja, genau. Muss jetzt nur noch schaun warum er nix anzeigt, weil es auch mit dem Beispiel von der Hilfe nicht geht :?:


Vielleicht irgendeine Property umgestellt, die diese selbst eingetragenen Daten (Datumsen :mrgreen:) ignoriert.

AXMD
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Do 21.07.05 15:29 
Bei mir funktioniert das, was in der Hilfe steht. Ich sehe in Deinem Code aber nirgendwo das Ereignis OnGetMonthInfo, welches man verwenden soll. :lupe:

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".