[INCLUDE]
ctPackage_Update

[CODE]
Public Function ctPackage_CreateRawFileDataContent(ByVal RawData As String, Optional ByVal CanCompress As Boolean = True, Optional ByVal MinimumCompress As Long = ctPackage_MinimumCompressDefault, Optional ByVal ProgressControl As Long = 0&, Optional ByVal ProgressStart As Long = 0&, Optional ByVal ProgressTotal As Long = 0&, Optional ByVal ProgressQueue As Long = 0&) As String
  
  Dim NewFlag As Long
  Dim xChar1 As String
  Dim xLong1 As Long
  Dim xLong2 As Long
  
  xLong1 = Len(RawData)
  #If ctCompressA_Compress Then
    If CanCompress Then
      xChar1 = ctCompressA_Compress(RawData, ProgressControl, ProgressStart, ProgressTotal, ProgressQueue)
      xLong2 = Len(xChar1)
      If xLong2 < MinimumCompress / 100& * xLong1 Or MinimumCompress > 100& Then
        RawData = xChar1
        NewFlag = 1&
        Else
        xLong2 = xLong1
        End If
      Else
      xLong2 = xLong1
    #Else
    xLong2 = xLong1
    #End If
  
  ctPackage_CreateRawFileDataContent = Chr(NewFlag) & String(4, vbNullChar) & ctPackage_LenLongToChar(xLong2) & ctPackage_LenLongToChar(xLong1) & RawData
  End Function
