On Fri, 3 Oct 1997, Aaron Miller wrote: > one_argument(argument, buf); > argu = atoi(buf); > > And im still getting a zero when i sprintf argu.. :( With your code the following command given to the mud will work like so: command Hi argument = "Hi" After one_argument(argument, buf); buf = "Hi" After argu = atoi(buf); buf = 0 That is because "Hi" is NON-NUMERIC. The same code, with a different command: command 4000 after one_argument(argument, buf); buf = "4000" after argu = atoi(buf); argu = 4000 This is because the argument passed to the command was NUMERIC. I don't think that there is anything wrong with your command. I think the problem is that you don't understand what atoi() does, or you are trying to do something thgat atoi() cannot do. How about explaining to us what you are trying to do. You know, the English paragraph or three describing what the function is supposed to accomplish. Send a short bit of the code that you've written along with it, and I bet that someone on the list can pin-point the problem. Good luck! John Evans <evansj@hi-line.net> May the source be with you. +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/08/00 PST