diff --git a/streamerbot/2.guide/3.variables.md b/streamerbot/2.guide/3.variables.md index 7a502584..d48c544c 100644 --- a/streamerbot/2.guide/3.variables.md +++ b/streamerbot/2.guide/3.variables.md @@ -173,6 +173,25 @@ $length(Lorem ipsum dolor sit amet consectetur adipisicing elit. Commodi, ut.)$ $length(%rawInput%)$ ``` +### `parse()` +Fetches the value of the argument named by `parse`'s parameter, which itself can be the result of parsing variables. In other words, it lets you "double parse" a value. This is often useful in a [While](/api/sub-actions/core/logic/while) loop to access an array of numbered arguments with an index variable. + +```cs [Example] +// Same results as %user% +$parse(user)$ + +// First, Set Argument %i% to 1 +$parse(line%i%)$ +// ==> returns value of %line1% (the first line of the file) + +// Set Argument %i% to $math(%i%+1)$ (i.e., 2) +$parse(line%i%)$ +// ==> returns value of %line2% (the second line of the file) +``` +::tip +`%arguments%` and `~persistedVariables~` will be parsed in `parse`'s parameter, but not other `$inline()$` functions. If you wish to use a function, then set another argument to the output of the function, and use that argument in the `parse` instead. +:: + ## Variable Viewer The Variable Viewer in Streamer.bot provides a convenient location to **view, modify, and create** all types of global variables, including per-platform user variables.