User Tools

Site Tools


everything_object

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
everything_object [2018/01/28 16:55] – created wolfgangriedmanneverything_object [2020/06/14 22:55] (current) – The old sentence said "A method every object has is the As String() method. joecurran
Line 3: Line 3:
 In .NET even basic datatypes like ''string'' or ''int'' are an object. In .NET even basic datatypes like ''string'' or ''int'' are an object.
  
-This means that even these datatypes can (an have) own methods. method that every object has, is the ''AsString()'' method. This method sometimes returns useful data: +This means that even these datatypes can (an have) own methods. One method common to every object is ''AsString()'' . This method sometimes returns useful data: 
-<code>local nInt as int+<code visualfoxpro>local nInt as int 
 +local oDate as DateTime 
 +local lLogic as logic
  
 nInt := 1234 nInt := 1234
-System.Console.WriteLine( nInt:ToString() )</code> +oDate := DateTime.Now 
-returns<code>12345 +lLogic := true 
-28.01.2018 17:51:37</code>+System.Console.WriteLine( nInt:ToString() ) 
 +System.Console.WriteLine( oDate:ToString() ) 
 +System.Console.WriteLine( lLogic:ToString() )</code> 
 +returns<code visualfoxpro>12345 
 +28.01.2018 17:51:37 
 +true</code>
  
 But sometimes, in more complex classes, the ''ToString()'' method returns only the name of the class, and it is to you to define such a method that returns a more meaningful string value. But sometimes, in more complex classes, the ''ToString()'' method returns only the name of the class, and it is to you to define such a method that returns a more meaningful string value.
everything_object.1517158559.txt.gz · Last modified: 2018/01/28 16:55 by wolfgangriedmann