Author Topic: Using name_info  (Read 4105 times)

StephenW

  • Senior Community Member
  • Posts: 186
  • Hero Points: 21
Using name_info
« on: May 24, 2007, 12:07:07 am »
I do not understand the syntax for using name_info on a function.  For example, this compiles OK:

_command void test2(int message_number = 0, _str message_text = '') name_info(','VSARG2_MACRO) {
   message(message_number' 'message_text);
}

But this version does not:

_command void test2(int message_number = 0, _str message_text = '')
   name_info(','VSARG2_MACRO)
{
   message(message_number' 'message_text);
}

It gives an error message "Expecting '{'" and puts the cursor after the 'f' in name_info.  The only difference is whitespace, so why the problem?

This one, however, does work:

_command void test2(int message_number = 0, _str message_text = ''
) name_info(','VSARG2_MACRO)
{
   message(message_number' 'message_text);
}

As does this one, without name_info:

_command void test2(int message_number = 0, _str message_text = '')
{
   message(message_number' 'message_text);
}

This example code, from the V12.0.1 help file (in the "name_info Attributes" section), also does not compile:

_command void gui_enumerate()
       name_info(','VSARG2_REQUIRES_EDITORCTL|VSARG2_REQUIRES_AB_SELECTION)
{
    ...
}