KeepMessagesInMemory

Top  Previous  Next

Object: EHL7.HL7File

FileName: EHL7.dll

 

PROPERTY

 

Name: KeepMessagesInMemory

DataType: Boolean (Default True)

Mode: Read/Write

Description: Determines whether hl7 messages in a file are retained in memory as a file object processes a file.  If this property is set to False certain functions will generate errors (see IsError property) MessageCount, GetMessageXML() and so on.  If it is set to True, then you will be limited by available system memory.  If your application is simply going to process the messages 'on the fly' using the events (MessageProcessed, MessageRead, ProcessCompleted) set this property to False to conserve system resources.

 

See Also: MessageCount, GetMessageXML(), GetMessageHL7(), OpenFile(), OpenXMLFile()

 

Example:

'At Class or Form Declaration Level

Private WithEvents myFileObj As EHL7.HL7File

 

'On Initialize or Load

Set myFileObj = New EHL7.HL7File

myFileObj.VendorPath = "C:\EasyHL7"

 

'On Terminate or Unload

Set myFileObj = Nothing

 

'Command Button

Private Sub Command1_Click()

Dim myVendorObj As New EHL7.HL7Vendors

Dim strVendorID As String

Dim iCnt As Long

myFileObj.KeepMessagesInMemory = True

myVendorObj.VendorPath = "C:\EasyHL7"

strVendorID = myVendorObj.GetVendorID("Default","2.3")

'Now open a file

If Not MyFileObj.OpenFile("C:\Test.hl7", strVendorID, -1)

       MsgBox myFileObj.LastError

      myFileObj.ClearErrors

      Exit Sub

End If

iCnt = myFileObj.MessageCount

MsgBox "File contains " & iCnt & " hl7 messages"

    

End Sub