Volt

makereadonly

Makes a table read-only.

Syntax

makereadonly(table: table) -> void

Parameters

ParameterTypeDescription
tabletableThe table to make read-only

Returns

This function does not return a value.

Description

makereadonly sets a table's read-only flag to true, preventing modifications.

Example

local myTable = {value = 123}

makereadonly(myTable)

-- This will error
myTable.value = 456 -- Cannot modify read-only table

Notes

  • Equivalent to setreadonly(table, true)
  • Use makewritable to reverse

On this page