home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 September / Chip_2002-09_cd1.bin / zkuste / vbasic / Data / Utils / XZipComp.exe / XceedEncoding.Cab / F112908_MemoryEncode.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-05-11  |  23.5 KB  |  537 lines

  1. VERSION 5.00
  2. Begin VB.Form frmMemoryEncode 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Memory Encoding"
  5.    ClientHeight    =   4530
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   10080
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   4530
  13.    ScaleWidth      =   10080
  14.    StartUpPosition =   3  'Windows Default
  15.    Begin VB.TextBox txtMaxLineLength 
  16.       Height          =   315
  17.       Left            =   1725
  18.       TabIndex        =   2
  19.       Text            =   "78"
  20.       Top             =   900
  21.       Width           =   990
  22.    End
  23.    Begin VB.ComboBox cboEndOfLineType 
  24.       Height          =   315
  25.       Left            =   1725
  26.       Style           =   2  'Dropdown List
  27.       TabIndex        =   1
  28.       Top             =   525
  29.       Width           =   3240
  30.    End
  31.    Begin VB.CommandButton cmdQuit 
  32.       Cancel          =   -1  'True
  33.       Caption         =   "Quit"
  34.       Height          =   390
  35.       Left            =   8850
  36.       TabIndex        =   7
  37.       Top             =   4050
  38.       Width           =   1140
  39.    End
  40.    Begin VB.ComboBox cboEncodingMethod 
  41.       Height          =   315
  42.       Left            =   1725
  43.       Style           =   2  'Dropdown List
  44.       TabIndex        =   0
  45.       Top             =   150
  46.       Width           =   3240
  47.    End
  48.    Begin VB.TextBox txtEncodedText 
  49.       BeginProperty Font 
  50.          Name            =   "Courier New"
  51.          Size            =   8.25
  52.          Charset         =   0
  53.          Weight          =   400
  54.          Underline       =   0   'False
  55.          Italic          =   0   'False
  56.          Strikethrough   =   0   'False
  57.       EndProperty
  58.       Height          =   1815
  59.       Left            =   5625
  60.       MultiLine       =   -1  'True
  61.       ScrollBars      =   2  'Vertical
  62.       TabIndex        =   5
  63.       Top             =   1725
  64.       Width           =   4365
  65.    End
  66.    Begin VB.CommandButton cmdDecode 
  67.       Caption         =   "<< Decode"
  68.       Height          =   540
  69.       Left            =   4500
  70.       TabIndex        =   6
  71.       Top             =   2850
  72.       Width           =   990
  73.    End
  74.    Begin VB.CommandButton cmdEncode 
  75.       Caption         =   "Encode >>"
  76.       Height          =   540
  77.       Left            =   4500
  78.       TabIndex        =   4
  79.       Top             =   1875
  80.       Width           =   990
  81.    End
  82.    Begin VB.TextBox txtDecodedText 
  83.       Height          =   1815
  84.       Left            =   150
  85.       MultiLine       =   -1  'True
  86.       ScrollBars      =   2  'Vertical
  87.       TabIndex        =   3
  88.       Text            =   "MemoryEncode.frx":0000
  89.       Top             =   1725
  90.       Width           =   4215
  91.    End
  92.    Begin VB.Label lbl 
  93.       Caption         =   "Max line length"
  94.       Height          =   240
  95.       Index           =   6
  96.       Left            =   150
  97.       TabIndex        =   16
  98.       Top             =   900
  99.       Width           =   1440
  100.    End
  101.    Begin VB.Label lbl 
  102.       Caption         =   "End of line type"
  103.       Height          =   240
  104.       Index           =   5
  105.       Left            =   150
  106.       TabIndex        =   15
  107.       Top             =   525
  108.       Width           =   1440
  109.    End
  110.    Begin VB.Label lbl 
  111.       Caption         =   "Encoding method"
  112.       Height          =   240
  113.       Index           =   4
  114.       Left            =   150
  115.       TabIndex        =   14
  116.       Top             =   150
  117.       Width           =   1440
  118.    End
  119.    Begin VB.Label lblDecodedSize 
  120.       Caption         =   "0"
  121.       ForeColor       =   &H00C00000&
  122.       Height          =   240
  123.       Left            =   1350
  124.       TabIndex        =   13
  125.       Top             =   3675
  126.       Width           =   690
  127.    End
  128.    Begin VB.Label lbl 
  129.       Caption         =   "Decoded size"
  130.       Height          =   240
  131.       Index           =   3
  132.       Left            =   150
  133.       TabIndex        =   12
  134.       Top             =   3675
  135.       Width           =   1065
  136.    End
  137.    Begin VB.Label lbl 
  138.       Caption         =   "Encoded text"
  139.       Height          =   240
  140.       Index           =   2
  141.       Left            =   5625
  142.       TabIndex        =   11
  143.       Top             =   1500
  144.       Width           =   2865
  145.    End
  146.    Begin VB.Label lblEncodedSize 
  147.       Caption         =   "0"
  148.       ForeColor       =   &H00C00000&
  149.       Height          =   240
  150.       Left            =   7050
  151.       TabIndex        =   10
  152.       Top             =   3675
  153.       Width           =   915
  154.    End
  155.    Begin VB.Label lbl 
  156.       Caption         =   "Encoded size"
  157.       Height          =   240
  158.       Index           =   1
  159.       Left            =   5625
  160.       TabIndex        =   9
  161.       Top             =   3675
  162.       Width           =   1290
  163.    End
  164.    Begin VB.Label lbl 
  165.       Caption         =   "Decoded text"
  166.       Height          =   240
  167.       Index           =   0
  168.       Left            =   150
  169.       TabIndex        =   8
  170.       Top             =   1500
  171.       Width           =   2865
  172.    End
  173. Attribute VB_Name = "frmMemoryEncode"
  174. Attribute VB_GlobalNameSpace = False
  175. Attribute VB_Creatable = False
  176. Attribute VB_PredeclaredId = True
  177. Attribute VB_Exposed = False
  178. ' Xceed Binary Encoding Library - Memory Encode sample
  179. ' Copyright (c) 2001 Xceed Software Inc.
  180. ' [MemoryEncode.frm]
  181. ' This form module contains the main form's code. It demonstrates how to
  182. ' encode a chunk of memory data using different kinds of encoding methods,
  183. ' and decode an encoded memory data. It specifically uses:
  184. '  - The Encode and Decode method.
  185. '  - The ContinueOnInvalidData, IncludeHeaderFooter, EndOfLineType, MaxLineLength,
  186. '    HeaderDataForkLength, HeaderResourceForkLength and EncodingFormat propeties.
  187. ' This file is part of the Xceed Binary Encoding Library sample applications.
  188. ' The source code in this file is only intended as a supplement to Xceed
  189. ' Binary Encoding Library's documentation, and is provided "as is", without
  190. ' warranty of any kind, either expressed or implied.
  191. Option Explicit
  192. 'The different encoding methods that will serve to populate the combo box
  193. Private Enum enuEncodingMethod
  194.     emUUEncode = 0
  195.     emXXEncode = 1
  196.     emHexadecimal = 2
  197.     emBase64 = 3
  198.     emQuotedPrintable = 4
  199.     emBinHex = 5
  200. End Enum
  201. '====================================================================================
  202. ' EVENTS - triggered by the form and its controls
  203. '====================================================================================
  204. '------------------------------------------------------------------------------------
  205. 'Do the encoding of the original text
  206. '------------------------------------------------------------------------------------
  207. Private Sub cmdEncode_Click()
  208.     Dim xEncoder As XceedBinaryEncoding
  209.     Dim zDecodedText As Variant
  210.     Dim lErrorNumber As Long
  211.     Dim vaEncoded As Variant
  212.     'Create an instance of the Xceed binary encoding
  213.     Set xEncoder = New XceedBinaryEncoding
  214.     With xEncoder
  215.         'Create and prepare the encoding format (XX, UU, BinHex, ...)
  216.         If PrepareEncodingFormat(xEncoder) Then
  217.             'Convert unicode text to an ascii string
  218.             'Useful to reduce the output encoded string, but it could
  219.             'be skipped
  220.             zDecodedText = StrConv(txtDecodedText.Text, vbFromUnicode)
  221.             
  222.             On Error Resume Next
  223.                 'Encode the ascii string, specifying that (True parameter)
  224.                 'this is the end of data (there will be no more calls to Encode).
  225.                 vaEncoded = .Encode(zDecodedText, True)
  226.                 
  227.                 lErrorNumber = Err.Number
  228.                 If lErrorNumber <> 0 Then
  229.                     Call MsgBox("Error during Encode." & vbCrLf & Err.Description & " (" & Hex(Err.Number) & ")")
  230.                 End If
  231.             On Error GoTo 0
  232.         Else
  233.             'An error occured, we don't know which one, we don't care as it was
  234.             'already shown to the user. We set the error code to an arbitrary
  235.             'value of 1.
  236.             lErrorNumber = 1
  237.         End If
  238.         
  239.         If lErrorNumber = 0 Then
  240.             If IsEmpty(vaEncoded) Then
  241.                 'No output was produced
  242.                 txtEncodedText.Text = ""
  243.                 lblEncodedSize.Caption = "0"
  244.             Else
  245.                 'Display the encoded result in the text box and show
  246.                 'the encoded string size. We convert the ascii string
  247.                 'returned by the Encode method to Unicode so that the
  248.                 'encoded text box will contained something readable.
  249.                 txtEncodedText.Text = StrConv(vaEncoded, vbUnicode)
  250.                 lblEncodedSize.Caption = CStr(UBound(vaEncoded) + 1)
  251.             End If
  252.         End If
  253.     End With
  254.     'Deallocate the Encoding object. The encoding object will free
  255.     'the EncodingFormat object.
  256.     Set xEncoder = Nothing
  257. End Sub
  258. '------------------------------------------------------------------------------------
  259. 'Do the decoding of the encoded text
  260. '------------------------------------------------------------------------------------
  261. Private Sub cmdDecode_Click()
  262.     Dim xEncoder As XceedBinaryEncoding
  263.     Dim zEncodedText As Variant
  264.     Dim lErrorNumber As Long
  265.     Dim vaDecoded As Variant
  266.     'Create an instance of the Xceed binary encoding
  267.     Set xEncoder = New XceedBinaryEncoding
  268.     With xEncoder
  269.         'Create and prepare the encoding format (XX, UU, BinHex, ...)
  270.         If PrepareDecodingFormat(xEncoder) Then
  271.             'Convert unicode text to an ascii string
  272.             'Mandatory as the Decode method will expect an ascii string
  273.             'as input.
  274.             zEncodedText = StrConv(txtEncodedText.Text, vbFromUnicode)
  275.             
  276.             On Error Resume Next
  277.                 'Decode the ascii encoded string, specifying that (True parameter)
  278.                 'this is the end of data (there will be no more calls to Decode).
  279.                 vaDecoded = .Decode(zEncodedText, True)
  280.                 
  281.                 lErrorNumber = Err.Number
  282.                 If lErrorNumber <> 0 Then
  283.                     Call MsgBox("Error during Encode." & vbCrLf & Err.Description & " (" & Hex(Err.Number) & ")")
  284.                 End If
  285.             On Error GoTo 0
  286.         Else
  287.             'An error occured, we don't know which one and we don't care for it was
  288.             'already shown to the user. We set the error code to an arbitrary
  289.             'value of 1.
  290.             lErrorNumber = 1
  291.         End If
  292.         
  293.         If lErrorNumber = 0 Then
  294.             If IsEmpty(vaDecoded) Then
  295.                 'No output was produced
  296.                 txtDecodedText.Text = ""
  297.                 lblDecodedSize.Caption = "0"
  298.             Else
  299.                 'Display the decoded result in the text box and show
  300.                 'the decoded string size. We convert the ascii string
  301.                 'returned by the Decode method to Unicode so that the
  302.                 'decoded text box will contained something readable.
  303.                 'If we had not convert the decoded string in the Encode
  304.                 'process (to reduce the output encoded string), we
  305.                 'would simply assign the vaDecoded to the txtDecodedText.
  306.                 txtDecodedText.Text = StrConv(vaDecoded, vbUnicode)
  307.                 lblDecodedSize.Caption = CStr(UBound(vaDecoded) + 1)
  308.             End If
  309.         End If
  310.     End With
  311.     'Deallocate the Encoding object. The encoding object will free
  312.     'the EncodingFormat object.
  313.     Set xEncoder = Nothing
  314. End Sub
  315. '------------------------------------------------------------------------------------
  316. 'Quit the sample application
  317. '------------------------------------------------------------------------------------
  318. Private Sub cmdQuit_Click()
  319.     End
  320. End Sub
  321. '------------------------------------------------------------------------------------
  322. 'Initialize the decoded size label and fill the 2 combo boxes
  323. '------------------------------------------------------------------------------------
  324. Private Sub Form_Load()
  325.     lblDecodedSize.Caption = CStr(Len(txtDecodedText.Text))
  326.     With cboEncodingMethod
  327.         Call .AddItem("UU encoding", emUUEncode)
  328.         Call .AddItem("XX encoding", emXXEncode)
  329.         Call .AddItem("Hexadecimal", emHexadecimal)
  330.         Call .AddItem("Base 64", emBase64)
  331.         Call .AddItem("Quoted printable", emQuotedPrintable)
  332.         Call .AddItem("BinHex", emBinHex)
  333.         .ListIndex = emUUEncode
  334.     End With
  335.     With cboEndOfLineType
  336.         Call .AddItem("None", bltNone)
  337.         Call .AddItem("Carriage return/line feed", bltCrLf)
  338.         Call .AddItem("Line feed", bltLf)
  339.         Call .AddItem("Carriage return", bltCr)
  340.         .ListIndex = bltNone
  341.     End With
  342. End Sub
  343. '------------------------------------------------------------------------------------
  344. 'Update the decoded size label when the user modify the decoded text box content
  345. '------------------------------------------------------------------------------------
  346. Private Sub txtDecodedText_Change()
  347.     lblDecodedSize.Caption = CStr(Len(txtDecodedText.Text))
  348. End Sub
  349. '------------------------------------------------------------------------------------
  350. 'Update the encoded size label when the user modify the encoded text box content
  351. '------------------------------------------------------------------------------------
  352. Private Sub txtEncodedText_Change()
  353.     lblEncodedSize.Caption = CStr(Len(txtEncodedText.Text))
  354. End Sub
  355. '====================================================================================
  356. ' FUNCTIONS
  357. '====================================================================================
  358. '------------------------------------------------------------------------------------
  359. 'Prepare the encoding format according to the user selection
  360. 'Return True if all succeeded
  361. '------------------------------------------------------------------------------------
  362. Private Function PrepareEncodingFormat(ByRef xEncoder As XceedBinaryEncoding) As Boolean
  363.     'We use one variable for each encoding format to simplify the programming
  364.     '(code completion). Only one of these will be used at a time (according to
  365.     'the chosen encoding method in the combo box).
  366.     'To see an example of how it could be done without all these declarations,
  367.     'consult the Manager sample application.
  368.     Dim xUUFormat As XceedUUEncodingFormat
  369.     Dim xXXFormat As XceedXXEncodingFormat
  370.     Dim xHexaFormat As XceedHexaEncodingFormat
  371.     Dim xBase64Format As XceedBase64EncodingFormat
  372.     Dim xQPFormat As XceedQuotedPrintableEncodingFormat
  373.     Dim xBinHexFormat As XceedBinHexEncodingFormat
  374.     Dim bPrepareOK As Boolean
  375.     bPrepareOK = True
  376.     On Error Resume Next
  377.         Select Case cboEncodingMethod.ListIndex
  378.             Case emUUEncode
  379.                 Set xUUFormat = New XceedUUEncodingFormat
  380.                 'We don't want any header/footer for this is only a memory encoding
  381.                 'process. The header/footer are mainly useful with files.
  382.                 xUUFormat.IncludeHeaderFooter = False
  383.                 xUUFormat.EndOfLineType = cboEndOfLineType.ListIndex
  384.                 'Set the maximum line length specified by the user. This is a mandatory
  385.                 'value as the EndOfLineType can not be None for UUEncoding.
  386.                 xUUFormat.MaxLineLength = CLng(txtMaxLineLength.Text)
  387.                 'Set the previously initialized Encoding format of the Encoder object
  388.                 'received as a parameter of this function.
  389.                 Set xEncoder.EncodingFormat = xUUFormat
  390.                 'Free the temporary encoding format. The previous assignation adding
  391.                 'a reference to the encoding format object, this object will effectively
  392.                 'be freed by the xEncoder object when the latter will be freed.
  393.                 Set xUUFormat = Nothing
  394.             
  395.             Case emXXEncode
  396.                 Set xXXFormat = New XceedXXEncodingFormat
  397.                 'We don't want any header/footer for this is only a memory encoding
  398.                 'process. The header/footer are mainly useful with files.
  399.                 xXXFormat.IncludeHeaderFooter = False
  400.                 xXXFormat.EndOfLineType = cboEndOfLineType.ListIndex
  401.                 'Set the maximum line length specified by the user. This is a mandatory
  402.                 'value as the EndOfLineType can not be None for XXEncoding.
  403.                 xXXFormat.MaxLineLength = CLng(txtMaxLineLength.Text)
  404.                 Set xEncoder.EncodingFormat = xXXFormat
  405.                 Set xXXFormat = Nothing
  406.             
  407.             Case emHexadecimal
  408.                 Set xHexaFormat = New XceedHexaEncodingFormat
  409.                 xHexaFormat.EndOfLineType = cboEndOfLineType.ListIndex
  410.                 'Set the maximum line length specified by the user. This value will
  411.                 'be ignored by the Xceed Binary Encoding Library if the End of line
  412.                 'type is set to None
  413.                 xHexaFormat.MaxLineLength = CLng(txtMaxLineLength.Text)
  414.                 Set xEncoder.EncodingFormat = xHexaFormat
  415.                 Set xHexaFormat = Nothing
  416.             
  417.             Case emBase64
  418.                 Set xBase64Format = New XceedBase64EncodingFormat
  419.                 xBase64Format.EndOfLineType = cboEndOfLineType.ListIndex
  420.                 'Set the maximum line length specified by the user. This value will
  421.                 'be ignored by the Xceed Binary Encoding Library if the End of line
  422.                 'type is set to None
  423.                 xBase64Format.MaxLineLength = CLng(txtMaxLineLength.Text)
  424.                 Set xEncoder.EncodingFormat = xBase64Format
  425.                 Set xBase64Format = Nothing
  426.             
  427.             Case emQuotedPrintable
  428.                 Set xQPFormat = New XceedQuotedPrintableEncodingFormat
  429.                 xQPFormat.EndOfLineType = cboEndOfLineType.ListIndex
  430.                 'Set the maximum line length specified by the user. This value will
  431.                 'be ignored by the Xceed Binary Encoding Library if the End of line
  432.                 'type is set to None
  433.                 xQPFormat.MaxLineLength = CLng(txtMaxLineLength.Text)
  434.                 Set xEncoder.EncodingFormat = xQPFormat
  435.                 Set xQPFormat = Nothing
  436.             
  437.             Case emBinHex
  438.                 Set xBinHexFormat = New XceedBinHexEncodingFormat
  439.                 xBinHexFormat.EndOfLineType = cboEndOfLineType.ListIndex
  440.                 'Set the maximum line length specified by the user. This value will
  441.                 'be ignored by the Xceed Binary Encoding Library if the End of line
  442.                 'type is set to None
  443.                 xBinHexFormat.MaxLineLength = CLng(txtMaxLineLength.Text)
  444.                 
  445.                 'For the BinHex format, we must specify the data fork length and the
  446.                 'resource fork length.
  447.                 'The DataForkLength is mandatory and must be set to the size
  448.                 'of the data that will be encoded.
  449.                 xBinHexFormat.HeaderDataForkLength = Len(txtDecodedText.Text)
  450.                 'The ResourceForkLength, used by MAC system, is not relevant
  451.                 'under a PC system. We set it to 0.
  452.                 xBinHexFormat.HeaderResourceForkLength = 0
  453.                 
  454.                 'We don't want any formating for this is only a memory encoding
  455.                 'process. The formating are mainly useful with files.
  456.                 xBinHexFormat.IncludeHeaderFooter = False
  457.                 Set xEncoder.EncodingFormat = xBinHexFormat
  458.                 Set xBinHexFormat = Nothing
  459.         End Select
  460.         
  461.         If Err.Number <> 0 Then
  462.             bPrepareOK = False
  463.             Call MsgBox("Error during encoding format initialization." & vbCrLf & Err.Description & " (" & Hex(Err.Number) & ")")
  464.         End If
  465.     On Error GoTo 0
  466.     PrepareEncodingFormat = bPrepareOK
  467. End Function
  468. '------------------------------------------------------------------------------------
  469. 'Prepare the decoding format according to the user selection
  470. 'Return True if all succeeded
  471. '------------------------------------------------------------------------------------
  472. Private Function PrepareDecodingFormat(ByRef xEncoder As XceedBinaryEncoding) As Boolean
  473.     'We use one variable for each decoding format to simplify the programming
  474.     '(code completion). Only one of these will be used at a time (according to
  475.     'the chosen encoding method in the combo box).
  476.     'To see an example of how it could be done without all these declarations,
  477.     'consult the Manager sample application.
  478.     Dim xUUFormat As XceedUUEncodingFormat
  479.     Dim xXXFormat As XceedXXEncodingFormat
  480.     Dim xHexaFormat As XceedHexaEncodingFormat
  481.     Dim xBase64Format As XceedBase64EncodingFormat
  482.     Dim xQPFormat As XceedQuotedPrintableEncodingFormat
  483.     Dim xBinHexFormat As XceedBinHexEncodingFormat
  484.     Dim bPrepareOK As Boolean
  485.     bPrepareOK = True
  486.     On Error Resume Next
  487.         Select Case cboEncodingMethod.ListIndex
  488.             Case emUUEncode
  489.                 Set xUUFormat = New XceedUUEncodingFormat
  490.                 'The encoded string does not contain any header/footer
  491.                 'The header/footer are usually present only in files.
  492.                 xUUFormat.IncludeHeaderFooter = False
  493.                 'We want to ignore any invalid encoded characters
  494.                 xUUFormat.ContinueOnInvalidData = True
  495.                 Set xEncoder.EncodingFormat = xUUFormat
  496.                 Set xUUFormat = Nothing
  497.             Case emXXEncode
  498.                 Set xXXFormat = New XceedXXEncodingFormat
  499.                 'The encoded string does not contain any header/footer
  500.                 'The header/footer are usually present only in files.
  501.                 xXXFormat.IncludeHeaderFooter = False
  502.                 xXXFormat.ContinueOnInvalidData = True
  503.                 Set xEncoder.EncodingFormat = xXXFormat
  504.                 Set xXXFormat = Nothing
  505.             Case emHexadecimal
  506.                 Set xHexaFormat = New XceedHexaEncodingFormat
  507.                 xHexaFormat.ContinueOnInvalidData = True
  508.                 Set xEncoder.EncodingFormat = xHexaFormat
  509.                 Set xHexaFormat = Nothing
  510.             Case emBase64
  511.                 Set xBase64Format = New XceedBase64EncodingFormat
  512.                 xBase64Format.ContinueOnInvalidData = True
  513.                 Set xEncoder.EncodingFormat = xBase64Format
  514.                 Set xBase64Format = Nothing
  515.             Case emQuotedPrintable
  516.                 Set xQPFormat = New XceedQuotedPrintableEncodingFormat
  517.                 xQPFormat.ContinueOnInvalidData = True
  518.                 Set xEncoder.EncodingFormat = xQPFormat
  519.                 Set xQPFormat = Nothing
  520.             Case emBinHex
  521.                 Set xBinHexFormat = New XceedBinHexEncodingFormat
  522.                 'The encoded string does not contain any formating
  523.                 'The formating are usually present only in files.
  524.                 xBinHexFormat.IncludeHeaderFooter = False
  525.                 xBinHexFormat.ContinueOnInvalidData = True
  526.                 Set xEncoder.EncodingFormat = xBinHexFormat
  527.                 Set xBinHexFormat = Nothing
  528.         End Select
  529.         
  530.         If Err.Number <> 0 Then
  531.             bPrepareOK = False
  532.             Call MsgBox("Error during decoding format initialization." & vbCrLf & Err.Description & " (" & Hex(Err.Number) & ")")
  533.         End If
  534.     On Error GoTo 0
  535.     PrepareDecodingFormat = bPrepareOK
  536. End Function
  537.