Beschreibung:
Liefert den Wert der Property.
Parameter:
|
Parametername |
Typ |
Beschreibung |
|
Index bzw. Key |
Variant |
Der identifizierende 0-basierte Index (falls Argumenttyp = Long) der Property, ansonsten der die Property identifizierende Schlüssel (falls Argumenttyp = String). |
|
DefaultValue |
Variant |
Optional. Zurückzugebender Wert, falls die Property mit diesem Key-Wert nicht (mehr) existiert. |
Rückgabewert:
Variant
Beispiel VBScript:
Dim oScriptContext : Set oScriptContext = cRM.CurrentProject.CreateScriptContext()
oScriptContext.SetProperty "prop0_key", "prop0_value"
MsgBox oScriptContext.GetPropertyKey(0) & " : " & oScriptContext.GetProperty("prop0_key", "prop0_default")
MsgBox oScriptContext.GetPropertyKey(0) & " : " & oScriptContext.GetProperty(0, "prop0_default")
oScriptContext.SetProperty "prop1_key", 123
MsgBox oScriptContext.GetPr
opertyKey(1) & " : " & oScriptContext.GetProperty("prop1_key", "prop1_default")
MsgBox oScriptContext.GetPropertyKey(1) & " : " & oScriptContext.GetProperty(1, "prop1_default")
oScriptContext.SetProperty "prop2_key", cRM.CurrentProject.ActiveViews.ActiveView.CurrentRecord
MsgBox oScriptContext.GetPropertyKey(2) & " : " & oScriptContext.GetProperty("prop2_key", "prop2_default").GetContentsByName("Company")
MsgBox oScriptContext.GetPropertyKey(2) & " : " & oScriptContext.GetProperty(2, "prop2_default").GetContentsByName("Company")
Set oScriptContext = Nothing
Beispiel C#-Script:
var scriptContext = cRM.CurrentProject.CreateScriptContext();
scriptContext.SetProperty("prop0_key", "prop0_value");
MessageBox.Show(scriptContext.GetPropertyKey(0) + " : " + scriptContext.GetProperty("prop0_key", "prop0_default"));
MessageBox.Show(scriptContext.GetPropertyKey(0) + " : " + scriptContext.GetProperty(0, "prop0_default"));
scriptContext.SetProperty("prop1_key", 123);
MessageBox.Show(scriptContext.GetPropertyKey(1) + " : " + scriptContext.GetProperty("prop1_key", "prop1_default"));
MessageBox.Show(scriptContext.GetPropertyKey(1) + " : " + scriptContext.GetProperty(1, "prop1_default"));
scriptContext.Dispose();