1 Replies - 1249 Views - Last Post: 22 July 2013 - 12:42 PM Rate Topic: -----

#1 sasch2486   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 22-July 13

inserting a double-array in an object-array

Posted 22 July 2013 - 08:44 AM

Public Function xXML(Filepath As String) As Object()

	Set objParser = CreateObject("Microsoft.XMLDOM")

	Dim xDoc As MSXML2.DOMDocument
	Dim NodeList As IXMLDOMNodeList
	Dim Node As MSXML2.IXMLDOMElement

	Dim ObjTempArray(40) As Object

	Set xDoc = New MSXML2.DOMDocument

	'Prooves whether the document is a valid XML document.
	xDoc.validateOnParse = True

	'DTD = Document Type Definition

	If xDoc.load(Filepath) = False Then
		MsgBox ("Unable to load File.",vbExclamation,OCC)
		MsgBox(Filepath+" succesfully loaded!",vbInformation,OCC)
		StartAutomation = MsgBox ("Start Test-Automation?",vbOKCancel,OCC)

		If StartAutomation = vbCancel Then
			MsgBox("Test-Automation canceled.",vbInformation,OCC)

			'Reading the *.cid file
			MsgBox("Automation Start!",vbInformation,OCC)

		'	Set NodeList = xDoc.documentElement.selectNodes("//catalog/book/author")
			Set NodeList = xDoc.documentElement.selectNodes("//SCL/IED/AccessPoint/Server/LDevice/LN")

			For Each Node In NodeList

				NodeType = Node.getAttribute("lnClass")

				If NodeType = "PTOC" Then

					'Name of array is PTOC

					Dim PTOC(2) As Double

					PTOC(0) = 1
					PTOC(1) = 1
					PTOC(2) = 1

					ObjTempArray(0) = PTOC()


				End If


			xXML = ObjTempArray

			x = NodeList.length

		End If
	End If

End Function

Hi Everyone,

Hi Everyone,

i got an error when trying to set the first element of the objtemparray( ObjTempArray(0) = PTOC)
The Error is: Object var is 'Nothing'

I m trying for an hour now and cant guess of my mistake, if anyone can tell me where my mistake is i would be very thankful. :-)

best regards


Is This A Good Question/Topic? 0
  • +

Replies To: inserting a double-array in an object-array

#2 maj3091   User is offline

  • D.I.C Lover
  • member icon

Reputation: 330
  • View blog
  • Posts: 1,997
  • Joined: 26-March 09

Re: inserting a double-array in an object-array

Posted 22 July 2013 - 12:42 PM

Not exactly sure what this function does or why you've declared it as an object type array.

If you want to store another array, if you declare it as variant type, then that should work.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1