test-loopvar.txt

来自「一一个纯JAVA的解析工具,可以做所有可以的事情,而且对本站有非常大的帮助」· 文本 代码 · 共 31 行

TXT
31
字号
<#setting locale="en_US">
---
<#macro myLoop from to>
  <#list from..to as x>
  - <#nested x></#list>*
</#macro>
<#list 2..1 as i>
  ${i}
  <@myLoop from=1 to=3; i>
    L1 ${i}
    <@myLoop from=1 to=2; i>
      L2 ${i}: <#list 1..3 as i>${i}; </#list>
    </@>
  </@>
</#list>
---
<#macro repeat count>
  <#list 1..count as x>
    <#nested x, x/2, x==count>
  </#list>
</#macro>
<#macro test2>
<#local c = 123>
<@repeat count=4 ; c, halfc, last>
  <#local c = .locals.c + 0.1>
  ${c} ${halfc}<#if last> Last!</#if>
</@repeat>
${c}
</#macro>
<@test2/>
---

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?