|
<< Click to Display Table of Contents >> Navigation: »No topics above this level« String Operations |
MiniRobotLanguage (MRL)
BLO.Code
Extract the Nth markdown code fence, optionally including language.
Intention
Parse code fences delimited by triple backticks and return one selected block by index.
Language identifier can be returned to an optional variable.
Syntax
BLO.Code|P1|P2|P3[|P4]
BLO.BCD|P1|P2|P3[|P4]
Parameter Explanation
-P1 - Source text containing code fences.
-P2 - Block index N (1-based).
-P3 - Result variable for code content.
-P4 - Optional language result variable.
Example
$$SRC=AA```pb$crlf$PRINT 1$crlf$```BB```txt$crlf$hello$crlf$```
BLO.Code|$$SRC|1|$$CODE|$$LANG
' $$LANG = pb
' $$CODE = PRINT 1
ENR.
Remarks
-Out-of-range index returns empty result.
-Extracted code is trimmed for surrounding whitespace and CR/LF.
See also: