XLQP Gen1
ElementsContent & layout

AddCode

Adds a formatted source-code or response block.

AddCode

What it does

Adds a formatted source-code or response block.

When to use it

Use it to display scripts, commands, generated output, or language-labeled examples in the UI.

ElementFunction:AddCode(Text, Content)

RightGroup:AddCode({
    Name = "Quick code",
    Language = "lua",
    Content = "print(game.PlaceId)"
})

Behavior and return value

Call this method on the compatible section, tab, panel, or element container shown by the signature. Store the returned value when you need to update, read, or destroy the element later.

Fields marked optional may be omitted. XLQP then uses the method’s built-in default or leaves that feature disabled.