Basic Examples of how to use SH_NAME_GETPARAMETERS


Example 1:  Find out the name of the current default sorter on node "Joe".

   BMessage msg(SH_COMMAND_GETPARAMETERS);
   msg.AddString(SH_NAME_TO, "/Joe");
   msg.AddString(SH_PARAMNAME_DEFAULTSORTER, "");
 
   BMessage result(A_KNOWN_RESULT_CODE);  // pick a number you will recognize here...
   result.AddString(SH_NAME_TO, "/..");  // self-addressed, this would be appropriate for the main program
   msg.AddMessage(SH_NAME_ONSUCCESS, &result);
   root->PostMessage(&msg);

   // ... now wait for (result) to be sent back to you, with the information you want
   // included in its SH_PARAMNAME_DEFAULTSORTER field.


Example 2:  Find out the current debug printing level on node "Joe".

   BMessage msg(SH_COMMAND_GETPARAMETERS);
   msg.AddString(SH_NAME_TO, "/Joe");
   msg.AddString(SH_PARAMNAME_DEBUG, "");
 
   BMessage result(A_KNOWN_RESULT_CODE);  // pick a number you will recognize here...
   result.AddString(SH_NAME_TO, "/..");  // self-addressed, this would be appropriate for the main program
   msg.AddMessage(SH_NAME_ONSUCCESS, &result);
   root->PostMessage(&msg);

   // ... now wait for (result) to be sent back to you, with the information you want
   // included in its SH_PARAMNAME_DEBUG field.