sinnigere anzeige durchreiseregionen,

funktion $strlen
This commit is contained in:
Enno Rehling 2001-05-20 07:55:07 +00:00
parent 486333e3bf
commit d91c4e7831
2 changed files with 10 additions and 1 deletions

View File

@ -400,6 +400,14 @@ eval_if(opstack ** stack, const void * userdata) /* (int, int) -> int */
unused(userdata); unused(userdata);
} }
static void
eval_strlen(opstack ** stack, const void * userdata) /* string -> int */
{
const char * c = opop(stack, const char *);
opush(stack, c?strlen(c):0);
unused(userdata);
}
#include "base36.h" #include "base36.h"
static void static void
eval_int(opstack ** stack, const void * userdata) eval_int(opstack ** stack, const void * userdata)
@ -436,6 +444,7 @@ translation_init(void)
add_function("eq", &eval_eq); add_function("eq", &eval_eq);
add_function("int", &eval_int); add_function("int", &eval_int);
add_function("add", &eval_add); add_function("add", &eval_add);
add_function("strlen", &eval_strlen);
add_function("if", &eval_if); add_function("if", &eval_if);
add_function("localize", &eval_localize); add_function("localize", &eval_localize);
add_function("locale", &eval_locale); add_function("locale", &eval_locale);

View File

@ -4936,7 +4936,7 @@
</type> </type>
<locale name="de"> <locale name="de">
<nr section="movement"> <nr section="movement">
<text>"$unit($unit) $int($mode) von $region($start) nach $region($end).$regions"</text> <text>"$unit($unit) $int($mode) von $region($start) nach $region($end).$if($strlen($regions)," Dabei wurde $regions durchquert.","")"</text>
</nr> </nr>
</locale> </locale>
</message> </message>