|
VB Error Question (Sdk)
VB Error Question // Sdk
Oct 13, 2001, 10:04pm
What does: "Assignment to constant not permitted", mean?
The highlighted code is:
sdk1 <Hightlight> .AwWhisper(PLAYER_ID, WELCOME_MESSAGE_NEWPLAYER) =
</Highlight> True
PLAYER_ID = sdk1.AwAvatarSession (set as Long)
WELCOME_MESSAGE_NEWPLAYER = (a string read from an ini file) (set as String)
--
- Cozmo Of Cozmo-X
http://cozmo-x.zapto.org
World: A'Dude
Oct 14, 2001, 12:40am
Its highly evident that your attempting to set a function to something, or is it in an if? I can
tell this without knowing a lick of VB :)
[View Quote]"cozmo" <b.nolan2 at verizon.net> wrote in message news:3bc8d696$1 at server1.Activeworlds.com...
What does: "Assignment to constant not permitted", mean?
|
The highlighted code is:
sdk1 <Hightlight> .AwWhisper(PLAYER_ID, WELCOME_MESSAGE_NEWPLAYER) =
</Highlight> True
PLAYER_ID = sdk1.AwAvatarSession (set as Long)
WELCOME_MESSAGE_NEWPLAYER = (a string read from an ini file) (set as String)
--
- Cozmo Of Cozmo-X
http://cozmo-x.zapto.org
World: A'Dude
Oct 14, 2001, 1:32am
no this is under the avataradd event.....
[View Quote]"young phalpha" <RhaneC at msn.com> wrote in message
news:3bc8fb3b at server1.Activeworlds.com...
> Its highly evident that your attempting to set a function to something, or
is it in an if? I can
> tell this without knowing a lick of VB :)
>
> "cozmo" <b.nolan2 at verizon.net> wrote in message
news:3bc8d696$1 at server1.Activeworlds.com...
> What does: "Assignment to constant not permitted", mean?
>
> The highlighted code is:
>
>
> sdk1 <Hightlight> .AwWhisper(PLAYER_ID, WELCOME_MESSAGE_NEWPLAYER) =
> </Highlight> True
>
> PLAYER_ID = sdk1.AwAvatarSession (set as Long)
> WELCOME_MESSAGE_NEWPLAYER = (a string read from an ini file) (set as
String)
>
> --
> - Cozmo Of Cozmo-X
> http://cozmo-x.zapto.org
> World: A'Dude
>
>
>
|
Oct 14, 2001, 1:50am
Well then it does appear your attempting to set a function as if it were a varible...
[View Quote]"cozmo" <b.nolan2 at verizon.net> wrote in message news:3bc90751 at server1.Activeworlds.com...
no this is under the avataradd event.....
|
[View Quote]"young phalpha" <RhaneC at msn.com> wrote in message
news:3bc8fb3b at server1.Activeworlds.com...
> Its highly evident that your attempting to set a function to something, or
is it in an if? I can
> tell this without knowing a lick of VB :)
>
> "cozmo" <b.nolan2 at verizon.net> wrote in message
news:3bc8d696$1 at server1.Activeworlds.com...
> What does: "Assignment to constant not permitted", mean?
>
> The highlighted code is:
>
>
> sdk1 <Hightlight> .AwWhisper(PLAYER_ID, WELCOME_MESSAGE_NEWPLAYER) =
> </Highlight> True
>
> PLAYER_ID = sdk1.AwAvatarSession (set as Long)
> WELCOME_MESSAGE_NEWPLAYER = (a string read from an ini file) (set as
String)
>
> --
> - Cozmo Of Cozmo-X
> http://cozmo-x.zapto.org
> World: A'Dude
>
>
>
|
Oct 14, 2001, 2:11am
no VB knowledge but here's my idea from C :
A constant is a constant value that can only be set from
values that can be evaluated at compile time. Simple
calculations that are evaluated from other constants
are values like that.
Everything that might change its value in any runtime
operation (function results are evaluated at runtime)
always has to be a variable instead of a constant.
If either PLAYER_ID or WELCOME_MESSAGE_NEWPLAYER are
declared constant, the compiler will not allow changes
on runtime. Usually all-uppercase names are used for
constants, to make clear that these cannot be used on
the left side of the "equals"-operator.
[View Quote]cozmo wrote:
>
> What does: "Assignment to constant not permitted", mean?
>
> The highlighted code is:
>
> sdk1 <Hightlight> .AwWhisper(PLAYER_ID, WELCOME_MESSAGE_NEWPLAYER) =
> </Highlight> True
>
> PLAYER_ID = sdk1.AwAvatarSession (set as Long)
> WELCOME_MESSAGE_NEWPLAYER = (a string read from an ini file) (set as String)
>
> --
> - Cozmo Of Cozmo-X
> http://cozmo-x.zapto.org
> World: A'Dude
|
--
"_
|
/\
\ /
__/ /_
Oct 14, 2001, 3:41am
i always make my variables in caps to make them stand out....and no all i
did for them was Dim PLAYER_ID As Long and so on
[View Quote]"ananas" <vha at oct31.de> wrote in message news:3BC90FAD.2C2EA5CB at oct31.de...
> no VB knowledge but here's my idea from C :
>
> A constant is a constant value that can only be set from
> values that can be evaluated at compile time. Simple
> calculations that are evaluated from other constants
> are values like that.
>
> Everything that might change its value in any runtime
> operation (function results are evaluated at runtime)
> always has to be a variable instead of a constant.
>
> If either PLAYER_ID or WELCOME_MESSAGE_NEWPLAYER are
> declared constant, the compiler will not allow changes
> on runtime. Usually all-uppercase names are used for
> constants, to make clear that these cannot be used on
> the left side of the "equals"-operator.
>
> cozmo wrote:
String)
>
> --
> "_
> |
> /\
> \ /
> __/ /_
|
Oct 14, 2001, 4:23am
oh, now I understand this hilite stuff - if I take it out
I can read the code and see the error in it (I guess).
You assign a value to a function !
sdk1.AwWhisper(PLAYER_ID, WELCOME_MESSAGE_NEWPLAYER) = True
A function isn't a good L-Value, not useable for the left side
of the equals sign
just a hint :
You should consult a styleguide sometimes ;)
[View Quote]cozmo wrote:
>
> i always make my variables in caps to make them stand out....and no all i
> did for them was Dim PLAYER_ID As Long and so on
>
> String)
|
--
"_
|
/\
\ /
__/ /_
Oct 14, 2001, 8:51am
what's the deal with the = True? has nothing at all to do with .AwWhisper, I
don't see why you added it
KAH
[View Quote]"cozmo" <b.nolan2 at verizon.net> wrote in message
news:3bc8d696$1 at server1.Activeworlds.com...
> What does: "Assignment to constant not permitted", mean?
>
> The highlighted code is:
>
>
> sdk1 <Hightlight> .AwWhisper(PLAYER_ID, WELCOME_MESSAGE_NEWPLAYER) =
> </Highlight> True
>
> PLAYER_ID = sdk1.AwAvatarSession (set as Long)
> WELCOME_MESSAGE_NEWPLAYER = (a string read from an ini file) (set as
String)
>
> --
> - Cozmo Of Cozmo-X
> http://cozmo-x.zapto.org
> World: A'Dude
>
>
|
Oct 14, 2001, 2:20pm
if i dont use it it errors me saying i need an = and some value.....i have
always done this becuase it wont let me do otherwise and it usually
works.....basicly the true means DO IT
[View Quote]"kah" <kah at kahbot.com> wrote in message
news:3bc96e2a$1 at server1.Activeworlds.com...
> what's the deal with the = True? has nothing at all to do with .AwWhisper,
I
> don't see why you added it
>
> KAH
>
> "cozmo" <b.nolan2 at verizon.net> wrote in message
> news:3bc8d696$1 at server1.Activeworlds.com...
> String)
>
>
|
Oct 14, 2001, 4:38pm
Maybe VB requires that a return value of a function is
always used? AwWhisper is declared as a function returning
a longint value, that would be :
Dim DummyLong As Long
DummyLong = sdk1.AwWhisper(PLAYER_ID, WELCOME_MESSAGE_NEWPLAYER)
optional :
If (sdk1.AwWhisper(PLAYER_ID, WELCOME_MESSAGE_NEWPLAYER) > 0) Then
Begin <= just an empty statement here, ...
End <= ... I guess in VB it looks like this
[View Quote]cozmo wrote:
>
> if i dont use it it errors me saying i need an = and some value.....i have
> always done this becuase it wont let me do otherwise and it usually
> works.....basicly the true means DO IT
|
--
"_
|
/\
\ /
__/ /_
Oct 14, 2001, 4:41pm
For the use of aw_whisper check the documentation, you can't assign a value to a method:
http://www.activeworlds.com/sdk/aw_whisper.htm
http://www.grimmsoft.com/help/index.php?parent=1&item=59&expand=2
On this case just lose the parenthesis:
sdk1.AwWhisper PLAYER_ID, WELCOME_MESSAGE_NEWPLAYER
or if you insist on saying "do it" use:
Call sdk1.AwWhisper (PLAYER_ID, WELCOME_MESSAGE_NEWPLAYER)
Baron
[View Quote]"cozmo" <b.nolan2 at verizon.net> wrote in message news:3bc9bb39$1 at server1.Activeworlds.com...
> if i dont use it it errors me saying i need an = and some value.....i have always done this becuase it wont let me do otherwise and it usually works.....basicly the true means DO IT
>
> "kah" <kah at kahbot.com> wrote in message
> news:3bc96e2a$1 at server1.Activeworlds.com...
>
>
|
Oct 14, 2001, 4:46pm
oooohhhh.....thats like the rc thing isnt it? mrgrimm used that in soem
other ones and its like the error code or something....well anyways i get it
now
[View Quote]"ananas" <vha at oct31.de> wrote in message news:3BC9DAFF.41B7985 at oct31.de...
> Maybe VB requires that a return value of a function is
> always used? AwWhisper is declared as a function returning
> a longint value, that would be :
>
>
> Dim DummyLong As Long
>
> DummyLong = sdk1.AwWhisper(PLAYER_ID, WELCOME_MESSAGE_NEWPLAYER)
>
>
> optional :
>
> If (sdk1.AwWhisper(PLAYER_ID, WELCOME_MESSAGE_NEWPLAYER) > 0) Then
> Begin <= just an empty statement here, ...
> End <= ... I guess in VB it looks like this
>
>
> cozmo wrote:
have
>
> --
> "_
> |
> /\
> \ /
> __/ /_
|
Oct 14, 2001, 6:04pm
Nope..
sdk1.AwWhisper(PLAYER_ID, WELCOME_MESSAGE_NEWPLAYER) = True
You get an error for the missing equals sign because you have it in ( ). If
you would just have:
sdk1.AwWhisper PLAYER_ID, WELCOME_MESSAGE_NEWPLAYER
It would work perfectly fine. :-)
--
Lanezeri
Lead Bot Programmer at Stuff-X
http://aw.stuff-x.com
[View Quote]"cozmo" <b.nolan2 at verizon.net> wrote in message
news:3bc9bb39$1 at server1.Activeworlds.com...
> if i dont use it it errors me saying i need an = and some value.....i have
> always done this becuase it wont let me do otherwise and it usually
> works.....basicly the true means DO IT
>
> "kah" <kah at kahbot.com> wrote in message
> news:3bc96e2a$1 at server1.Activeworlds.com...
..AwWhisper,
> I
>
>
|
Oct 14, 2001, 11:31pm
.... or, if you like neatly, consistent formed code for both functions and
procedures, then use Call ...
Call sdk1.AwWhisper(PLAYER_ID, WELCOME_MESSAGE_NEWPLAYER)
[View Quote]"lanezeri" <Lanezeri at stuff-x.com> wrote in message
news:3bc9efc1$1 at server1.Activeworlds.com...
> Nope..
>
> sdk1.AwWhisper(PLAYER_ID, WELCOME_MESSAGE_NEWPLAYER) = True
>
> You get an error for the missing equals sign because you have it in ( ).
If
> you would just have:
>
> sdk1.AwWhisper PLAYER_ID, WELCOME_MESSAGE_NEWPLAYER
>
> It would work perfectly fine. :-)
>
> --
>
> Lanezeri
> Lead Bot Programmer at Stuff-X
> http://aw.stuff-x.com
>
>
> "cozmo" <b.nolan2 at verizon.net> wrote in message
> news:3bc9bb39$1 at server1.Activeworlds.com...
have
> .AwWhisper,
>
>
|
Oct 14, 2001, 11:33pm
Sorry ... Baron already said that.
[View Quote]"grimble" <grimble2000 at btinternet.com> wrote in message
news:3bca3c71 at server1.Activeworlds.com...
> ... or, if you like neatly, consistent formed code for both functions and
> procedures, then use Call ...
>
> Call sdk1.AwWhisper(PLAYER_ID, WELCOME_MESSAGE_NEWPLAYER)
>
>
>
> "lanezeri" <Lanezeri at stuff-x.com> wrote in message
> news:3bc9efc1$1 at server1.Activeworlds.com...
> If
> have
=
as
>
>
|
|