Skip to content

Is it possible to pass variables to private functions? #695

Answered by lmorg
tiymat asked this question in Q&A
Discussion options

You must be logged in to vote

You can pass parameters the same as any command, eg

private pvtExample {
    $PARAMS
    out "second param is $2"
}

function example {
    pvtExample foo bar
}

running example there will return

[
    "foo",
    "bar"
]second param is bar

At the moment these are best documented on our dev website:

There is a pending ticket to bring named variables to privates too:
#429


Regarding named pipes, yeah they're fiddly as hell. I'm going to revisit them at some point soon and see what I can do to improve them.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by tiymat
Comment options

You must be logged in to vote
1 reply
@lmorg
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants