.Net Example: Static Members

For static members, you can access through the instance object as well as with class name. In the ATEasy DotNet example, the class DotNetClass1 has a static variable member sStaticString:

The following example shows that you can access static member using class name:

if DotNetClass1.sStaticString<>"DotNetClass1.StaticConstructor"

TestStatus=FAIL

endif

You can also access static member using instance object:

cls1=new DotNetClass1()

if cls1.sStaticString<>DotNetClass1.sStaticString

TestStatus=FAIL

endif

The class also has a static property member, StaticProp:

if DotNetClass1.StaticProp<>"DotNetClass1.StaticConstructor"

TestStatus=FAIL

endif

The class also has a static property method, StaticMethod:

if DotNetClass1.StaticMethod()<>"DotNetClass1.StaticMethod"

TestStatus=FAIL

endif