Autor Beitrag
ForzaFCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 80


D6 / D7 Personal
BeitragVerfasst: Mi 19.05.04 08:03 
Also ich möchte eine Abfrage starten die abfrage soll lauten

Wenn Test.Ini vorhanden dann Test.Ini nicht mehr erstellen

habe das ganze jetzt mit sämtlichen NOT-Varianten ausprobiert ein Beispiel

ausblenden Delphi-Quelltext
1:
2:
3:
not(test) do
begin
ini := TIniFile.Create('c:\Test.Ini')


"Fehler bei allen varianten, Operator ist auf diesn Operandentyp nicht anwendbar"


Kriege gerade eine mittlere krise :evil:

_________________
HANSA ROSTOCK DU SOLLST STRAHLEN..... *sing* Für immer und ewig FC hansa Rostock!
FaTaLGuiLLoTiNe
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 200
Erhaltene Danke: 5

Windows 7, Windows 8.1
Delphi XE
BeitragVerfasst: Mi 19.05.04 08:28 
Hmm was ist denn genau Test? Ne Variable, ne Funktion? Vor allem von welchem Typ? Das was du da vor hast geht nur mit Boolean - Werten.

Folgendes sollte funktionieren:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
if not FileExists('c:\Test.ini')
 then try
  ini := TIniFile.Create('c:\Test.Ini')
  (...)
 except
  (...)
 end;

_________________
<< FaTaLGuiLLoTiNe >>
Rhinoceroses don't play games!


Zuletzt bearbeitet von FaTaLGuiLLoTiNe am Mi 19.05.04 08:28, insgesamt 1-mal bearbeitet
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Mi 19.05.04 08:28 
Hallo,

wie wäre es mit

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
if not FileExists('c:\Test.Ini') then
begin
  ...
  ...
end;

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
ForzaFCH Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 80


D6 / D7 Personal
BeitragVerfasst: Mi 19.05.04 08:44 
jo dat werde ich gleisch mal probieren!

_________________
HANSA ROSTOCK DU SOLLST STRAHLEN..... *sing* Für immer und ewig FC hansa Rostock!
ForzaFCH Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 80


D6 / D7 Personal
BeitragVerfasst: Mi 19.05.04 08:49 
dat funzt ich danke eusch!!!

_________________
HANSA ROSTOCK DU SOLLST STRAHLEN..... *sing* Für immer und ewig FC hansa Rostock!
MartinPb
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 698



BeitragVerfasst: Mi 19.05.04 10:49 
Wie wäre es mit einem einfachen:

ausblenden Delphi-Quelltext
1:
ini := TIniFile.Create('c:\Test.Ini')					


Das ganze wird schon automatisch geregelt. Existiert keine Ini, dann wird sie erstellt. Existiert die Ini, dann wird keine neue erstellt, sondern die vorhandene genommen. Eine Abfrage ist also nicht nötig.

Wie kommst du überhaupt drauf, daß eine neue erstellt wird? Der Grund wieso du nichts dazu findest ist der, daß es einfach nicht nötig ist. Mich wundert es überhaupt, daß die Kollegen die bis her geantwortet haben, überhaupt drauf eingegengen sind. Eigentlich hättest du die Antwort schon früher bekommen müssen.

_________________
Gruß
Martin
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Mi 19.05.04 10:58 
Hallo,

MartinPb hat folgendes geschrieben:

Existiert keine Ini, dann wird sie erstellt..


Das stimmt so nicht!!

Eine Ini-Datei wird erst dann erstellt, wenn eine Anweisung wie WriteString, WriteInteger o.ä. erfolgt.

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
MartinPb
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 698



BeitragVerfasst: Mi 19.05.04 11:51 
Du wiedersprichst mir nicht. Ich hab nicht genau eingegrenzt wann eine Ini erstellt wird, weil es nicht das Problem war. Das Problem war, daß er keine neue Ini erstellen will.

_________________
Gruß
Martin
ForzaFCH Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 80


D6 / D7 Personal
BeitragVerfasst: Mi 19.05.04 14:17 
hab mich ein bisschen falsch ausgedrückt neu erstellt wird sich nicht aber das was in der ini drinne steht wird dann über schrieben!! oder nicht?

_________________
HANSA ROSTOCK DU SOLLST STRAHLEN..... *sing* Für immer und ewig FC hansa Rostock!