在看俄罗斯方块的游戏原码时,在每个形状类(比如:条形,方形等等)的DRAW方法中都有这个:FillChar(FG, 200, #0) 请各位大虾详细说明其用途,各参数类型,越详细越好,谢谢!

解决方案 »

  1.   

    Fills contiguous bytes with a specified value.UnitSystemCategorycharacter manipulation routinesDelphi syntax:procedure FillChar(var X; Count: Integer; Value: Byte);DescriptionIn Delphi, FillChar fills Count contiguous bytes (referenced by X) with the value specified by Value (Value can be type Byte or Char).Warning: This function does not perform any range checking.
      

  2.   

    用处就是可以对数组进行位清空,和FillMemory()、ZeroMemory()差不多。
      

  3.   

    procedure FillChar(var X; Count: Integer; Value: Byte);
    向一个变量或数组 X 填充连续的 Count 个字节,值为 Value(Byte 或 Char 类型),不做任何越界检查。例:
    var
      S: array[0..79] of char;
    begin
      { 全部填充空格,Ord(' ')取空格的ASCII码 }
      FillChar(S, SizeOf(S), Ord(' '));
    end;
      

  4.   

    已经很详细了阿
     hanlin2004(渴死的鱼)把borland的帮助也贴出来了啊
    呵呵
    我只说一句
    Warning: This function does not perform any range checking.就是fillchar不做边界检查哦