skip to main content
Popular Topics
Home
phpWebSite
EPROG @ TU-Wien
Contact me
About me
Choose
Forums
Photos
J
u
mp Site
Wiki
Popular Links
phpWebSite home
phpWebSite Directory
phpWebSite English Support
phpWebSite Themes
phpWebSite German Support
phpWebSite Modules
[
back
]
Frequently Asked Questions
View
Suggest a FAQ
The ad will go away if you log in.
Q:
How do I clear the content of an Array?
A:
There are three possibilities (taken from
KB 224
)
1. To delete the entire contents of an array using one TSL statement, the delete statement can be used.
Example:
delete array[]; #for single and multi. dim. arrays
2. Assign the array field an empty value ("").
Example:
public ary[];
ary[0] = "one";
ary[1] = "two";
ary[2] = "three";
for (i in ary)
print(ary
[
i
]
);
for (i in ary)
ary
[
i
]
= "";
print("Array was cleared");
for (i in ary)
print(ary
[
i
]
);
3. Use the custom function array_empty.
Note:
This function is not part of WinRunner. It is not guaranteed to work and is not supported by Mercury Technical Support. You are responsible for any and all modifications that may be required.
public function array_empty(out array[])
{
return(E_OK);
}
Example:
public numbers[] = {1,2,3,4,5};
rc = array_empty(numbers); # The array is now empty.
How helpful was this FAQ?
Exactly What I Needed
Very Helpful
Helpful
Somewhat Helpful
Useless
Comments
-
Make a comment
The comments are owned by the poster. We are not responsible for its content.
Threaded
Nested
Flat
Oldest First
Newest First
What's Related
Link Manager
WinRunner
WinRunner Array Enhancements
WinRunner Forums
WinRunner Knowledge Base
Mercury Support
Documents
WinRunner
Using Excel-Tabs in WinRunner
FAQ
WinRunner
How to close all browsers with TSL?
How to recover from a WinRunner crash without...
How to reset an array (remove all elements from...
Largest position in an array?
Smallest position in an array?
Number of elements in an array?
How do I do a case-insensitive compare with TCL?
How to add Excel Tabs.
Wiki
WinRunner
WinRunner
Article Manager
WinRunner
Keine neuen Cliés mehr