PA_Unistring*


version 2003


PA_Unistring* PA_GetStringParameter (params; index)

Description

The routine PA_GetStringParameter returns a PA_Unistring pointer that you can access using PA_GetUnistring or PA_SetUnistring to read or write the content of the string of the index parameter in params .

See Create a new plugin for a description of parameter accessors.

NOTE

:
Parameter Type Description
params PA_PluginParameters Parameters received in PluginMain
index short Index of the parameter in params

The first parameter starts at index 1.

Example

Compare 2 strings.

   void PluginMain( long selector, PA_PluginParameters params )
   {
      switch ( selector )
      {
         . . .kInitPlugin, kDeinitPlugin ...
 
         case kMyRoutine :
            MyCompare(params);
            break;
      }
   }
 
   // Declared as expecting a string, a string and returning a long (-1,0,1 for smaller, equal or bigger)
   void MyCompare (PA_PluginParameters params)
   {
      PA_Unistring   *first, *second;
      char   result = 0;
 
   // get the parameters
      first = PA_GetStringParameter(params, 1);
      second = PA_GetStringParameter(params, 2);
   // Compare them
      result = PA_CompareUnistrings( first, second, true, false );
 
      PA_ReturnLong(params, result);
   }

See Also

About strings and characters , Create a new plugin .

Error Handling

PA_GetLastError

keeps the last error that occurred before calling the routine.