helloworldmacro.vm

来自「《基于Eclipse的开源框架技术与实战》[第11章]随书源码」· VM 代码 · 共 19 行

VM
19
字号
##定义宏
#macro( tablerows $color $somelist )
  #foreach( $something in $somelist )
      <tr><td bgcolor=$color>$something</td></tr>
  #end
#end

##调用宏
#set( $greatlakes = ["Superior","Michigan","Huron","Erie","Ontario"] )
#set( $color = "blue" )
<table>
    #tablerows( $color $greatlakes )
</table>

##使用属性和方法
Day: $aDate.date
Month: $aDate.getMonth()
Year: $aDate.getYear()

⌨️ 快捷键说明

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