From 45b443ae81a813b04dcb497ccd6ee963ce048048 Mon Sep 17 00:00:00 2001 From: Dastgir Date: Thu, 4 Jun 2015 18:53:37 +0530 Subject: Implemented strcmp Function. --- doc/script_commands.txt | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 779589281..342934533 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -7809,7 +7809,7 @@ mes axtoi("11"); // Displays 17 (1 = 1, 10 = 16) --------------------------------------- -*compare(,) +*compare("","") This command returns 1 or 0 when the substring is in the main string (1) or not (0). This command is not case sensitive. @@ -7822,7 +7822,26 @@ Examples: //dothat; will not be executed ('Blood butterfly' does not contain 'Bloody'). if (compare("Blood Butterfly","Bloody")) dothat; + +--------------------------------------- + +*strcmp("","") + +This command compares two strings and is similar to strcmp in C. +Return Values: + >0 : String 1 > String 2 + 0 : Strings are equal + <0 : String 1 < String 2 + +Examples: + .@a = strcmp("abcdef","ABCDEF"); + if (.@a > 0){ + mes ".@a is greater than 0."; //Output is this. + }else{ + mes ".@a is less or equal to 0"; + } + --------------------------------------- *getstrlen("") -- cgit v1.2.3-60-g2f50