• System中记录体函数命名怪异


    //1019unit System; 中发现记录体函数命名怪异
    //乍一看,很怪异,其实是结构体里面 的变量后面直接写 函数类型了。不像传统先定义
    T***Event      = procedure(Sender: TObject;LbName : string)of object;
    再使用
    VarClear := T***Event;
    PVariantManager = ^TVariantManager;
      TVariantManager = record
        VarClear: procedure(var V : Variant); 
        VarCopy: procedure(var Dest: Variant; const Source: Variant);
        VarCopyNoInd: procedure; // ARGS PLEASE!
        VarCast: procedure(var Dest: Variant; const Source: Variant; VarType: Integer);
        VarCastOle: procedure(var Dest: Variant; const Source: Variant; VarType: Integer);
    
        VarToInt: function(const V: Variant): Integer;
        VarToInt64: function(const V: Variant): Int64;
        VarToBool: function(const V: Variant): Boolean;
        VarToReal: function(const V: Variant): Extended;
        VarToCurr: function(const V: Variant): Currency;
        VarToPStr: procedure(var S; const V: Variant);
        VarToLStr: procedure(var S: string; const V: Variant);
        VarToWStr: procedure(var S: WideString; const V: Variant);
        VarToIntf: procedure(var Unknown: IInterface; const V: Variant);
        VarToDisp: procedure(var Dispatch: IDispatch; const V: Variant);
        VarToDynArray: procedure(var DynArray: Pointer; const V: Variant; TypeInfo: Pointer);
    
        VarFromInt: procedure(var V: Variant; const Value: Integer; const Range: ShortInt);
        VarFromInt64: procedure(var V: Variant; const Value: Int64);
        VarFromBool: procedure(var V: Variant; const Value: Boolean);
        VarFromReal: procedure; // var V: Variant; const Value: Real
        VarFromTDateTime: procedure; // var V: Variant; const Value: TDateTime
        VarFromCurr: procedure; // var V: Variant; const Value: Currency
        VarFromPStr: procedure(var V: Variant; const Value: ShortString);
        VarFromLStr: procedure(var V: Variant; const Value: string);
        VarFromWStr: procedure(var V: Variant; const Value: WideString);
        VarFromIntf: procedure(var V: Variant; const Value: IInterface);
        VarFromDisp: procedure(var V: Variant; const Value: IDispatch);
        VarFromDynArray: procedure(var V: Variant; const DynArray: Pointer; TypeInfo: Pointer);
        OleVarFromPStr: procedure(var V: OleVariant; const Value: ShortString);
        OleVarFromLStr: procedure(var V: OleVariant; const Value: string);
        OleVarFromVar: procedure(var V: OleVariant; const Value: Variant);
        OleVarFromInt: procedure(var V: OleVariant; const Value: Integer; const Range: ShortInt);
        OleVarFromInt64: procedure(var V: OleVariant; const Value: Int64);
    
        VarOp: procedure(var Left: Variant; const Right: Variant; OpCode: TVarOp);
        VarCmp: procedure(const Left, Right: TVarData; const OpCode: TVarOp); { result is set in the flags }
        VarNeg: procedure(var V: Variant);
        VarNot: procedure(var V: Variant);
    
        DispInvoke: procedure(Dest: PVarData; const Source: TVarData;
          CallDesc: PCallDesc; Params: Pointer); cdecl;
        VarAddRef: procedure(var V: Variant);
    
        VarArrayRedim: procedure(var A : Variant; HighBound: Integer);
        VarArrayGet: function(var A: Variant; IndexCount: Integer;
          Indices: Integer): Variant; cdecl;
        VarArrayPut: procedure(var A: Variant; const Value: Variant;
          IndexCount: Integer; Indices: Integer); cdecl;
    
        WriteVariant: function(var T: Text; const V: Variant; Width: Integer): Pointer;
        Write0Variant: function(var T: Text; const V: Variant): Pointer;
      end deprecated;
      //--------
        PUnwinder = ^TUnwinder;
      TUnwinder = record
        RaiseException: function(Exc: Pointer): LongBool; cdecl;
        RegisterIPLookup: function(fn: Pointer; StartAddr, EndAddr: LongInt; Context: Pointer; GOT: LongInt): LongBool; cdecl;
        UnregisterIPLookup: procedure(StartAddr: LongInt) cdecl;
        DelphiLookup: function(Addr: LongInt; Context: Pointer): Pointer; cdecl;
        ClosestHandler: function(Context: Pointer): LongWord; cdecl;
      end;
      
      //----------
      {$IFDEF DEBUG}
    {
      This variable is just for debugging the exception handling system.  See
      _DbgExcNotify for the usage.
    }
    var
      ExcNotificationProc : procedure(NotificationKind: Integer;
                                      ExceptionObject: Pointer;
                                      ExceptionName: PShortString;
                                      ExceptionLocation: Pointer;
                                      HandlerAddr: Pointer) = nil; //还可以赋值为nil
    {$ENDIF DEBUG}
    
    TVariantManager怎么使作啊
    这个类型怎么使用,给个例子
    
    ------解决方案--------------------
    这个类用户通常不直接使用,当你使用Variant变量的时候,编译器就会根据这个类来调用相应的处理
  • 相关阅读:
    window.location 对象所包含的属性
    控制器如何获取一条url中存在多个Id
    js 生成GUID
    JS控制前端控件的显示与隐藏
    ASP.NET CORE根据后台数值在razor页面进行判断单选按钮选中
    Selectize 控件使用以及js执行文件的时间差问题
    理解css中的position属性
    本地预览的vue项目,在githubpage静态展示
    关于img底部空白
    [优化]Steamroller-freecodecamp算法题目
  • 原文地址:https://www.cnblogs.com/rogge7/p/5976414.html
Copyright © 2020-2023  润新知