[CODE] Creating VLIST Command (vnum listing)

From: Phil Durand (phildurand@home.com)
Date: 04/24/99

I'm trying to do a vlist command, and I've come up with this, but there is
one problem, it can't find the real_number of a non-existant vnum so,
therefore, I can't use a range... let me explain:

for example, the vlist_object(int low, int high, char_data *ch) utility that
I use to list the objects from low, to high (like 3000, 4000 lets say)

int vlist_object(int lownumber, int highnumber, struct char_data *ch)
  int nr, found = 0;
  strcpy(buf, "\0");

  for (nr = real_object(lownumber); nr <= real_object(highnumber); nr++)
<===== here is the problem!!!
    if(obj_index[nr].vnum <= highnumber && obj_index[nr].vnum >= lownumber)
      sprintf(buf + strlen(buf), " &K- [&W%5d&K]&w %s\r\n",
obj_index[nr].vnum, CAP(obj_proto[nr].short_description));

  page_string(ch->desc, buf, TRUE);

real_object(blahblah) returns 0 if the number put into that function doesn't
exist (like lets say I do real_object on vnum 100, but there is no object at
vnum 100, then it returns 0 and the for loop ends)

If the for loop ends, then it doesn't list anything! so a range of 0 to 10
(10 being a valid vnum) would list everything from 0 to 10, but then if I
want to see further, and do 0 to 20 (20 NOT being a valid vnum) it doesn't
list anything at all...

Does anyone understand what I'm saying here? :) If you have an idea, please
let me know!

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |

This archive was generated by hypermail 2b30 : 12/15/00 PST