String runString(CppiaCtx *ctx) { String val = strVal->runString(ctx); BCR_CHECK; int idx = a0->runInt(ctx); BCR_CHECK; return val.charAt(idx); }
int runInt(CppiaCtx *ctx) { //printf("Char code at %d INT\n", CODE); String val = strVal->runString(ctx); BCR_CHECK; int idx = a0->runInt(ctx); BCR_CHECK; return val.charCodeAt(idx); }
hx::Object *runObject(CppiaCtx *ctx) { String val = strVal->runString(ctx); BCR_CHECK; int idx = a0->runInt(ctx); BCR_CHECK; if (CODE) return val.charCodeAt(idx).mPtr; else return Dynamic(val.charAt(idx)).mPtr; }
String runString(CppiaCtx *ctx) { String val = strVal->runString(ctx); BCR_CHECK; int start = a0->runInt(ctx); BCR_CHECK; Dynamic end = a1->runObject(ctx); BCR_CHECK; if (SUBSTR) return val.substr(start,end); else return val.substring(start,end); }
int runInt(CppiaCtx *ctx) { //printf("Char code at %d INT\n", CODE); String val = strVal->runString(ctx); BCR_CHECK; int idx = a0->runInt(ctx); BCR_CHECK; if (AS_INT) return (int)( ((unsigned char *)val.__s) [idx]); else return val.charCodeAt(idx); }
hx::Object *runObject(CppiaCtx *ctx) { String val = strVal->runString(ctx); BCR_CHECK; int idx = a0->runInt(ctx); BCR_CHECK; if (CODE) { if (AS_INT) return Dynamic( (int)( ((unsigned char *)val.__s) [idx]) ).mPtr; else return val.charCodeAt(idx).mPtr; } else return Dynamic(val.charAt(idx)).mPtr; }