代码之家  ›  专栏  ›  技术社区  ›  bman

迁移到Delphi 2009-类型转换错误无效

  •  2
  • bman  · 技术社区  · 15 年前

    我正在将GraphicEx项目转换为Delphi 2009。

    我在单位转换以下程序时遇到问题 Scanf_c.pas

      With TscRec(FType) do begin
    

    FType是一个整数,定义了TscRec:

      TscRec = packed record  // Has size of an integer
          Case byte of
            0: ( Typ : byte; Size : char; Flags : word;);
            1: ( SizeType : word; iFlags : smallInt;);
          end;
    

    这里是否有人对Delphi 2009有相同的问题并有解决方案。

    1 回复  |  直到 11 年前
        1
  •  12
  •   skamradt    15 年前

    “char”现在是一个2字节的数据类型。如果将声明更改为“ansichar”,会发生什么情况?(这相当于德尔福<=2007中的“char”)。