2017-09-30
1 Variables(静态变量)
1.1 定义及使用
1.2 Variable作用域
1.2.1 Variable在层次结构中的作用域
1.2.2 include对Variable作用域的影响
2 表中的Symbol(动态变量)
2.1 定义及使用
2.2 Symbol的作用域
3 Variable和Symbol的区别
1 Variables(静态变量)
1.1 定义及使用
Variables初始化有三种方式:
- !define VariableName {VariableValue} - 把大括号内的文本赋值给变量
- !define VariableName ${OtherVariableName} - 把另一个变量赋值给变量
- !define VariableName {${= 10 / 2 =}} - 通过表达式赋值给变量
Variables使用:
${VariableName}
示例1
页面脚本如下:
!define markedUp {This is '''bold'''}
${markedUp} is expressed as: This is bold
!define y {y-value}
!define x {The value of y is ${y}}
${x} is expressed as: The value of y is y-value
!define n {10}
!define q {2}
!define d {${=${n}/${q}=}}
${d} is : 5
!define q {5}
${d} is : 2