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


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:

DeleteFile ....
ShowMessage ...

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];


Memory: 0.58 MB
Time: 0.026 c
2001-09-15 07:45
Windows Favorites

2001-12-04 15:14
Creating a table from Delphi.

2001-12-05 11:38
Implicitly Started Transactions

2001-12-03 12:19
Good people help with the stored procedure.

2001-10-08 11:05
How can I even connect a network printer, in addition to the standard method ??

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 Español swahili Swedish thai turkish Ukrainian urdu vietnamese welsh yiddish bengali bosnian
cebuano Esperanto gujarati hausa hmong igbo javanese kannada khmer lao latin maori marathi mongolian nepali punjabi somali tamil telugu yoruba
English French German Italian Portuguese Russian Spanish