Re: do_gen_tog

From: Thomas Hansen (zed@imada.ou.dk)
Date: 02/20/97


On Wed, 19 Feb 1997, Brian Williams - Nashak wrote:

> Okay.. I gave a shot at making do_gen_tog accept an argument, but I
> just can't figure it out.. here is what I did:
> switch (*argument) {
> case 'anonymous':
>   result = PRF_TOG_CHK(ch, PRF_ANONYMOUS);
>   break;
> }
> but I get some errors how the arg isn't an integer or anything..
> anyways.. if anyone has any ideas how I could go about doing this..

Well, since switch doesn't accept entire strings as its argument, that
would be why the compiler tells you that 'arg' to switch is not an
integer. So if you wanna use switch you have to just use one char 'a' for
anynomous, or you could make it be an if statement with a str_cmp in it.

if(!str_cmp(argument, "anonymous")) {
  result = PRF_TOG_CHK(ch, PRF_ANONYMOUS);
  return;
}

Hope it helps. 

Thomas Hansen.

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
|    Or send 'info circle' to majordomo@cspo.queensu.ca     |
+-----------------------------------------------------------+



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