Syntax
isreadonly(target: table): booleanArguments
| Name | Type | Description |
|---|---|---|
target | table | Table whose readonly status is checked. |
Returns
| Name | Type | Description |
|---|---|---|
readOnly | boolean | true when the table is readonly; otherwise false. |
Description
Returns whether a table is readonly. The argument must be a table, and the function does not change it.
Call it with 1 parameter(s): target. The argument table explains which values are required and which ones only refine the behavior.
It returns readOnly (boolean). Use the returns table to separate successful values from nil results and recoverable errors.
Example
Read the readonly flag stored on a table.
local target = {}
print(isreadonly(target))
setreadonly(target, true)
print(isreadonly(target))
setreadonly(target, false)