[fpc-pascal] Empty string

John Coppens john at jcoppens.com
Fri Mar 7 15:35:05 CET 2008


On Fri, 7 Mar 2008 15:09:36 +0100
Damien Gerard <milipili at shikami.org> wrote:

> Consequently, it can not be the same code. Otherwise I understood  
> nothing :)

'' is an empty string, _and_ its length is zero (of course). So the
compiler is so intelligent as to replace  length(s) = 0, or s = ''
by the same code.

Normally s = '' would be a very slow way to check for an empty string, so
the compiler optimizes this automatically.

John



More information about the fpc-pascal mailing list