|
![]() |
![]() |
version 2003
PA_ConvertStrings (string1; kind1; charset1; string2; kind2; charset2)
Parameter | Type | Description | |
string1 | char * | → | The string to convert |
kind1 | PA_StringKind | → | Kind of string1 (Pascal or C) |
charset1 | PA_CharSet | → | CharsSet used (Macintosh or ANSI) in string1 |
string2 | char * | ← | The converted string |
kind2 | PA_StringKind | → | Kind of string2 (Pascal or C) |
charset2 | PA_CharSet | → | CharsSet 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.