Skip to content

Functions

Rajesh Gautam edited this page Jun 12, 2026 · 1 revision

Functions

Defining a Function

Use createFunc{name}- to open and --\ to close:

createFunc{greet}-
    pcType{"Hello from Curl!"}\
--\

Calling a Function

func{greet}\

Example

var{name, "Ritvik"}\

createFunc{sayHello}-
    pcType{"Hello, " + var{name} + "!"}\
--\

func{sayHello}\

Calling Multiple Times

func{sayHello}\
func{sayHello}\
func{sayHello}\

Calling Functions from Functions

createFunc{inner}-
    pcType{"inner called"}\
--\

createFunc{outer}-
    pcType{"outer called"}\
    func{inner}\
--\

func{outer}\

Clone this wiki locally