User Tools

Site Tools


everything_object

Differences

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

Link to this comparison view

Last revision Both sides next revision
everything_object [2018/01/28 17:55]
wolfgangriedmann created
everything_object [2018/01/28 18:12]
wolfgangriedmann
Line 5: Line 5:
 This means that even these datatypes can (an have) own methods. A 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. A method that every object has, is the ''​AsString()''​ method. This method sometimes returns useful data:
 <​code>​local nInt as int <​code>​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 
 +lLogic := true 
 +System.Console.WriteLine( nInt:ToString() ) 
 +System.Console.WriteLine( oDate:​ToString() ) 
 +System.Console.WriteLine( lLogic:ToString() )</​code>​
 returns<​code>​12345 returns<​code>​12345
-28.01.2018 17:​51:​37</​code>​+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.txt · Last modified: 2018/08/20 06:03 by wolfgangriedmann