M
Maurice
Hi guys,
Just wondering if someone can help me with the following situation.
I'm working on this template that needs to be filled with data. The data and
macro are kicked of via a vbscript which has among others the line:
..run "Main", "Array("test", "option", "answer","name","")"
This refers to Main which is the name of the routine and the second set
provides the data. This would be an Array of data.
The question I have is how to provide the template with the correct argument
for the array so i can treat it as an array.
So fa I came up with this:
Private sub Main (arrTest as Variant)
dim x as integer
for x=0 to ubound(arrTest)
debug.print arrTest(x)
next
end sub
i do use the IsArray option to check if it's an array which tells me it's not.
This doesn't work because it's giving me a datatype error. When changing it
i can get it to read the total string but then i want to be able to point to
the certain elements of the string for instance debug the third element like:
debug.print arrTest(2,x) '-is this correct?
Furthermore i'm thinking that if some records for a database are handled
like this how does one go about finding the next record in the array? Let's
say in the example above if the second record would start at the "answer"
field. My guess would be that it has to be unique to be determined what the
next record would be right?
So one final question... what does an array look like when exported to a
textfile. The above sample is provided to me to work with. It's created via
Java. So the normal output of an array would look like:
"option1", "option2", "option3" etc..
or
"Option1, Option2, Option3" etc...
Hope someone can shed some light on this one for me i'm stumbled.
Just wondering if someone can help me with the following situation.
I'm working on this template that needs to be filled with data. The data and
macro are kicked of via a vbscript which has among others the line:
..run "Main", "Array("test", "option", "answer","name","")"
This refers to Main which is the name of the routine and the second set
provides the data. This would be an Array of data.
The question I have is how to provide the template with the correct argument
for the array so i can treat it as an array.
So fa I came up with this:
Private sub Main (arrTest as Variant)
dim x as integer
for x=0 to ubound(arrTest)
debug.print arrTest(x)
next
end sub
i do use the IsArray option to check if it's an array which tells me it's not.
This doesn't work because it's giving me a datatype error. When changing it
i can get it to read the total string but then i want to be able to point to
the certain elements of the string for instance debug the third element like:
debug.print arrTest(2,x) '-is this correct?
Furthermore i'm thinking that if some records for a database are handled
like this how does one go about finding the next record in the array? Let's
say in the example above if the second record would start at the "answer"
field. My guess would be that it has to be unique to be determined what the
next record would be right?
So one final question... what does an array look like when exported to a
textfile. The above sample is provided to me to work with. It's created via
Java. So the normal output of an array would look like:
"option1", "option2", "option3" etc..
or
"Option1, Option2, Option3" etc...
Hope someone can shed some light on this one for me i'm stumbled.