Added REPEAT\$ Function
This commit is contained in:
parent
e08e4035cc
commit
20e4c9aa6c
@ -33,7 +33,7 @@ ENDSELECT
|
||||
ENDSUB
|
||||
ENUM
|
||||
EXIT
|
||||
FALSE
|
||||
FALSE \nREGEX
|
||||
FOR
|
||||
FORMAT$
|
||||
FUNCTION
|
||||
@ -57,12 +57,11 @@ NEXT
|
||||
NL
|
||||
NOT
|
||||
OR
|
||||
PRINT
|
||||
PRINTNL
|
||||
PTR
|
||||
REGEX
|
||||
REGMATCH
|
||||
REGQUERY
|
||||
REPEAT$\nSPLIT \nPRINT
|
||||
REPLACE$
|
||||
RETURN
|
||||
REVERSE$
|
||||
@ -71,7 +70,6 @@ RTRIM$
|
||||
SAVEFILE
|
||||
SELECT
|
||||
SHORT
|
||||
SPLIT
|
||||
SPLITPATH$
|
||||
STEP
|
||||
STR$
|
||||
|
@ -8,14 +8,13 @@ LOADFILE$ (CSTRING N)
|
||||
LTRIM$ (CSTRING s)
|
||||
MCASE$ (CSTRING S)
|
||||
MID$ (CSTRING s, INT start, INT length)
|
||||
PRINT (CSTRING A="")
|
||||
REGEX (CSTRING src, CSTRING query)
|
||||
REPEAT$ (const std::string &str, unsigned int times)\nSPLIT (CONSTANT CSTRING input, CONSTANT CSTRING separators, BOOL remove_empty)\nPRINT (CSTRING A="")
|
||||
REPLACE$ (CSTRING subject, CONSTANT CSTRING& search, CONSTANT CSTRING& replace)
|
||||
REVERSE$ (CSTRING src)
|
||||
RIGHT$ (CSTRING s, INT length)
|
||||
RTRIM$ (CSTRING s)
|
||||
SAVEFILE (CSTRING src, CSTRING fname)
|
||||
SPLIT (CONSTANT CSTRING input, CONSTANT CSTRING separators, BOOL remove_empty)
|
||||
SPLITPATH$ (CSTRING FPATH, INT mask)
|
||||
TRIM$ (CSTRING s)
|
||||
UCASE$ (CSTRING str)
|
||||
|
11
runtime.inc
11
runtime.inc
@ -19,6 +19,7 @@ DECLARE FUNCTION VECTOR<CSTRING> SPLIT (CONSTANT CSTRING input, CONSTANT CSTRING
|
||||
DECLARE SUB PRINT (CSTRING);
|
||||
DECLARE SUB SAVEFILE(CSTRING src, CSTRING fname);
|
||||
DECLARE FUNCTION CSTRING REGEX (CSTRING src, CSTRING query);
|
||||
DECLARE FUNCTION CSTRING REPEAT$ (const std::string &str, unsigned int times);
|
||||
|
||||
FUNCTION CSTRING REGEX (CSTRING src, CSTRING query) {
|
||||
CSTRING result;
|
||||
@ -264,3 +265,13 @@ FUNCTION CSTRING GRAB$(CONSTANT CSTRING &src, CONSTANT CSTRING &start, CONSTANT
|
||||
|
||||
return src.substr(end, (term - end));
|
||||
}
|
||||
|
||||
FUNCTION CSTRING REPEAT$ (const std::string &str, unsigned int times) {
|
||||
std::stringstream ss;
|
||||
|
||||
for(unsigned int i=0; i<times; ++i) {
|
||||
ss << str;
|
||||
}
|
||||
|
||||
return ss.str();
|
||||
}
|
Loading…
Reference in New Issue
Block a user