Talk:Delphi Intrinsic Routines

From RAD Studio
Jump to: navigation, search

The default() function should be listed at this page, shouldnt it? --Nersgatt (talk) 01:00, 17 April 2014 (PDT)

Response

The default property is listed in a table of Delphi directives here: http://docwiki.embarcadero.com/RADStudio/XE9/en/Fundamental_Syntactic_Elements#Directives

You apply the default property to a type parameter in order to get default values. This default property was introduced with generics. It typically represents a 0 value or an empty string.

There is another default property, meaning the default for a property. For example, Items is the default property for TStringList (which is a list of TStrings). So the following lines are equivalent:

 myStringList[0] // the first string in the stringlist
 myStringList.Items[0]  

KrisHouser (talk) 14:16, 17 April 2014 (PDT)