PA_GetDateParameter

4D - Documentation   Français   English   German   4D Plugin API, Command Theme List   4D Plugin API, Command Alphabetical List   Back   Previous   Next

version 2003


PA_GetDateParameter (params; index; day; month; year)

ParameterTypeDescription
paramsPA_PluginParametersParameters received in PluginMain
indexshortIndex of the parameter in params
dayshort *Day of the parameter nb index
monthshort *Month of the parameter nb index
yearshort *Year of the parameter nb index

Description

The routine PA_GetDateParameter returns in day, month and year the corresponding values of the index parameter in params (of type PA_Date)

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

NOTE:

The first parameter starts at index 1.

Example

Get a date stamp.

   void PluginMain( long selector, PA_PluginParameters params )
   {
      switch ( selector )
      {
         . . .kInitPlugin, kDeinitPlugin ...

         case kMyRoutine :
            DoSomethingWithADate(params);
            break;
      }
   }

   void DoSomethingWithADate (PA_PluginParameters params)
   {
      short   day, month, year;
      long   stamp;
   // Get the values. In this sample, first parameter is a date
      PA_GetDateParameter(params, 1, &day, &month, &year);
   // return the stamp
      stamp = (year << 16) | ((month & 0x00FF) << 8) | (day & 0x00FF);
   /*
      . . .
   */
   }

See Also

Create a new plugin, PA_Date.

Error Handling

PA_GetLastError keeps the last error that occurred before calling the routine.


4D - Documentation   Français   English   German   4D Plugin API, Command Theme List   4D Plugin API, Command Alphabetical List   Back   Previous   Next