On Thursday 10 September 2009 17:52:44 Florian Klaempfl wrote: > Ivo Steinmann schrieb: > > 1. Using =nil or Assigned should result in the same. > > Afaik not, this was one of the reasons for assigned. >
I have always used Assigned() to test whether a pointer is 'valid' or is nil. Thus Assiged() should return False if pointer is nil? procedure Test; var myPtr : PChar; begin // Pointer variables are not set to nil by default if Assigned(myPtr) then ShowMessage('myPtr is not nil') else ShowMessage('myPtr is nil'); // So we must set them to nil to be sure that they are undefined myPtr := Nil; if Assigned(myPtr) then ShowMessage('myPtr is still not nil') else ShowMessage('myPtr is nil'); end; if you don't agree, don't blame me. http://www.delphibasics.co.uk/RTL.asp?Name=Assigned > _______________________________________________ > fpc-devel maillist - fpc-devel@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-devel _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel