private
{ Private declarations }
FRow: Integer;
procedure SetRow(const Value: Integer); public
{ Public declarations }
property Row : Integer read FRow write SetRow default -1; // 属性
end; implementation {$R *.fmx} { Tfrm } procedure Tfrm.SetRow(const Value: Integer);
begin
if(Value<>FRow) then begin
FRow:=Value;
G1.SelectRow(Value);
Timer1.Interval:=G1.Cells[3,Value].ToInteger();
end;
end; procedure Tfrm.Timer1Timer(Sender: TObject);
var
n, i, j: Integer;
begin
n := FRow + 1; // 当前行位置
j := 0; // IP相同的个数
if n < G1.RowCount - 1 then // 防止超界
begin
for i := 0 to G1.RowCount - 1 do
begin
if i + 1 < G1.RowCount - 1 then
if (G1.Cells[0, FRow] = G1.Cells[0, FRow + i]) then // 判断相邻行IP的相同个数 若相同则相加否则退出循环
Inc(j)
else break;
end;
if j <> 0 then n := FRow + j;
end;
if (n >= G1.RowCount - 1) then
n := 0;
Row := n;
end;

最新文章

  1. 个人博客 week1
  2. 条款9:不要在构造和析构过程中调用virtual函数
  3. samba linux windows 请联系管理员
  4. RBAC(Role-Based Access Control)基于角色的访问控制
  5. postman接口测试工具3.0版本的坑
  6. centos/linux 禁止root用户远程登录
  7. linux shell通配符及if语句判断
  8. Spring ES
  9. java基础3之IO
  10. 框架-thrift-zookeeper-kafka
  11. Web jsp开发学习——网上直播聊天室的简单开发
  12. python中pass语句的作用是什么
  13. Python UDP实例
  14. 深入理解Linux内核-定时测量
  15. WCF中的异常
  16. pythone 请求响应字典
  17. Guava包学习--Table
  18. 【转】使用Jmeter录制web脚本
  19. Spring之BeanFactory与ApplicationConText
  20. 使用Gulp压缩IMG

热门文章

  1. mysql函数之六:mysql插入数据后返回自增ID的方法,last_insert_id(),selectkey
  2. Jenkins设置自动发邮件
  3. Vue源码学习(一):调试环境搭建
  4. Angular2快速入门-2.创建一个新闻列表
  5. Android的按钮单击事件及监听器的实现方式
  6. mysql整数类型
  7. Py修行路 python基础 (五)三元运算 字符编码 元组 集合 三级菜单优化!
  8. java常见的几种调用机制(同步调用,异步调用,回调)
  9. python学习——练习题(3)
  10. 12个有趣的c语言面试题&amp;nbsp;