DNSet

Sets the value of a property in a .NET Assembly object. This function is used to update a data member, property or array cell.

Syntax:

DNSet (property, value)

Parameter:

property: The .NET field, data member, property or array cell to set its value.

value: The required value of the property.

Returns:

The value set.

Examples:

DNSet(A,DotNet.System.Drawing.Font('Arial', 10))

Suppose A is a .NET variable of type System.Drawing.Font, this will set its value to Arial with size 10. This is equivalent to updating A with DotNet.System.Drawing.Font('Arial', 10)
 

DNSet(A.Font, DotNet.System.Drawing.Font('Arial', 10))

Suppose A is a .NET var that has a property of Font, this will set its value to Arial with size 10.
 

DNSet(A.myIntProp, 7)

Suppose A is a field of some .NET type that has an integer property named myIntProp. This will set the value of myIntProp to 7.
 

DNSet(A[3], 'hello')

Suppose A is of type System.String[]. This will set the fourth cell of A with the value 'hello'.

Notes:

This is a client-side function that is only available for Rich Client tasks.

The value parameter must be of the same attribute as the Object Property.

There are two ways to set the value of a .NET field either by using the Update operation or the DNSet() function. The only way to set the value of a data member, property, or array cell is by using the DNSet() function.