zoukankan      html  css  js  c++  java
  • Slice 函数

    Slice 函数

    function Slice(var A: array; Count: Integer): array;
    Slice函数把数组 A的前面Count个元素作为开放数组返回, 利用它可以方便的使用动态分配的
    静态数组而且保持Delphi的数组的使用优点..
    例子:
    type
      TPolygon = record
        NumPoint: 0..MaxInt;
        Points  : array[1..MAX_POINTS] of TPoint;
      end;
    
    procedure DrawPolygon(Canvas: TCanvas; const Polygon: TPolygon);
    begin
      Canvas.Polygon(Slice(Polygon.Points, Polygon.NumPoint));
    end;
    
    
    
    
    Returns a sub-section of an array.
    Unit
    System
    Category
    miscellaneous routines
    function Slice(var A: array; Count: Integer): array;
    Description
    Use Slice to select a sub-section (slice) of an array to be passed as an open array parameter. Slice is only allowed as a parameter in a call to a procedure or function that expects an open array parameter. Slice selects the first Count elements of the array given by A to be passed as an open array parameter. A can be an open array parameter itself, allowing dynamically allocated arrays to be passed to open array parameters.
  • 相关阅读:
    JS 随机整数
    微信小程序 功能函数 支付接口
    JS 正则表达式
    JS 日期 自动补齐 “2017-11-22 14:43”
    schema get_ddl
    StringBuffer 清空
    java中split任意数量的空白字符
    美国法官工资
    纪检委,检察院的工资
    国家司法机构
  • 原文地址:https://www.cnblogs.com/moonwind/p/4432458.html
Copyright © 2011-2022 走看看