lua-users home
lua-l archive
Re: A question of scoping (I think)
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
] [
Date Index
] [
Thread Index
]
Subject
:
Re: A question of scoping (I think)
From
: RLake@
...
Date
: 2004年4月13日 17:07:29 +0100
> myObj = {}
> myObj.xPos = 10;
> myObj.someVal = 100;
> Now, I would like it if I could write a function:
> function myObj.update()
> --some code
> someVal = xPos * 10
> --remaining code
> end
do
myObj = {}
local xPos, someVal = 10, 100;
function myObj.update()
-- some code
someVal = xPos + 10
-- some more code
end
end
This means myObj's xPos and someVal are completely private. Some would say that was a Good Thing.
References
:
A question of scoping (I think)
,
Ryan Leigh
Prev by Date:
RE: A question of scoping (I think)
Next by Date:
Re: Simple Slideshow - user skip
Previous by thread:
Re: A question of scoping (I think)
Next by thread:
Re: A question of scoping (I think)
Index(es):
Date
Thread
AltStyle
によって変換されたページ
(->オリジナル)
/
アドレス:
モード:
デフォルト
音声ブラウザ
ルビ付き
配色反転
文字拡大
モバイル