try this ..

Hi,

Please suggest me that how can I make a variable to return value in
Array
form.

I have a function which is adding multiplesheets at runtime and the
variable X is containing the sheet names.

Now when i tried to use the same variable in other function ,it
returns
only 1 sheet name at index 0 of an array,but i want to have all the
sheetnames collectively in that variable.

I have tried making the function to return value in array form but
unfortunately it returns only current added sheet name overiding it
with
the previous value.

For eg:Variable X (0)="Setup Ba"

Next time when the same function executes,it overrides the value at
the
same location like:
Variable X(0)="Setup Su"

Please let me if any one can help me in this.

Thanks,
Nidhi


ReDim val(counter) ' This counter you can retrieve during run time.

for i=1 to sheetCounter

     val(i)=DataTable.GetSheetName

Next

For j=0 to ((UpperBound(val)-LowerBound(val)+1)-1

      msgbox val(j)

Next

You can convert into function also.. so basically use iterative
approach to store values inside your variable in run time..


On Mar 14, 1:49 am, Santhosh Ganji <[email protected]>
wrote:
> Hi,
> If you are calling the function multiple times then automatically the
> variable value will be updated....
> If you want to fetch it as an array...
> 1. Save the values in a notepad individually
> 2. Fetch the values from the notepad as an array
>
> I think it might help you....
>
> On Wed, Mar 14, 2012 at 11:54 AM, Nidhi Sharma <[email protected]>wrote:
>
>
>
> > Hi,
>
> > Please suggest me that how can I make a variable to return value in Array
> > form.
>
> > I have a function which is adding multiplesheets at runtime and the
> > variable X is containing the sheet names.
>
> > Now when i tried to use the same variable in other function ,it returns
> > only 1 sheet name at index 0 of an array,but i want to have all the
> > sheetnames collectively in that variable.
>
> > I have tried making the function to return value in array form but
> > unfortunately it returns only current added sheet name overiding it with
> > the previous value.
>
> > For eg:Variable X (0)="Setup Ba"
>
> > Next time when the same function executes,it overrides the value at the
> > same location like:
> > Variable X(0)="Setup Su"
>
> > Please let me if any one can help me in this.
>
> > Thanks,
> > Nidhi
>
> > --
> > You received this message because you are subscribed to the Google
> > "QTP - HP Quick Test Professional - Automated Software Testing"
> > group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]
> > For more options, visit this group at
> >http://groups.google.com/group/MercuryQTP?hl=en
>
> --
> Thanks and Reagards
> Santhosh G
> +918007850250

-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

Reply via email to