version 6.0
Win to Mac (text) String
| Parameter | Type | Description | |
| text | String | Text expressed using Windows ANSI map | |
| Function result | String | Text expressed using Macintosh ASCII map |
Description
The command Win to Mac returns text, expressed using the MacOS ASCII map, equivalent to the text you pass in Text, expressed using the Windows ANSI map.
This command expects a text parameter expressed using the Windows ANSI map.
Generally, when running on Windows, you do not need to use this command to convert ASCII codes. When you copy or paste text between 4D and Windows or when you import or export data, 4D automatically performs these conversions. However, when you use disk read/write commands such as SEND PACKET or RECEIVE PACKET, you need to explicitly invoke ASCII conversions. This is the main purpose of the Win to Mac command.
Within 4D, all the text values, fields, or variables that you have not yet converted to another ASCII map are MacOS-encoded on both Macintosh and Windows. For more information, see the section ASCII Codes.
Example
When you read characters from a Windows document using RECEIVE PACKET, if you do not use an input ASCII map for filtering characters from Windows to MacOS (see USE ASCII MAP), you need to convert the text from Windows to MacOS yourself. You can do it this way:
` ... RECEIVE PACKET ($vhDocRef;vtSomeText;16*1024) vtSomeText:=Win to Mac(vtSomeText) ` ...
See Also
ASCII Codes, Mac to Win, RECEIVE PACKET, USE ASCII MAP.