hi people
i have (for my viewpoint) a strange problem with d8.5
this line:
if go_game_engine.pl_winners.count()=1 then
throws an error saying expected THEN ???
if i write this (count without the brackets):
if go_game_engine.pl_winners.count=1 then
it work perfectly why??
it
if i put go_game_engine.pl_winners.count() in the watcher it
works perfectly
In dot syntax count is a property and not a function. It is also a
function in old syntax. You're using mixed syntax which is mostly dot
syntax, and so the part that is older syntax is causing a problem.
You can
Well, to begin with it would help if you described how you defined count -
is it a property, or is it a function on an object?
If it's a property, then it makes certain sense. The 'expected then' is
because it hit the parentheses that it didn't expect, because you wouldn't
have parentheses
Am 20.12.2002 10:48 Uhr schrieb Matthias Amberg unter
[EMAIL PROTECTED]:
The main thing one has to learn when it comes to Director syntax is not WHY
but HOW. There are so many strange things (MM doesn't consider them as bugs)
about what works and what not, that you should be satisfied with having
thank you all for your replies
I have to say that I am still confused but on a higher level :-)
if i put go_game_engine.pl_winners.count() in the watcher it works
perfectly
In dot syntax count is a property and not a function. It is also a
function in old syntax. You're using mixed syntax
Count is a list function as well as a property. So...
nameList.count
or
nameList.count()
or
count(nameList) are all valid.
Pranav Negandhi
Software Engineering
Learnet India Limited, Mumbai.
Phone: 91-22-859 8042 Ext: 316
http://www.learnetindia.com
snip
Whereas YOUR count is PROBABLY a
I think your real confusion stems from the fact that you are using a
reserved word (count) for a similar need, but you have it structured
differently.
nah it's exactly what Pranav described the go_game_engine.pl_winners is a
list (declared as a property insida the game_engine object) so i
this line:
if go_game_engine.pl_winners.count()=1 then
throws an error saying expected THEN ???
if i write this (count without the brackets):
if go_game_engine.pl_winners.count=1 then
it work perfectly why??
count is a property, not a function. By putting the parentheses after
count is a property, not a function.
Before I get trounced, I should amend that to say it is a property in your
context (dot syntax). It does also, of course, exist as a function. but it
needs an argument.
Cordially,
Kerry Thompson
[To remove yourself from this list, or to change to
Others have done a good job at explaining this Lingo syntax error. I
would like suggest that you use a different approach altogether.
One of the cardinal rules of object oriented programming is that you
never reach into an object and access its properties by name. Rather
than trying to get
10 matches
Mail list logo