더시드위키
최근 변경
최근 토론
임의 문서
도구
최근 변경
테스트:if문법/include 대상
(r36 RAW)
[[분류:테스트]][[분류:나무마크 문법]] [[../|상위 문서]] [[../include 결과|결과 보기]] == 변수 a=1 == * 기본형식 : a==1 {{{#!wiki style="word-break: keep-all;" ||<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@= || || ==1[* 단, -a= 열에는 if 조건문을 -a==-1 으로 걸어놓음.] || {{{#!if a==1 출력}}} || {{{#!if +a==1 출력}}} || {{{#!if -a==-1 출력}}} || {{{#!if 'a'==1 출력}}} || {{{#!if "a"==1 출력}}} || {{{#!if [a]==1 출력}}} || {{{#!if [a==1] 출력}}} || {{{#!if calc(a)==1 출력}}} || {{{#!if calc(+a)==1 출력}}} || {{{#!if calc[a]==1 출력}}} || {{{#!if calc[+a]==1 출력}}} || {{{#!if calc['a']==1 출력}}} || {{{#!if @a@==1 출력}}} || || =='1' || {{{#!if a=='1' 출력}}} || {{{#!if +a=='1' 출력}}} || {{{#!if -a=='1' 출력}}} || {{{#!if 'a'=='1' 출력}}} || {{{#!if "a"=='1' 출력}}} || {{{#!if [a]=='1' 출력}}} || {{{#!if [a=='1'] 출력}}} || {{{#!if calc(a)=='1' 출력}}} || {{{#!if calc(+a)=='1' 출력}}} || {{{#!if calc[a]=='1' 출력}}} || {{{#!if calc[+a]=='1' 출력}}} || {{{#!if calc['a']=='1' 출력}}} || {{{#!if @a@=='1' 출력}}} || || =="1" || {{{#!if a=="1" 출력}}} || {{{#!if +a=="1" 출력}}} || {{{#!if -a=="1" 출력}}} || {{{#!if 'a'=="1" 출력}}} || {{{#!if "a"=="1" 출력}}} || {{{#!if [a]=="1" 출력}}} || {{{#!if [a=="1"] 출력}}} || {{{#!if calc(a)=="1" 출력}}} || {{{#!if calc(+a)=="1" 출력}}} || {{{#!if calc[a]=="1" 출력}}} || {{{#!if calc[+a]=="1" 출력}}} || {{{#!if calc['a']=="1" 출력}}} || {{{#!if @a@=="1" 출력}}} || || ==\\1 || {{{#!if a==\1 출력}}} || {{{#!if +a==\1 출력}}} || {{{#!if -a==\1 출력}}} || {{{#!if 'a'==\1 출력}}} || {{{#!if "a"==\1 출력}}} || {{{#!if [a]==\1 출력}}} || {{{#!if [a==\1] 출력}}} || {{{#!if calc(a)==\1 출력}}} || {{{#!if calc(+a)==\1 출력}}} || {{{#!if calc[a]==\1 출력}}} || {{{#!if calc[+a]==\1 출력}}} || {{{#!if calc['a']==\1 출력}}} || {{{#!if @a@==\1 출력}}} || }}} == 변수 this.a=1 == 기준모양 : this.a == 1 ||<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"] || || ==1[* 단, -this.a 에는 -this.a==-1로 걸어놓음.] || {{{#!if this.a==1 출력}}} || {{{#!if +this.a==1 출력}}} || {{{#!if -this.a==-1 출력}}} || {{{#!if "this.a"==1 출력}}} || {{{#!if [this.a]==1 출력}}} || {{{#!if this['a']==1 출력}}} || {{{#!if this["a"]==1 출력}}} || {{{#!if this[+a]==1 출력}}} || {{{#!if this[a]==1 출력}}} || {{{#!if +this['a']==1 출력}}} || {{{#!if +this["a"]==1 출력}}} || || =='1' || {{{#!if this.a=='1' 출력}}} || {{{#!if +this.a=='1' 출력}}} || {{{#!if -this.a=='1' 출력}}} || {{{#!if "this.a"=='1' 출력}}} || {{{#!if [this.a]=='1' 출력}}} || {{{#!if this['a']=='1' 출력}}} || {{{#!if this["a"]=='1' 출력}}} || {{{#!if this[+a]=='1' 출력}}} || {{{#!if this[a]=='1' 출력}}} || {{{#!if +this['a']=='1' 출력}}} || {{{#!if +this["a"]=='1' 출력}}} || || =="1" || {{{#!if this.a=="1" 출력}}} || {{{#!if +this.a=="1" 출력}}} || {{{#!if -this.a=="1" 출력}}} || {{{#!if "this.a"=="1" 출력}}} || {{{#!if [this.a]=="1" 출력}}} || {{{#!if this['a']=="1" 출력}}} || {{{#!if this["a"]=="1" 출력}}} || {{{#!if this[+a]=="1" 출력}}} || {{{#!if this[a]=="1" 출력}}} || {{{#!if +this['a']=="1" 출력}}} || {{{#!if +this["a"]=="1" 출력}}} || 위의 표는 {{{#!wiki style="display: inline; font-family: monospace;" this}}} 함수 안에 {{{#!wiki style="display: inline; font-family: monospace;" {{{#orange \'}}}{{{#green 변수명}}}{{{#orange \'}}}}}} 를 포함하여 {{{this}}} 함수 안에 다른 모양을 넣고 테스트를 해보는 표이다. {{{#!wiki style="display: inline; font-family: monospace;" this\[{{{#orange \+}}}{{{#green 변수명}}}\]}}}과, {{{#!wiki style="display: inline; font-family: monospace;" this\[{{{#green 변수명}}}\]}}}도 지원되는지 테스트, this{{{#orange .}}}{{{#green 변수명}}}이 텍스트값으로만 될 수 있는지 테스트. * {{{#orange 결론 1 :}}} {{{#!wiki style="display: inline; font-family: monospace;" this\[{{{#orange \"}}}{{{#green 변수명}}}{{{#orange \"}}}\]}}}(큰따옴표)은 {{{#!wiki style="display: inline; font-family: monospace;" this\[{{{#orange \'}}}{{{#green 변수명}}}{{{#orange \'}}}\]}}}(작은따옴표)와 마찬가지로 텍스트 값으로 출력된다. * {{{#orange 결론 2 :}}} {{{#!wiki style="display: inline; font-family: monospace;" this\[{{{#orange \+}}}{{{#green 변수명}}}\]}}}, {{{#!wiki style="display: inline; font-family: monospace;" this\[{{{#green 변수명}}}\]}}}은 실수값으로도 텍스트 값으로도 계산하기에는 올바른 입력이 아니다. {{{#!wiki style="display: inline; font-family: monospace;" this\[{{{#orange \"}}}{{{#green 변수명}}}{{{#orange \"}}}\]}}}를 숫자 값으로 나오게 하고 싶으면 {{{#!wiki style="display: inline; font-family: monospace;" {{{#orangered +}}}this\[{{{#orange \'}}}{{{#green 변수명}}}{{{#orange \'}}}\]}}}이나 {{{#!wiki style="display: inline; font-family: monospace;" {{{#orangered +}}}this\[{{{#orange \"}}}{{{#green 변수명}}}{{{#orange \"}}}\]}}} 등 알맞게 입력해야 한다. * {{{#orange 결론 3 :}}} {{{#!wiki style="display: inline; font-family: monospace;" this{{{#orange .}}}{{{#green 변수명}}}}}}은 양식만 잘 맞추면 숫자값으로 또는 텍스트값으로 나오게 할 수 있다. == 변수 a=b, b=1 테스트 == 변수 하나를 다른 변수의 포인터(point)로 두고 테스트. a=b, b=1로 둘 경우 {{{#!folding [펼치기 · 접기] {{{-5 {{{-3 [include(테스트:If문법/include 대상, a=b, b=1)]}}}}}}}}} == 변수 c\= == null과 "" 이 어떤 조건에서 되는지 테스트. ||<table bgcolor=transparent,transparent> 구분 ||<width=20%> {{{#blue c==null}}} ||<width=20%> {{{#orange c==""}}} ||<width=20%> c=={{{#gray ''(space)''}}} ||<width=20%> c="{{{#gray ''(space)''}}}" || || 출력테스트 || {{{#!if c==null 출력}}} || {{{#!if c=="" 출력}}} || {{{#!if c== 출력}}} || {{{#!if c==" " 출력}}} || == this 함수 == ===# this \[{{{#orange \'}}}{{{#green 변수명}}}{{{#orange \'}}}\] 관련 테스트 #=== this['true']=true 테스트 {{{#!if this['true']==true 출력 }}} ---- this['a'] == null 테스트 {{{#!if this['a'] == null 출력}}} ---- a=b 테스트 : 아무 변수도 호출하지 않으면 null == null 상태가 된다. {{{#!if a==b 출력}}} ---- this['a']=this['b'] 테스트 : 아무 변수도 호출하지 않으면 null == null 상태가 된다. {{{#!if this['a']==this['b'] 출력}}} ---- a+b=c 테스트 (먼저 숫자로 출력되는 변수들끼리 덧셈식이 올바르게 작동하는지를 검증하기 위한 테스트이다.) {{{#!if a+b==c 출력}}} ---- this['a']+this['b']=this['c'] 테스트 {{{#!if this['a']+this['b']==this['c'] 출력}}} ---- +a+b=+c 테스트 : 아무 변수도 호출하지 않으면 nullnull == null 형식이 되는 것으로 추정된다. {{{#!if +a+b==+c 출력}}} ---- (+a)+(+b)=+c 테스트 : 숫자값으로 연산하고자 +를 선언했으므로 괄호로 엮어야 한다. {{{#!if (+a)+(+b)==+c 출력}}} ---- +this['a']+this['b']=+this['c'] 테스트 : 변수 호출하지 않으면 ++=상태가 된다. {{{#!if +this['a']+this['b']==+this['c'] 출력}}} ---- (+this['a'])+(+this['b'])=+this['c'] 테스트 : 변수 호출하지 않으면 ++=상태가 된다. {{{#!if (+this['a'])+(+this['b'])==+this['c'] 출력}}} {{{#orange 결론 : }}} {{{#!wiki style="display: inline; font-family: monospace;" this\[{{{#orange \'}}}{{{#green 변수명}}}{{{#orange \'}}}\]}}}는 텍스트 값으로 출력된다.
Liberty
|
the seed