clrSet: Sets the value of a field or property of an object or class

Description Usage Arguments Examples

Description

Sets the value of a field or property of an object or class

Usage

1
clrSet(objOrType, name, value)

Arguments

objOrType

a CLR object, or type name, possibly namespace and assembly qualified type name, e.g. 'My.Namespace.MyClass,MyAssemblyName'.

name

the name of a field/property of the object

value

the value to set the field with

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
library(rClr)
testClassName <- "Rclr.TestObject";
testObj <- clrNew(testClassName)
clrReflect(testObj)
clrSet(testObj, 'FieldIntegerOne', 42)
clrSet(testClassName, 'StaticPropertyIntegerOne', 42)

# Using 'good old' Windows forms to say hello:
clrLoadAssembly("System.Windows.Forms, Version=2.0.0.0, 
  Culture=neutral, PublicKeyToken=b77a5c561934e089")
f <- clrNew('System.Windows.Forms.Form')
clrSet(f, 'Text', "Hello from '.NET'")
clrCall(f, 'Show')

## End(Not run)

jmp75/rClr documentation built on June 11, 2019, 6:45 p.m.