2017-08-08 28 views
0

if-else語法有問題。錯誤說剩下的文字看起來不是公式的一部分。我該如何解決這個問題?如果其他文本看起來不是公式的一部分

NumberVar k:={@Counting_Data}/{@Counting_Fail} 
if k > 2 then 
    StringVar l:="Failed" 
else if k <= 2 and k>0 
    StringVar l:="Promoted" 
else if k = 0 then 
StringVar l:="Passed" 
else "" 
+0

盪滌語言並提出代碼更容易閱讀... – rfornal

回答

1
NumberVar k:={@Counting_Data}/{@Counting_Fail}; 
if k > 2 then 
    StringVar l:="Failed" 
else if k <= 2 and k>0 then 
    l:="Promoted" 
else if k = 0 then 
    l:="Passed" 
else "" 
+0

它的工作thanks.But可以解釋爲什麼發生這個錯誤? – Ishti

+0

的;在第一行的末尾分開代碼。你還錯過了之前的聲明l:=「升遷」 – CoSpringsGuy

+0

@ 4444大聲笑謝謝 – CoSpringsGuy

相關問題