command cleanup

changed commands:

  strstr haystack needle

    now returns position of needle in haystack (counting from 1)
    or zero, if not found

  substr string start len

    now counts negative length from total length
    "substr text 1 -2" now returns the text without first and last char

  strreplace text search replace

    no longer restricted to 260 char stringlengths

removed commands:

  swapelements, strpos (can be scripted, if required)

DOCREF strstr substr
DOCREF swapelements strpos
This commit is contained in:
ac-stef
2017-06-07 23:20:00 +02:00
parent ffee440fa0
commit 83d0199867
8 changed files with 207 additions and 307 deletions
-2
View File
@@ -128,8 +128,6 @@ void conoutf(const char *s, ...)
delete[] conline; conline=newstring(sf);
}
COMMANDF(strstr, "ss", (char *a, char *b) { intret(strstr(a, b) ? 1 : 0); });
int rendercommand(int x, int y, int w)
{
const char *useprompt = cmdprompt ? cmdprompt : "#";