Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions streamerbot/2.guide/3.variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Loading