Home
Top.Mail.Ru Yandeks.Metrika
Forum: "Main";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Down

Question about the DeleteFile function Find similar branches


MARcoDEN   (2001-12-15 17:13) [0]

Probably everyone knows about the DeleteFile function. So, I have 2 questions: 1) the help says that if successful, the function returns a nonzero value. So why Delphi swears at this line:

if DeleteFile ("arj.exe") <> 0 then ShowMessage ("OK!") else Halt;

2) is also written in the help that to get detailed information call GetLastError. Tell me, please, using this function as an example.

Thanks in advance!



Art   (2001-12-15 17:30) [1]

Have a message and everything, do you need it ??? or do it differently, first delete the file, and then look for it FileExists and display a message!



MARcoDEN   (2001-12-15 17:33) [2]

2Art: Tell me too ... I need to know exactly these things.



Art   (2001-12-15 17:40) [3]

Well, damn, then if DeleteFile ("arj.exe") = 0 then ShowMessage ("OK!") Else Halt;



evgeg   (2001-12-15 17:40) [4]

function DeleteFile (const FileName: string): Boolean;

Those. result type is boolean.



Art   (2001-12-15 17:40) [5]

Well, damn, then if DeleteFile ("arj.exe") = 0 then ShowMessage ("Error!") Else Halt;



Anatoly Podgoretsky   (2001-12-15 18:11) [6]

You are talking about different DeleteFile



Song   (2001-12-15 22:13) [7]

If DeleteFile prints Exception if the file does not have one, then you can:

try
DeleteFile ....
ShowMessage ...
except
Halt
end;



evgeg   (2001-12-16 00:30) [8]

> Anatoly Podgoretsky
I know, but he has a module connected with what I said.

> Art
Boolean can only be compared with true or false, but it does not need to be done,
since it can be directly used in the condition.
I wonder now you guess how to write a condition?



Anatoly Podgoretsky   (2001-12-16 11:05) [9]

The module is connected to it, I have no doubt, but throughout the discussion it is clear that we are talking about one thing, but trying to work with another



MARcoDEN   (2001-12-16 16:22) [10]

2Art: Have you ever tried to compile what you wrote in the program? Feels like no! Delphi gives the error: Incompatible types.
And no one really gave an answer to my question :(.



Anatoly Podgoretsky   (2001-12-16 17:37) [11]

You gave it to him several times and that is your problem, that you cannot understand.
Once again you speak about one DeleteFile from Windows, and you use DeleteFile from SysUtils.



Pages: 1 whole branch

Forum: "Main";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Top





Memory: 0.57 MB
Time: 0.027 c
1-22029
neo_
2001-12-18 12:33
2002.01.08
kill tThread


7-22418
Mikle
2001-09-20 09:06
2002.01.08
Urgently! Comp instead of the printer.


7-22434
tomas2001
2001-09-24 14:04
2002.01.08
File transfer via modem


6-22292
3d [Power]
2001-10-06 18:16
2002.01.08
Network code for the game.


14-22324
Yuraz
2001-11-04 11:37
2002.01.08
Geography by IP





afrikaans albanian Arabic armenian azerbaijani basque belarusian bulgarian catalan Chinese (Simplified) Chinese (Traditional) croatian Czech danish Dutch English estonian filipino finnish French
galician georgian German greek haitian Creole hebrew Hindi hungarian icelandic Indonesian Irish italian Japanese Korean latvian lithuanian macedonian malay maltese norwegian
persian polish portuguese Romanian russian serbian slovak Slovenian Spanish swahili Swedish ภาษาไทย turkish Ukrainian urdu Tiếng Việt welsh yiddish bengali bosnian
cebuano Esperanto gujarati hausa hmong igbo javanese kannada Khmer lao latin maori marathi mongolian nepali punjabi somali tamil telugu yoruba
zulu
English French German Italian Portuguese Russian Spanish