Compare commits

...

4 commits

Author SHA1 Message Date
Christian Hesse
0d71cd5b3b doc/mod/inspectvar: update screenshot...
... with fix from $CharacterMultiply and doubled indention.
2026-01-06 14:10:08 +01:00
Christian Hesse
33061fea21 mod/inspectvar: indent by two characters 2026-01-06 14:10:08 +01:00
Christian Hesse
0ceedab5db global-functions: $CharacterMultiply: return early on length zero...
... as :for loop counts backwards and would return two
character otherwise.
2026-01-06 14:10:08 +01:00
Christian Hesse
6990084d98 global-functions: $CharacterMultiply: use local variables for parameters 2026-01-06 14:10:08 +01:00
3 changed files with 10 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Before After
Before After

View file

@ -240,9 +240,16 @@
# multiply given character(s)
:set CharacterMultiply do={
:local Str [ :tostr $1 ];
:local Num [ :tonum $2 ];
:if ($Num = 0) do={
:return "";
}
:local Return "";
:for I from=1 to=$2 do={
:set Return ($Return . $1);
:for I from=1 to=$Num do={
:set Return ($Return . $Str);
}
:return $Return;
}

View file

@ -36,7 +36,7 @@
:global CharacterMultiply;
:return ([ $CharacterMultiply " " $Level ] . "-" . $Prefix . "-> " . $Value);
:return ([ $CharacterMultiply " " ($Level * 2) ] . "-" . $Prefix . "-> " . $Value);
}
:local TypeOf [ :typeof $Input ];