Re: [NEWBIE] Taking in arguements (I'm slow)

From: Karl Buchner (blaizeofshadow@juno.com)
Date: 03/01/01


Someone Wrote:

>Heres what I have, and whenever I put in an arguement it crashes.

>[...]

>for (level = 0; level <= 8 || found_level > 0; level++){

Found_level has not been intalized...add found_level = 0 in beginging of
for loop.
Anyway...if found_level = 1 this loop will go on and on...so level will
get high,
and spell_db[level] will be unintalized.  I think what you want is
for (level = 0, found_level = 0; level <= 8 && found level; level++){

that should solve it.

>[...]

>SET_MEM_USED(ch, found_level - 1, (GET_MEM_USED(ch, found_level - 1) +
1));

I would put SET_MEM_USED, GET_MEM_USED, and spell_db on the same level to
avoid all
this found_level -1 and found_level +1 stuff...it might screw you up if
you try to add to the code.

^Blaize^
________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
http://dl.www.juno.com/get/tagj.

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/04/01 PST