; statement 1
If (c = "")
{
c:=p
If (d <> p) and (d <> b)
c:=d
}
return
; statement 2
If (c = "")
{
If (d = b)
c:= p
Else
c:= d
}
return
問 : 以上兩個野 RETURN 一樣嗎 ?
Gemini 免費版回答
Let's say p = 1, b = 2, and d = 3.
Statement 1: c will remain 1 (because d is not different from p).
Statement 2: c will be set to 3.
Gemini Advanced 回答
c = "" (empty)
p = "placeholder"
b = "custom"
d = "custom"
Here's where the difference occurs:
Statement 1: The final value of c would be "placeholder" (Since d is equal to b, the nested condition fails).
Statement 2: The final value of c would be "custom" (d is not equal to b, fulfilling the else condition).