ArrayDeProtect Function (Array) |
Namespace: XSharp.RT
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 // Write allowed in calling function 8 ArrayPut(aWriteProtect, 1, "Main Function") 9 // Write not allowed in called function 10 TryChange(aWriteProtect) 11 ArrayDeprotect(aWriteProtect) 12 // Write allowed (no protection) 13 TryChange(aWriteProtect) 14FUNCTION TryChange(aPassed) 15 ArrayPut(aPassed, 1, "Sub Function")