20loopfrom_loopstep.mql 893 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. -- ============================================================
  2. -- loopfrom(N) loopstep(N) 控制循环步长测试
  3. -- ============================================================
  4. /**
  5. scope(mql)
  6. loopfrom(0)
  7. loop(5)
  8. loopstep(2)
  9. **/
  10. ;
  11. -- 循环从 0 开始,步长为 2(取值:0, 2, 4)
  12. insert into /test/aaa/test_ext (e_name, e_value, e_text) values (concat('loopstep_', <mqli>), {%d,mqli}, concat('mqli=', <mqli>, ' mqlcount=', <mqlcount>))
  13. /**
  14. sleep(100ms)
  15. **/
  16. ;
  17. -- 验证步长结果
  18. select e_name, e_value from /test/aaa/test_ext where e_name=^'loopstep'
  19. /**
  20. output()
  21. **/
  22. ;
  23. -- 带 loopfrom 从 10 开始的循环
  24. /**
  25. scope(mql)
  26. loopfrom(10)
  27. loop(4)
  28. loopstep(5)
  29. **/
  30. ;
  31. insert into /test/aaa/test_ext (e_name, e_value) values (concat('loopfrom_', <mqli>), {%d,mqli})
  32. /**
  33. sleep(100ms)
  34. **/
  35. ;
  36. select e_name, e_value from /test/aaa/test_ext where e_name=^'loopfrom'
  37. /**
  38. output()
  39. **/
  40. ;