Skip to content

Commit f31a046

Browse files
Merge branch 'main' into main
2 parents da08f7f + defebd1 commit f31a046

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

streamerbot/2.guide/3.variables.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,25 @@ $length(Lorem ipsum dolor sit amet consectetur adipisicing elit. Commodi, ut.)$
173173
$length(%rawInput%)$
174174
```
175175

176+
### `parse()`
177+
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.
178+
179+
```cs [Example]
180+
// Same results as %user%
181+
$parse(user)$
182+
183+
// First, Set Argument %i% to 1
184+
$parse(line%i%)$
185+
// ==> returns value of %line1% (the first line of the file)
186+
187+
// Set Argument %i% to $math(%i%+1)$ (i.e., 2)
188+
$parse(line%i%)$
189+
// ==> returns value of %line2% (the second line of the file)
190+
```
191+
::tip
192+
`%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.
193+
::
194+
176195
## Variable Viewer
177196
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.
178197

0 commit comments

Comments
 (0)