Class DynamicVirtualStringValue

An implementation of DynamicVirtualValue which stores a string.

Stack modes

  • Concat: Returns lhs .. rhs, default base value is "" (empty string)
  • ConcatReverse: Returns rhs .. lhs, default base value is "" (empty string)

Usage

local dvnv = DynamicVirtualStringValue.new("Concat")
dvnv:newChild("Hello")
dvnv:newChild("World")
dvnv:newChild("Spam")
print(dvnv:get()) --> "Hello" .. "World" .. "Spam" => "HelloWorldSpam"
local dvnv2 = DynamicVirtualNumberValue.new("ConcatReverse", "Foo")
dvnv2:newChild("Bar")
print(dvnv2:get()) --> "Bar" .. "Foo" => "BarFoo"
dvnv:addChild(dvnv2)
print(dvnv:get()) --> "Hello" .. "World" .. "Spam" .. ("Bar" .. "Foo") => "HelloWorldSpamBarFoo"

See also:



generated by LDoc 1.4.6 Last updated 2021-01-21 07:22:00