CreateObject

www.kxcad.net Home > Electronic Index > Altium(Protel) Index


Your Ad Here

Declaration

function createobject(object) : object;

Description

The CreateObject function can be used to create objects that will be implicitly freed when no longer used. So instead of

Procedure proc;

Var

    l;

Begin

    l := TList.Create;

    Try

        // do something with l

    Finally

        L.Free;

    End;

End;

you can write

Procedure proc;

Var

    l;

Begin

    l := CreateObject(TList);

    // Do something with l

End;

 

Your Ad Here