Mac to Win

4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next

version 11 (Modified)


Mac to Win (text) String

ParameterTypeDescription
textStringText expressed using Mac OS ASCII map
Function resultStringText expressed using Windows ANSI map

Compatibility Note: This command only works when the database is executed in ASCII compatibility mode. In Unicode mode, it does nothing (the text string is returned without modification). Beginning with version 11 of 4D, this command is thus obsolete and its use is no longer recommended. It is recommended to convert character strings using the CONVERT FROM TEXT or Convert to text commands.

Description

The Mac to Win command returns a text expressed using the Windows ANSI map that is equivalent to the text you pass in text, which is expressed using the Mac OS ASCII map.

This command expects a Text type parameter that is expressed using the Mac OS ASCII map.

Generally, when running on Windows, you do not need to use this command to convert ASCII codes. In ASCII compatibility mode (non-Unicode), 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 perform ASCII conversions. This is the main purpose of the Mac to Win command.

Within 4D, all the text values, fields, or variables that you have not yet converted to another ASCII map are Mac OS-encoded on both Macintosh and Windows. For more information, see the section ASCII Codes.

Note: This command replaces the CR (Carriage return) characters with CRLF (Carriage return + Line feed, ASCII codes 13 and 10) characters. Consequently, the text returned may be longer than the original text.

Example

On Windows, when you write characters into a document using SEND PACKET, if you do not use an output ASCII map for filtering characters from Mac OS to Windows (see USE CHARACTER SET), you need to convert the text from Mac OS to Windows yourself. You can do it this way:

      ` ...
   SEND PACKET ($vhDocRef;Mac to Win(vtSomeText))
      ` ...

See Also

ASCII Codes, SEND PACKET, USE CHARACTER SET, Win to Mac.


4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next