ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
Re: What's wrong with this code? (Sdk)
Re: What's wrong with this code? // Sdkroland vilettJul 29, 1999, 4:12pm
This doesn't look right to me:
>char *reply[255]; /* Used in MANY of the bots messages */ You are declaring reply as an array of pointers to char, when I believe what you want is an array of char. I notice that later on in your code you cast reply to (char *)...presumably this was to circumvent compiler warnings...if so, a good rule of thumb worth mentioning is: always pay close attention to compiler warnings! They are there for a reason. However, I don't think this is causing your problem. I think your problem is this: > int nWhois=aw_int (AW_CHAT_SESSION); You are declaring nWhois as a local in this routine. You also have it declared as a global. By declaring it locally, it is "masking" out the global identifier of the same name in this context, so when you try to "save" the value of AW_CHAT_SESSION here you are in fact just throwing it away. >If AW_AVATAR_ADDRESS didn't write to : >aw_int (AW_AVATAR_SESSION) --- I'd be able to use : I don't understand this. AW_AVATAR_ADDRESS is just a pre-defined constant, it doesn't write to anything by itself. -Roland |