> Hello everyone,
>
> Can anyone tell me what is the following code meaning? By the
> way, it is not > important to me, I just read the code in 3rd party and I
am just curious.

> type
>   TWhatever = type string;

> Is that same as this one without word type?
> type
>   TWhatever = string;


The first example is a strongly typed alias, it is similar to the second
example, but its considered a new type by the compiler.

ie -  TWhatever will be converted to a string for assigning, but it won't be
compatible when used in var parameters.

If you had a procedure
        procedure FarSide(var Value: String)
        begin
                //some code...
        end;

You could not do this:

var Whatever:TWhatever;
begin
        FarSide(Whatever); //Error....
end;

>

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to