Autor Beitrag
Millo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 147



BeitragVerfasst: Do 29.08.02 13:14 
Moin

Ich will das am anfang meines Programs zwei Variabelen mit Werten gefüllt werden die erste soll das Datum vom Tag des Starts haben und die zweite soll einfach StartDatum +30Tage sein.
Wenn ich jetzt aber mein Programm z.B. am nächsten Tag nochmal Starte füllt er die Variable 1 mit dem akktuellen Datum (also 2Tag) wie kann ich das umgehen.
Arakis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 344



BeitragVerfasst: Do 29.08.02 13:30 
Hi Millo user defined image,

du musst das Startdatum am ersten Tag, bzw ersten Starten irgendwo speichern. Das Enddatum braucht nicht gespeichert werden, da es sich einfach errechnen lässt. Oder wie meinst du das genau?

Bis dann
user defined image

_________________
Mit dem Computer löst man Probleme, die man ohne ihn nicht hätte.
Entwickler von SpaceTrek: The New Empire - Siehe Hompage!
Millo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 147



BeitragVerfasst: Do 29.08.02 13:56 
Titel: Ja genau
Ja genau

aber wenn ich das einfach nur so schreibe

ausblenden Quelltext
1:
ini.WriteString('Startdatum',Start',DateToStr(Date));					


wird ja jedesmal nur das Datum von dem Tag gespeichert
Arakis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 344



BeitragVerfasst: Do 29.08.02 14:03 
Ist ja auch klar, Date ist immer das aktuelle Datum :D

Nimm irgend einen anderen Variabelnamen
ausblenden Quelltext
1:
2:
var
  StartDatum: TDateTime;


Bis dann
user defined image

_________________
Mit dem Computer löst man Probleme, die man ohne ihn nicht hätte.
Entwickler von SpaceTrek: The New Empire - Siehe Hompage!
Millo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 147



BeitragVerfasst: Do 29.08.02 18:13 
Titel: Missverständnis
@ arakis

Ich glaub wir missverstehen uns z.B.

ausblenden Quelltext
1:
2:
3:
4:
5:
procedure TForm1.Form1OnClose(Sender: TObject; var Action: TCloseAction);
var ini: TIniFile;
begin
  ini:=TIniFile.create(w_path+'\stats.ini');
  ini.WriteString('Start','Start',ersterStart);


Wenn jetzt also das Programm geschlossen wird schreibt er immer wieder die Variable ersterStart neu hinein. Mein Problem dabei ist das er es nur ein einziges mal machen soll. Also wenn das Programm zum aller ersten mal gestartet wird.
Die einzige Möglichkeit die ich sehe währe wenn man einer anderen Variabelen einen Wert zuweist wenn in der Variable(ersterStart) ein Datum enthalten ist. Aber es müsste doch auch noch andere Möglichekeiten geben.
Arakis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 344



BeitragVerfasst: Do 29.08.02 19:35 
Titel: Re: Missverständnis
Millo hat folgendes geschrieben:
Die einzige Möglichkeit die ich sehe währe wenn man einer anderen Variabelen einen Wert zuweist wenn in der Variable(ersterStart) ein Datum enthalten ist. Aber es müsste doch auch noch andere Möglichekeiten geben.


Ich würde einfach mal sagen, dass das beste Idee ist :D
Also wenn Das Startdatum in der INI-Datei gleich "" ist, dann wird es gesetzt, ansonsten nicht :wink:

Bis dann
user defined image

_________________
Mit dem Computer löst man Probleme, die man ohne ihn nicht hätte.
Entwickler von SpaceTrek: The New Empire - Siehe Hompage!
Millo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 147



BeitragVerfasst: Do 29.08.02 22:53 
Gut wenn niemand ne andere Idee hat mach ich das dann so.
Arakis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 344



BeitragVerfasst: Do 29.08.02 22:57 
Wenn du es anders machen würdest, dann wäre es so, also ob du i + 3 - 4 + 2 rechnen würdest, nur um i um einen zu herhöhren :lol:

Bis dann
user defined image

_________________
Mit dem Computer löst man Probleme, die man ohne ihn nicht hätte.
Entwickler von SpaceTrek: The New Empire - Siehe Hompage!
hitstec
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 295



BeitragVerfasst: Fr 30.08.02 07:39 
Gewöhnliche If-Abfrage:

ausblenden Quelltext
1:
if not ini.ValueExists('Start','Start') then ini.WriteString('Start','Start',ersterStart);					
XPert
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 129

Windows 98/00/Me/XP
D6 Pers
BeitragVerfasst: Fr 30.08.02 13:57 
Du musst nach einem Textdokument suchen lassen! wenn z.B. date.txt vorhanden ist soll das programm nichts mehr reinschreiben! ist die datei ni9cht vorhanden soll das programm die datei erstellen und das aktuelle datum reinschreiben! wo liegt das problem?

_________________
MfG Fabian Schweers :lol:
Arakis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 344



BeitragVerfasst: Fr 30.08.02 14:02 
@XPert: Ich würde dich Datei nicht date.txt nennen, ist zu auffällig :wink:
Generell finde ich die Lösung mit der Datei anlegen nicht besonders gut, die vorherige von hitstec ist da schon ein bisschen besser. Wenn man ganz sicher gehen will(Was man eigentlich gar nicht kann), dann schreibt man die Infos verschlüsselt an mehreren versteckten Stellen in die Registry von Windows. Aber das ist natürlich ein etwas großerer Aufwand.

Bis dann
user defined image

_________________
Mit dem Computer löst man Probleme, die man ohne ihn nicht hätte.
Entwickler von SpaceTrek: The New Empire - Siehe Hompage!
XPert
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 129

Windows 98/00/Me/XP
D6 Pers
BeitragVerfasst: Fr 30.08.02 14:43 
ok, ok ist ja schon gut! warum bist du sauer auf mich (PN)???? außerdem kann man doch auch von dem programm die zeit verschlüsseln lassen, dann abspeichern und beim nächsten start wird das verschlüsselte entschlüsselt..... :? ?! sollte doch net das allergrößte problem sein......

_________________
MfG Fabian Schweers :lol:
Arakis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 344



BeitragVerfasst: Fr 30.08.02 14:53 
Hey, ich hab doch gar nix gegen dich gesagt. Ich bin auf niemanden sauer :D
Du musst dich nicht sofort angegriffen fühlen, ein bisschen Kritik muss jeder verkraften können :wink:

Ansonsten gilt: Alle Wege führen nach Rom :mrgreen:

Bis dann
user defined image

_________________
Mit dem Computer löst man Probleme, die man ohne ihn nicht hätte.
Entwickler von SpaceTrek: The New Empire - Siehe Hompage!
XPert
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 129

Windows 98/00/Me/XP
D6 Pers
BeitragVerfasst: Fr 30.08.02 15:11 
Rom ist auch untergegangen... :wink:

_________________
MfG Fabian Schweers :lol:
XPert
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 129

Windows 98/00/Me/XP
D6 Pers
BeitragVerfasst: Fr 30.08.02 15:14 
ach so, ich hab noch so 'n problem mit dem taschenrechner....
ich kann zwar den text per buttondruck im edit immer ändern, aber der alte wert verswchwindet immer........ das ist *?*?*?*?*!!!
wie geht das problem weg?

_________________
MfG Fabian Schweers :lol:
Arakis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 344



BeitragVerfasst: Fr 30.08.02 15:17 
Ich glaube, du hast den Thread verwechselt, hier ist der aktuelle :wink:
(Bitte fasse das jetzt nicht als Angriff gegen dich auf :o )

Bis dann
user defined image

_________________
Mit dem Computer löst man Probleme, die man ohne ihn nicht hätte.
Entwickler von SpaceTrek: The New Empire - Siehe Hompage!
XPert
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 129

Windows 98/00/Me/XP
D6 Pers
BeitragVerfasst: Fr 30.08.02 15:28 
ich gehör noch net in die klapse :wink:

_________________
MfG Fabian Schweers :lol: