published
    peocedure methodName index ??; //这里的索引号怎么定义
    property Left: Longint index 0 read GetCoordinate write SetCoordinate;
    property Top: Longint index 1 read GetCoordinate write SetCoordinate;
    property Right: Longint index 2 read GetCoordinate write SetCoordinate;
    property Bottom: Longint index 3 read GetCoordinate write SetCoordinate;

解决方案 »

  1.   

    你还是说你到底要干嘛吧,恐怕property的index就不是你以为的那个样子导出表可以定义index,但很显然不可能是你需要的,而且甚至你应该都不知道导出表的index是干嘛用的
      

  2.   

      我就是要定义一个索引号! 然后通过RTTI取出来!
      

  3.   

    果然没说错,property的index也不是干这个用的,你用你的“索引号”没法在rtti中确定property
    你还是先了解一下rtti都能干嘛吧,不要想当然
      

  4.   

     //请问一下前辈下面的结构 index 不是取出他索引号吗?
     PPropInfo = ^TPropInfo;
      TPropInfo = packed record
        PropType: PPTypeInfo;
        GetProc: Pointer;
        SetProc: Pointer;
        StoredProc: Pointer;
        Index: Integer;
        Default: Longint;
        NameIndex: SmallInt;
        Name: ShortString;
      end;
      

  5.   

    找到property后是可以取出index的值,但是你没法通过index得到property啊
    index又不是专门给rtti用的,只不过rtti中需要提供它的信息而已
      

  6.   

    找到property后是可以取出index的值,但是你没法通过index得到property啊 
    index又不是专门给rtti用的,只不过rtti中需要提供它的信息而已 
    =======================================================
    其实我并不是想通过index 得到property, 而是想自己定义一些值给他, 然后取出这些值做其它使用。
    看了一下RTTI 取出这些索引值好像直支持 property 定义的, 如果支持 procedure 或则 function 
    就好了
      

  7.   

    都告诉你了index有自己的用处,你可以尝试自己定义一些值给它,然后看能不能通过编译
      

  8.   

    property Color: TColor index 0 read FColor write SetColors;
    这是属性的
    方法定义索引?
    这不肯能吧?
    不知道楼主的意义为何,这样做。
      

  9.   

    方法不能定义索引。说白了其实是RTTI的功能限制,完成不了楼主对方法反射的需求。COM的那种接口方法倒是有个dispid -_-