On Mon, 25 May 2015, Géza Kovacs Géza wrote:

Hi!

Thx your answer.


Can I use the "AssignFile" procedure from the SysUtils unit instead of
the simple assign procedure from the System unit?
What is the problem with the simple "assign"?

I read from the Free Pascal Wiki:
AssignFile (prevent the use of the older Assign procedure) - Assign a
name to a file

CloseFile (prevent the use of the older Close procedure) - Close opened file

What is the difference between simple "assign", "close", or
"AssignFile", and "CloseFile"?

There is none, they are 100% the same.

There is no reason not to use the Assign/Close in non-gui code.

The (IMHO misguided) reason for these statements is that TPersistent and TForm (a TPersistent descendent) have Assign and Close methods. Because of this, confusion can arise if you write Assign or Close in TForm methods.

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to