20loopfrom_loopstep.mql 941 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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_', {%d,mqli}), {%d,mqli}, concat('mqli=', {%d,mqli}, ' mqlcount=', {%d,mqlcount}))
  13. /**
  14. onerror(continue)
  15. sleep(100ms)
  16. **/
  17. ;
  18. -- 验证步长结果
  19. select e_name, e_value from /test/aaa/test_ext where e_name=^'loopstep'
  20. /**
  21. output()
  22. **/
  23. ;
  24. -- 带 loopfrom 从 10 开始的循环
  25. /**
  26. scope(mql)
  27. loopfrom(10)
  28. loop(4)
  29. loopstep(5)
  30. **/
  31. ;
  32. insert into /test/aaa/test_ext (e_name, e_value) values (concat('loopfrom_', {%d,mqli}), {%d,mqli})
  33. /**
  34. onerror(continue)
  35. sleep(100ms)
  36. **/
  37. ;
  38. select e_name, e_value from /test/aaa/test_ext where e_name=^'loopfrom'
  39. /**
  40. output()
  41. **/
  42. ;