Get variable data from function to pass back to main for use.
- From: "Big D" <BigDaddy@xxxxxxxxxxxxxxxx>
- Date: Sat, 21 Mar 2009 08:50:41 -0400
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
.
- Follow-Ups:
- Re: Get variable data from function to pass back to main for use.
- From: Todd Vargo
- Re: Get variable data from function to pass back to main for use.
- Prev by Date: Re: Questio for vbsEdit users : How to designate comand line parameters
- Next by Date: Re: VBScript Debug
- Previous by thread: Show each word of array in a diff line
- Next by thread: Re: Get variable data from function to pass back to main for use.
- Index(es):
Relevant Pages
|