The example below replaces field names delimited between { and } with the field content. E.g:
“This is a field with another field {name} inside”
The replaces “name” with the contents of field called “name”.
-- Searches a field called "name" for fields delimited -- between { and } and replaces them with field content str = field(name) while str:match("{(.-)}") do word=str:match("{(.-)}") str = string.gsub(str, "{" .. word .. "}", field(word)); end return str
The post Replacing Delimited Field Names With Field Content appeared first on 65bit Software.