Skip to content

Commit

Permalink
Merge pull request #41 from dehilsterlexis/VISUALTEXT-FILES-030
Browse files Browse the repository at this point in the history
VISUALTEXT-FILES-030 Added PadStr
  • Loading branch information
David de Hilster authored Jan 12, 2023
2 parents 43bc441 + bec9d07 commit c7542a8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions spec/KBFuncs.nlp
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,17 @@ SpacesStr(L("num")) {
return L("spaces");
}

PadStr(L("num str"),L("pad str"),L("pad len")) {
L("len") = strlength(L("num str"));
L("pad") = 0;
L("to pad") = L("pad len") - L("len");
while (L("i")++ < L("to pad")) {
L("pad") = L("pad") + L("pad str");
}
L("padded") = L("pad") + L("num str");
return L("padded");
}

###############################################
# DICTIONARY FUNCTIONS
###############################################
Expand Down

0 comments on commit c7542a8

Please sign in to comment.