r52
r1
1[[분류:테스트]][[분류:나무마크 문법]]
2[[../|상위 문서]]
r3
3[[../include 결과|결과 보기]]
r1
4== 변수 a=1 ==
r35
5 * 기본형식 : a==1
r34
6{{{#!wiki style="word-break: keep-all;"
r28
7||<table bgcolor=transparent,transparent> 구분 || a= || +a= || -a= || 'a'= || "a"= || \[a\]= [* if 조건문을 \[a\]==1 식으로 걸어놓음.] || \[a=\][* if 조건문을 \[a==1\] 식으로 걸어놓음.] || calc(a)= || calc(+a)= || calc[a]= || calc[+a]= || calc['a']= || @@_@a@= ||
8|| ==1[* 단, -a= 열에는 if 조건문을 -a==-1 으로 걸어놓음.] || {{{#!if a==1
9출력}}} || {{{#!if +a==1
10출력}}} || {{{#!if -a==-1
11출력}}} || {{{#!if 'a'==1
12출력}}} || {{{#!if "a"==1
13출력}}} || {{{#!if [a]==1
14출력}}} || {{{#!if [a==1]
15출력}}} || {{{#!if calc(a)==1
16출력}}} || {{{#!if calc(+a)==1
17출력}}} || {{{#!if calc[a]==1
18출력}}} || {{{#!if calc[+a]==1
19출력}}} || {{{#!if calc['a']==1
20출력}}} || {{{#!if @a@==1
21출력}}} ||
22|| =='1' || {{{#!if a=='1'
23출력}}} || {{{#!if +a=='1'
24출력}}} || {{{#!if -a=='1'
25출력}}} || {{{#!if 'a'=='1'
26출력}}} || {{{#!if "a"=='1'
27출력}}} || {{{#!if [a]=='1'
28출력}}} || {{{#!if [a=='1']
29출력}}} || {{{#!if calc(a)=='1'
30출력}}} || {{{#!if calc(+a)=='1'
31출력}}} || {{{#!if calc[a]=='1'
32출력}}} || {{{#!if calc[+a]=='1'
33출력}}} || {{{#!if calc['a']=='1'
34출력}}} || {{{#!if @a@=='1'
35출력}}} ||
36|| =="1" || {{{#!if a=="1"
37출력}}} || {{{#!if +a=="1"
38출력}}} || {{{#!if -a=="1"
39출력}}} || {{{#!if 'a'=="1"
40출력}}} || {{{#!if "a"=="1"
41출력}}} || {{{#!if [a]=="1"
42출력}}} || {{{#!if [a=="1"]
43출력}}} || {{{#!if calc(a)=="1"
44출력}}} || {{{#!if calc(+a)=="1"
45출력}}} || {{{#!if calc[a]=="1"
46출력}}} || {{{#!if calc[+a]=="1"
47출력}}} || {{{#!if calc['a']=="1"
48출력}}} || {{{#!if @a@=="1"
49출력}}} ||
50|| ==\\1 || {{{#!if a==\1
51출력}}} || {{{#!if +a==\1
52출력}}} || {{{#!if -a==\1
53출력}}} || {{{#!if 'a'==\1
54출력}}} || {{{#!if "a"==\1
55출력}}} || {{{#!if [a]==\1
56출력}}} || {{{#!if [a==\1]
57출력}}} || {{{#!if calc(a)==\1
58출력}}} || {{{#!if calc(+a)==\1
59출력}}} || {{{#!if calc[a]==\1
60출력}}} || {{{#!if calc[+a]==\1
61출력}}} || {{{#!if calc['a']==\1
62출력}}} || {{{#!if @a@==\1
63출력}}} ||
r34
64}}}
r4
65
r35
66== 변수 this.a=1 ==
67기준모양 : this.a == 1
r37
68||<table bgcolor=transparent,transparent> 구분 || this.a || +this.a || -this.a || "this.a" || [this.a] || this['a'] || this["a"] || this[+a] || this[a] || +this[a] || +this['a'] || +this["a"] ||
r35
69|| ==1[* 단, -this.a 에는 -this.a==-1로 걸어놓음.] || {{{#!if this.a==1
70출력}}} || {{{#!if +this.a==1
71출력}}} || {{{#!if -this.a==-1
72출력}}} || {{{#!if "this.a"==1
73출력}}} || {{{#!if [this.a]==1
74출력}}} || {{{#!if this['a']==1
75출력}}} || {{{#!if this["a"]==1
76출력}}} || {{{#!if this[+a]==1
77출력}}} || {{{#!if this[a]==1
r37
78출력}}} || {{{#!if +this[a]==1
r35
79출력}}} || {{{#!if +this['a']==1
80출력}}} || {{{#!if +this["a"]==1
r28
81출력}}} ||
r35
82|| =='1' || {{{#!if this.a=='1'
83출력}}} || {{{#!if +this.a=='1'
84출력}}} || {{{#!if -this.a=='1'
85출력}}} || {{{#!if "this.a"=='1'
86출력}}} || {{{#!if [this.a]=='1'
87출력}}} || {{{#!if this['a']=='1'
88출력}}} || {{{#!if this["a"]=='1'
89출력}}} || {{{#!if this[+a]=='1'
90출력}}} || {{{#!if this[a]=='1'
r37
91출력}}} || {{{#!if +this[a]=='1'
r35
92출력}}} || {{{#!if +this['a']=='1'
93출력}}} || {{{#!if +this["a"]=='1'
r28
94출력}}} ||
r35
95|| =="1" || {{{#!if this.a=="1"
96출력}}} || {{{#!if +this.a=="1"
97출력}}} || {{{#!if -this.a=="1"
98출력}}} || {{{#!if "this.a"=="1"
99출력}}} || {{{#!if [this.a]=="1"
100출력}}} || {{{#!if this['a']=="1"
101출력}}} || {{{#!if this["a"]=="1"
102출력}}} || {{{#!if this[+a]=="1"
103출력}}} || {{{#!if this[a]=="1"
r37
104출력}}} || {{{#!if +this[a]=="1"
r35
105출력}}} || {{{#!if +this['a']=="1"
106출력}}} || {{{#!if +this["a"]=="1"
107출력}}} ||
108위의 표는 {{{#!wiki style="display: inline; font-family: monospace;"
109this}}} 함수 안에 {{{#!wiki style="display: inline; font-family: monospace;"
110{{{#orange \'}}}{{{#green 변수명}}}{{{#orange \'}}}}}} 를 포함하여 {{{this}}} 함수 안에 다른 모양을 넣고 테스트를 해보는 표이다.
111{{{#!wiki style="display: inline; font-family: monospace;"
112this\[{{{#orange \+}}}{{{#green 변수명}}}\]}}}과, {{{#!wiki style="display: inline; font-family: monospace;"
113this\[{{{#green 변수명}}}\]}}}도 지원되는지 테스트, this{{{#orange .}}}{{{#green 변수명}}}이 텍스트값으로만 될 수 있는지 테스트.
r4
114
r35
115 * {{{#orange 결론 1 :}}} {{{#!wiki style="display: inline; font-family: monospace;"
116this\[{{{#orange \"}}}{{{#green 변수명}}}{{{#orange \"}}}\]}}}(큰따옴표)은 {{{#!wiki style="display: inline; font-family: monospace;"
117this\[{{{#orange \'}}}{{{#green 변수명}}}{{{#orange \'}}}\]}}}(작은따옴표)와 마찬가지로 텍스트 값으로 출력된다.
118 * {{{#orange 결론 2 :}}} {{{#!wiki style="display: inline; font-family: monospace;"
119this\[{{{#orange \+}}}{{{#green 변수명}}}\]}}}, {{{#!wiki style="display: inline; font-family: monospace;"
120this\[{{{#green 변수명}}}\]}}}은 실수값으로도 텍스트 값으로도 계산하기에는 올바른 입력이 아니다.
121 {{{#!wiki style="display: inline; font-family: monospace;"
122this\[{{{#orange \"}}}{{{#green 변수명}}}{{{#orange \"}}}\]}}}를 숫자 값으로 나오게 하고 싶으면 {{{#!wiki style="display: inline; font-family: monospace;"
123{{{#orangered +}}}this\[{{{#orange \'}}}{{{#green 변수명}}}{{{#orange \'}}}\]}}}이나 {{{#!wiki style="display: inline; font-family: monospace;"
124{{{#orangered +}}}this\[{{{#orange \"}}}{{{#green 변수명}}}{{{#orange \"}}}\]}}} 등 알맞게 입력해야 한다.
125 * {{{#orange 결론 3 :}}} {{{#!wiki style="display: inline; font-family: monospace;"
126this{{{#orange .}}}{{{#green 변수명}}}}}}은 양식만 잘 맞추면 숫자값으로 또는 텍스트값으로 나오게 할 수 있다.
127
128== 변수 a=b, b=1 테스트 ==
129변수 하나를 다른 변수의 포인터(point)로 두고 테스트.
r40
130기준 1. {{{#!wiki style="display: inline; font-family: monospace;"
131\[include(테스트:If문법/include 대상)\]}}}으로 둘 경우
132{{{#!folding [펼치기 · 접기]
133{{{-5 {{{-3 [include(테스트:If문법/include 대상)]}}}}}}}}}
134----
r43
135기준 2. a='b' (텍스트값) 검증 : {{{#!if a=='b'
r42
136{{{#red 검증됨}}} {{{#lightcoral (verified)}}}}}}
r40
137----
r39
138a=b, b=1로 둘 경우 ({{{#!wiki style="display: inline; font-family: monospace;"
139\[include(테스트:If문법/include 대상, a=b, b=1)\]}}})
r35
140{{{#!folding [펼치기 · 접기]
r40
141{{{-5 {{{-3 [include(테스트:If문법/include 대상, a=b, b=1)]}}}}}}}}}+this[a], this[a]가 작동된다.
142----
r38
143 * {{{#orange 결론 1 :}}} {{{#!wiki style="display: inline; font-family: monospace;"
r39
144this\[{{{#green 변수명}}}\]}}}은 문서를 include로 불러올 때 동작된다.
r38
145 포인터(pointer) 변수같이 해당 {{{#!wiki style="display: inline; font-family: monospace;"
r47
146{{{#green 변수명}}}}}}을 {{{#tomato 다른 변수명(텍스트값)}}}으로 정의하는 ({{{#!wiki style="display: inline; font-family: monospace;"
r46
147{{{#green 변수명}}}={{{#tomato 변수명2}}}}}})의 식, 그리고 {{{#green 변수명}}}이 정의한 다른 변수에 값을 정의하는 식이 include 문법(구문)의 괄호 안에 같이 있어야 문서를 include할 때 동작된다. 식을 기입하는 순서는 상관없다.
r41
148 {{{#orange 예 :}}} {{{#!wiki style="display: inline; font-family: monospace;"
r46
149\[include\({{{#skyblue 불러올 문서명}}}, {{{#green 변수명}}}={{{#tomato 변수명2}}}, {{{#tomato 변수명2}}}={{{#teal ''(해당 변수에 정의할 값 입력)''}}}\)\]}}}
r28
150== 변수 c\= ==
r29
151null과 "" 이 어떤 조건에서 되는지 테스트.
152||<table bgcolor=transparent,transparent> 구분 ||<width=20%> {{{#blue c==null}}} ||<width=20%> {{{#orange c==""}}} ||<width=20%> c=={{{#gray ''(space)''}}} ||<width=20%> c="{{{#gray ''(space)''}}}" ||
153|| 출력테스트 || {{{#!if c==null
154출력}}} || {{{#!if c==""
155출력}}} || {{{#!if c==
156출력}}} || {{{#!if c==" "
r28
157출력}}} ||
r8
158
r18
159== this 함수 ==
r29
160===# this \[{{{#orange \'}}}{{{#green 변수명}}}{{{#orange \'}}}\] 관련 테스트 #===
r8
161this['true']=true 테스트
162{{{#!if this['true']==true
163출력 }}}
164----
r32
165this['a'] == null 테스트
166{{{#!if this['a'] == null
167출력}}}
168----
r15
169a=b 테스트 : 아무 변수도 호출하지 않으면 null == null 상태가 된다.
r9
170{{{#!if a==b
r8
171출력}}}
172----
r32
173this['a']=this['b'] 테스트 : 아무 변수도 호출하지 않으면 null == null 상태가 된다.
r8
174{{{#!if this['a']==this['b']
175출력}}}
r9
176----
r22
177a+b=c 테스트 (먼저 숫자로 출력되는 변수들끼리 덧셈식이 올바르게 작동하는지를 검증하기 위한 테스트이다.)
r9
178{{{#!if a+b==c
179출력}}}
180----
181this['a']+this['b']=this['c'] 테스트
182{{{#!if this['a']+this['b']==this['c']
r11
183출력}}}
184----
r15
185+a+b=+c 테스트 : 아무 변수도 호출하지 않으면 nullnull == null 형식이 되는 것으로 추정된다.
r11
186{{{#!if +a+b==+c
187출력}}}
188----
r15
189(+a)+(+b)=+c 테스트 : 숫자값으로 연산하고자 +를 선언했으므로 괄호로 엮어야 한다.
r14
190{{{#!if (+a)+(+b)==+c
191출력}}}
192----
r16
193+this['a']+this['b']=+this['c'] 테스트 : 변수 호출하지 않으면 ++=상태가 된다.
r11
194{{{#!if +this['a']+this['b']==+this['c']
r16
195출력}}}
r18
196----
r16
197(+this['a'])+(+this['b'])=+this['c'] 테스트 : 변수 호출하지 않으면 ++=상태가 된다.
r33
198{{{#!if (+this['a'])+(+this['b'])==+this['c']
r18
199출력}}}
200
r24
201{{{#orange 결론 : }}} {{{#!wiki style="display: inline; font-family: monospace;"
r25
202this\[{{{#orange \'}}}{{{#green 변수명}}}{{{#orange \'}}}\]}}}는 텍스트 값으로 출력된다.
r49
203
204=== this. + 연산자 ===
r52
205this.a.length 테스트 : {{{#!if a!=null
206{{{#!if result_a=this.a.length
207}}}출력 (@result_a@글자)}}}
r50
208
r26
209