Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Array
#1
Solved: 11 Years, 4 Months, 3 Weeks ago
Hello Friends,

By seeing Array... How can we say that array is static array or dynamic array...!

thanks & regards,
Baba Fakruddin.D
Reply
#2
Solved: 11 Years, 4 Months, 3 Weeks ago
Static Array:
Code:
Dim No_Passengers(3)
The No_Passengers can store 4 values.

Assigning values to the array
No_Passengers(0) = 1
No_Passengers(1) = 2
No_Passengers(2) = 3
No_Passengers(3) = 4


Dynamic Array (Value changes at the runtime)

In the below code the array will be vary depending on the roles exist for the user. This is dynamic array

Code:
Dim arrUserRoles()
If objChildWebTable.Count <> 0 Then
ReDim arrUserRoles(objChildWebTable.Count - 1)
    For intCount = 0 To objChildWebTable.Count - 1
        arrUserRoles(intCount) = objChildWebTable(intCount).GEtROProperty("outertext")
    Next
Else
    Reporter.ReportEvent micFail,"User Roles","Logged in User have no  roles in the drop down list"
End IF
Reply
#3
Solved: 11 Years, 4 Months, 3 Weeks ago
hi ,

I agree with Tariksheth anwser....

Static Array :
Array created by using Dim ( example: Dim str(3) ) since Array size is fixed.

Dynamic Array :
Array created by using ReDim ( example : ReDim arrUserRoles(objChildWebTable.Count - 1)
(since Array size is not fixed here & it varies dynamically)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to use Array of Array in QTP dineshb 1 16,655 12-12-2009, 02:00 AM
Last Post: rdemers25
  Array function for Static Array anbarasu 2 3,884 11-20-2009, 12:18 PM
Last Post: anbarasu

Forum Jump:


Users browsing this thread: 1 Guest(s)