示例#1
0
 String runString(CppiaCtx *ctx)
 {
    String val = strVal->runString(ctx);
    BCR_CHECK;
    int idx = a0->runInt(ctx);
    BCR_CHECK;
    return val.charAt(idx);
 }
示例#2
0
 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);
 }
示例#3
0
   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;
   }
示例#4
0
 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);
 }
示例#5
0
   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);
   }
示例#6
0
   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;
   }