DMFontEncode Function

Navigation:  Crystal Reports > UFL Functions >

DMFontEncode Function

Previous pageReturn to chapter overviewNext page

Encodes a string using DataMatrix format.

Public Function DMFontEncode(ByVal Message As String, _

                                              ByVal Mode As Integer, _

                                              ByVal PreferredFormat As Integer, _

                                              ByVal HandleTilde As Boolean) As Integer

Parameters

Message

     String to be encoded using DataMatrix format.

Mode

     Indicates which encoding mode is used, this parameter can be one of the following values.

Value

Comment

0

Auto mode for optimized encoding

1

ASCII encoding mode

2

C40 encoding mode

3

Text encoding mode

4

Base256 encoding mode

PreferredFormat

     Indicates which format is used, the values of all formats are listed here.

HandleTilde

    Indicates whether to process the tilde character "~" or not, the detailed description is:

o"~1" is used to represent the FNC1 code.

o"~2" is used to represent the Structured Append and must be followed by a 3-digit number between 1 and 255.

o"-3" is used only at the very beginning of the symbol for the reader programming purpose.

o"~5" is used only at the very beginning of the symbol, the header [)> + ASCII 30 + ASCII 05 + ASCII 29 will be transmitted by the barcode reader before the data in the message and the trailer ASCII 30 + ASCII 4 will be transmitted afterwards.

o"~6" is used only at the very beginning of the symbol, the header [)> + ASCII 30 + ASCII 06 + ASCII 29 will be transmitted by the barcode reader before the data in the message and the trailer ASCII 30 + ASCII 4 will be transmitted afterwards.

o"~7NNNNNN" is used to specify the Extended Channel and NNNNNN is a value between 000000 and 999999.

o"~dNNN" is used to represent the ASCII character with the value of NNN.

 

Return Value

Number of DataMatrix format string blocks. Each block has 254 characters, the only exception is that last block might contain <254 characters. Since Crystal Reports UFL function only allows the returned string with maximum 254 characters, we have to build entire DataMatrix format string by concatenating all blocks together.