Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can we declare an array without using parenthesis ?
#1
Solved: 11 Years, 4 Months, 3 Weeks ago
Hi , I found an VB script program on a site

Code:
Dim MyString, MyArray, Msg
MyString = "VBScriptXisXfun!"
MyArray = Split(MyString, "x", -1, 1)
' MyArray(0) contains "VBScript".
' MyArray(1) contains "is".
' MyArray(2) contains "fun!".
Msg = MyArray(0) & " " & MyArray(1)
Msg = Msg   & " " & MyArray(2)
MsgBox Msg

in this program MyArray is a variable as it is not declared with the parenthesis.
then how this program is working ?
Can we declare an array without parenthesis ?

Please help me Smile
Reply
#2
Solved: 11 Years, 4 Months, 3 Weeks ago
MyArray = Split(MyString, "x", -1, 1)


Split is a function which which will split a variable using the delimeter and returns an array. Here Mystring is being split using x and it is returning an array which is being stored in MyArray. Please read more about split in QTP Help file.

Regards,
Ankesh
Reply
#3
Solved: 11 Years, 4 Months, 3 Weeks ago
Thanks a lot Ankesh for ur quick response.. Smile
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to use Array of Array in QTP dineshb 1 16,656 12-12-2009, 02:00 AM
Last Post: rdemers25
  Array function for Static Array anbarasu 2 3,886 11-20-2009, 12:18 PM
Last Post: anbarasu
  Using QTP Automation Object Model to declare object classes sadafakhan 0 2,916 07-24-2009, 05:20 AM
Last Post: sadafakhan

Forum Jump:


Users browsing this thread: 2 Guest(s)