ArrayDeProtectT Function (Array OfT) | |
Removes write protection from an entire array.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax FUNCTION ArrayDeProtect<T>(
aTarget AS ARRAY OF<T>
)
AS LOGIC
public static bool ArrayDeProtect<T>(
Array Of<T> aTarget
)
Request Example
View SourceParameters
- aTarget
- Type: Array OfT
The array to deprotect.
Type Parameters
- T
- The type of the array elements
Return Value
Type:
Logic
TRUE if the array was successfully deprotected; otherwise, FALSE.
Remarks
ArrayDeprotect() removes the protection placed on an array by the ArrayProtect() function, allowing their values to be changed.
Examples
This example stores values to array elements, protects the elements, then removes the protection so they can be changed:
1FUNCTION Start()
2 LOCAL aWriteProtect AS ARRAY
3 aWriteProtect := ArrayCreate(2)
4 ArrayPut(aWriteProtect, 1, "Origin")
5 ArrayPut(aWriteProtect, 2, "Origin")
6 ArrayProtect(aWriteProtect)
7
8 ArrayPut(aWriteProtect, 1, "Main Function")
9
10 TryChange(aWriteProtect)
11 ArrayDeprotect(aWriteProtect)
12
13 TryChange(aWriteProtect)
14FUNCTION TryChange(aPassed)
15 ArrayPut(aPassed, 1, "Sub Function")
See Also