Get variable data from function to pass back to main for use.

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Issue trying to solve: I have data in a function where I am reading an xml
file and need to pass back up main to use. I started out using an array but
if there is a better way please let me know. The program works just need
data in availiable in main to store in variables. Please note I did not post
xml function of reading data. it works - trying to keep thread some what
clean versus tons of script.

'******main*******
funReadEnvParametersXML strEnvironment 'function to pass in the
environment to pull from the xml file.

Dim TestArray0
Dim TestArray1

TestArray0 =myarray(0) 'this does work since I am not passing data up.
Don't know how to pass array data back up. comes back NULL now.
TestArray1 =myarray(1) 'this does work since I am not passing data up.
Don't know how to pass array data back up.




'------------------------------------------------------function that reads
in xml
Function funReadEnvParametersXML(strEnvironment)

Set xml = GetEnvParametersXML()
Set Environments = xml.getElementsByTagName("Environment")

For Each Environment In Environments
sEnvironmentId=Environment.Attributes.getNamedItem("Id").value
Counter = 0
Set variables = Environment.getElementsByTagName("variable")

numVariables=variables.length -1
ReDim myarray(numVariables)

If (sEnvironmentId = strEnvironment) Then
For i = 0 To variables.length -1
sName=variables(i).Attributes.getNamedItem("name").value

myarray(i) = sName
Next
WScript.Echo "Array 0........... " & myarray(0)
WScript.Echo "Array 1........... " & myarray(1)

'************************
'I have access to the array results here. How do I pas them back up to the
main.
'************************


End If
Next





End Function


.



Relevant Pages

  • Re: Why do you use XML?
    ... Binary formats have issues such as "endianism" to deal with. ... the importance of XML. ... from a database and send it to a database. ... Do you use it in an environment that rarely goes outside of database ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Forth as "a better XML"
    ... and by Chuck Moore on the subject of XML in Forth or Forth Markup ... The main point I got from Chuck or Dr. Ting was that if you are working ... a foreign environment especially if you are in Forth only environment ...
    (comp.lang.forth)
  • Re: Why do you use XML?
    ... the importance of XML. ... from a database and send it to a database. ... Do you use it in an environment that rarely goes outside of database ... Thinking about a SSV file that contains over 4MB of data - ...
    (microsoft.public.dotnet.languages.csharp)
  • Is it possible to parameterize entities?
    ... I have an XML based report which I load into an XmlDocument object and feed ... variables within the runtime environment). ...
    (microsoft.public.dotnet.xml)
  • Re: What tool to use for processing large documents
    ... cannot parse faster than the disk can read the XML data. ... Reading 10 GB off a disk will take around 3 to 5 minutes ... I forgot to mention that my logs are in zipped xml. ... Get the set of nodes matching an XPath expression. ...
    (comp.text.xml)