[API]
RtlMoveMemory

[ASSEMBLY]

[INCLUDE]
TxtFile_ReadOpen
UIntSubUInt

[CODE]
Public Function TxtFile_ReadCompleteString(ByVal hTxtFileIn As Long, ByRef xData As String) As Boolean
  Dim xType1 As TxtFileReadStruct

  xData = ""
  If Not hTxtFileIn = 0& Then
    Call RtlMoveMemory(xType1, ByVal hTxtFileIn, TxtFileReadStructLen)
    If Not xType1.hMem = 0& Then
      hTxtFileIn = xType1.hMemEnd
      UIntSubUInt hTxtFileIn, xType1.hMem
      xData = String(hTxtFileIn / 2&, vbNullChar)
      Call RtlMoveMemory(ByVal StrPtr(xData), ByVal xType1.hMem, hTxtFileIn)
      TxtFile_ReadCompleteString = True
      End If
    End If
  End Function
