Autor Beitrag
Moritz M.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1672



BeitragVerfasst: Sa 30.08.03 13:28 
Hi

Habt ihr ne Idee, wie man das Sternzeichen berechnen könnte?

Onz

Moderiert von user profile iconTino: Titel geändert.
FeG
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 77

Win XP Home, SuSE Linux 8.2 Prof
D3 Prof, D7 Prof
BeitragVerfasst: Sa 30.08.03 14:08 
Hallo,

ich würd einfach ne procedure schreiben:

[pseudo-code]wenn Datum>=20.01.JAHR und Datum<=18.02.JAHR dann Sternzeichen:='Wassermann'[/pseudo-code]

MfG,
FeG
Moritz M. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1672



BeitragVerfasst: Sa 30.08.03 14:59 
Hi

Mn kann Daten doch nicht so direkt vergleichen, oder?
Also mit < und >

Blast! Onz
FeG
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 77

Win XP Home, SuSE Linux 8.2 Prof
D3 Prof, D7 Prof
BeitragVerfasst: Sa 30.08.03 15:02 
Onz hat folgendes geschrieben:
Mn kann Daten doch nicht so direkt vergleichen, oder?

Wieso nicht??

Start doch grad mal das hier:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.FormCreate(Sender: TObject);
var Date: TDateTime;
begin
Date:=EncodeDate(2000,1,1);
if Date<Now then ShowMessage('Kleiner')
end;


Hmm...

MfG,
FeG
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: So 31.08.03 11:24 
das date format in delphi ist im prinzip ja nur ein real wert !

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Moritz M. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1672



BeitragVerfasst: So 31.08.03 12:19 
Habs.

Danke
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mo 01.09.03 15:33 
Onz hat folgendes geschrieben:
Habs.

Wäre schön wenn du uns die Lösung hier postest. Danke!

Gruß
Tino
Wolff68
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 302
Erhaltene Danke: 1

WinXP home
D6 Prof
BeitragVerfasst: Do 04.09.03 18:45 
Hier die Lösung die ich Onz erstellt hatte:
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:
function Asterisk(ADate: TDate): string;
var
  Day, Month, Year : Word;
  DayNumber : Word;
begin
  { Tag des Jahres ermitteln }
  DecodeDate(ADate, Year, Month, Day);
  DayNumber := Trunc(ADate) - Trunc(EncodeDate(Year, 1, 1)) +1;

  { In Schaltjahren den 29.02. herausrechnen }
  If IsLeapYear(Year) and (DayNumber > 59) then Dec(DayNumber);

  { Zuweisung der Sternzeichen }
  Case DayNumber of
    020..049 : Result := 'Wassermann'; // (20.01.-18.02.)
    050..079 : Result := 'Fische';     // (19.02.-20.03.)
    080..109 : Result := 'Widder';     // (21.03.-19.04.)
    110..140 : Result := 'Stier';      // (20.04.-20.05.)
    141..172 : Result := 'Zwillinge';  // (21.05.-21.06.)
    173..203 : Result := 'Krebs';      // (22.06.-22.07.)
    204..235 : Result := 'Löwe';       // (23.07.-23.08.)
    236..266 : Result := 'Jungfrau';   // (24.08.-23.09.)
    267..296 : Result := 'Waage';      // (24.09.-23.10.)
    297..326 : Result := 'Skorpion';   // (24.10.-22.11.)
    327..355 : Result := 'Schütze';    // (23.11.-21.12.)
    else       Result := 'Steinbock';  // (22.12.-19.01.)
  end;
end;

_________________
"Der Mensch ist nicht was er sich vorstellt oder wünscht zu sein, sondern das was andere in ihm sehen."