User Tools

Site Tools


conditional_access

Differences

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

Link to this comparison view

conditional_access [2018/03/28 13:08] (current)
wolfgangriedmann created
Line 1: Line 1:
 +====== Conditional access ======
 +
 +In X# you can use a conditional access to an object.
 +
 +Instead of writing
 +<code>if oObject != null
 +  oObject:ExecuteMethod()
 +endif</code>
 +you can write
 +<code>oObject?:ExecuteMethod()</code>
 +This means that there will be no exception in the case oObject is null.
 +Of course this works not only with methods, but also with properties (and access/assigns):
 +<code>oObject?:MyValue := cMyValue</code>
  
conditional_access.txt ยท Last modified: 2018/03/28 13:08 by wolfgangriedmann