(This is not explicitly described, but just assumed by me. So it also could be a wish...)
Info: in the following text " 0" always is meant to contain 2 blancs in front of the "0"!!!
(Don't want to write all text in a code-box...)
format($i, "000") formats $i as 3 bytes with leading zeros.
I think format($i, " 0") should format to 3 characters with leading " "? But it just prefixes $i with double " ".
For demonstration a little script - just paste it to "Try Script".
It shows 2 chapters with " 0", but bad formatting,
and a 3rd chapter with "000", well formatted, but with leading zeros.
All 3 looking bad, I think.
Code: Select all
$t = "";
$i = 7;
While ($i < 11) { $i++;
$t = "$t<crlf>".Format($i, " 0")." => Some text...";
}
$t = "$t<crlf>...";
$i = 97;
While ($i < 101) { $i++;
$t = "$t<crlf>".Format($i, " 0")." => Some text...";
}
$t = "$t<crlf>...";
$i = 7;
While ($i < 11) { $i++;
$t = "$t<crlf>".Format($i, "000")." => Some text...";
}
$t = "$t<crlf>...";
$i = 7;
While ($i < 11) { $i++;
$t = "$t<crlf>".Substr(" $i", -3)." => Some text...";
}
Text $t;
By the way, is there a way to stop a looping script, e.g. such a While-loop as above, with forgotten $i++? ESC didn't help, I had to close XY...
(And it seems I love to forget such things
XYplorer Beta Club