Author Topic: getting argument name reliably  (Read 3517 times)

murali

  • Community Member
  • Posts: 31
  • Hero Points: 0
getting argument name reliably
« on: June 25, 2010, 04:42:20 PM »
Hi all,

I am trying to get the argument list using the following code snippet:

Code: [Select]
         int apos=0;
         _str a = '';
         while (tag_get_next_argument(signature, apos, a) >= 0) {
            say('arg ['args._length()'] is 'a);
            args[args._length()] = a;
         }

It gives me a fully qualified string. For example, if the function is int Foo(int a, int b);, it returns ["int a", "int b"]. I would like to get just the argument names a and b out of this. Any reliable way to get this info out? Splitting words wont work (reliably) as there can be complicated arguments like "const char a" or (void)(foo)(int a, int b).

Any ideas?

thanks in advance..