プレイ日記
Levi LeviJS
Why does the variable X reset its value upon returning to DEF Morale, whereas other variables retain their value (such as N)?
0そうだね
プレイ済み
返信[1]
親投稿
Levi LeviJS
Workaround: I just used the N variable instead. But I'm still curious.
0そうだね
プレイ済み
返信[2]
親投稿
raimondz raimondzz
The first time you used X was on that def. This means that X became a variable in the scope of that function. Once the function return X cease to exist. If you use it again, then X will have the default value (0). You should declare the variable with var or dim before using them to know in wich scope they are(Global or local)
2そうだね
プレイ済み