Skip to main content

TrFile_AsciiValueToText (function reference)

By June 1, 2024June 4th, 2024Online Help, Troi File Plug-in
Troi File Plug-in > Functions reference > TrFile_AsciiValueToText
Troi File Plug-in for FileMaker Pro

TrFile_AsciiValueToText

Converts (one or more) numbers to their equivalent ASCII characters.

SyntaxFunction badge

TrFile_AsciiValueToText ( switches ; ASCIIvalues { ; separator } )

Parameters

switches these alter the behavior of the function
ASCIIvalues one or more numbers in the range from 0-255 separated by a separator
separator (optional) the separator between the values, if you omit this parameter " " and | is used

Switches

Switches can be empty or one of this:

-Encoding=Native (default) use Unicode encoding for the higher ASCII’s 128-255
-Encoding=ASCII_Mac use Mac ASCII for the higher ASCII’s 128-255 (as used in FMP 6)

Returned Result

Data type returned

Text

Result

The converted ASCII text

Originated in

Troi File Plug-in 4.0

Compatibility

FileMaker Pro 17 to FileMaker Pro 21 (2024)

Considerations

You can also use hexadecimal notation for the numbers. Use 0x00…0xFF to indicate hexadecimal notation.
The graphic rendition of characters greater than 127 is undefined in the American Standard Code for Information Interchange (ASCII Standard) and varies from font to font and from computer to computer and may look different when printed.
Values higher than 255 are ignored.

This function is the same as the Serial_AsciiValueToText in the Troi Serial Plug-in.

Example

Set Field [ text ; TrFile_AsciiValueToText ( "-Unused" ; "65 65 80 13" ) ]

or

Set Field [ text ; TrFile_AsciiValueToText ( "-Unused" ; "65|65|80|13" ) ]

This will both result in the text “AAP<CR>” where <CR> is a Carriage Return character

Example 2

Set Field [ text ; TrFile_AsciiValueToText ( "-Unused" ; "0x31-0x32-0x33-0x0D-0x0A" ; "-" ) ]

This will result in the text “123<CR><LF>” where <CR> is a Carriage Return and <LF> is a Line Feed character.

Example 3

The switch -Encoding=ASCII_Mac is to be able to encode all 256 values possible in FileMaker Pro 6 to their converted values in FileMaker Pro 7 and later. For example the Apple Logo character  with Mac ASCII code 240 is converted to Unicode 63743 in FileMaker 7.

Set Field [ text ; TrFile_AsciiValueToText ( "-Encoding=ASCII_Mac" ; "240" ) ]

This will result in the text “”.

Used in example file

MakeASCIIs.fmp12

Related topics

Troi File Plug-in online help (overview)


Online Help Page for Troi File Plug-in for 17 to 2024 –> TrFile_AsciiValueToText (filep4294) 2024-0604 19:19:52