PA_ConvertStrings

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

version 2003


PA_ConvertStrings (string1; kind1; charset1; string2; kind2; charset2)

ParameterTypeDescription
string1char *The string to convert
kind1PA_StringKindKind of string1 (Pascal or C)
charset1PA_CharSetCharsSet used (Macintosh or ANSI) in string1
string2char *The converted string
kind2PA_StringKindKind of string2 (Pascal or C)
charset2PA_CharSetCharsSet used (Macintosh or ANSI) in string2

Description

The routine PA_ConvertStrings converts the string string1 to the string string2.

Pass in string1 the string to convert, in kind1 its kind and in charset1 its chars set. Kinds and CharsSets are enums, defined in PublicTypes.h as:

typedef enum
{
   eSK_CString = 0,
   eSK_PString
} PA_StringKind;

typedef enum
{
   eCS_Macintosh = 0,
   eCS_Ansi,
   eCS_Unicode
} PA_CharSet;

Pass a buffer to the converted string in string2, and in the format and charset types you want string1 to be converted kind2 and charset2.

Example

Pascal to C string conversion using the default characters settings.

   void MyPascalToCString(char *pStr, char *cStr)
   {
   #if VERSIONMAC
      PA_ConvertStrings(pStr, eSK_PString, eCS_Macintosh,
                        cStr, eSK_CString, eCS_Macintosh);
   #endif
   #if VERSIONWIN
      PA_ConvertStrings(pStr, eSK_PString, eCS_Ansi, 
                        cStr, eSK_CString, eCS_Ansi);
   #endif
   }

See Also

No reference.

Error Handling

None.


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