Count parameters in command
#1

Hy

How can i count parameters (alias words) in a command?
E.g: /test 1 two 3
How can i count this 3 parameter?

Thanx for help... i searched, but i not found...
Reply
#2

Read about dcmd and sscanf
If something will be vague, ask
Reply
#3

You dont understand me...
I can get value from parameter, but i want count the parameters...
Reply
#4

why would you need to count them if you set the amount of parameters ?
Reply
#5

Because i dont like write 4-5 strtok instead of 1 line.
Reply
#6

Check for a space (0x32) and make sure it isn't the end of the line, do this in a loop and increase a variable to give you your count.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)