Searching the Help
To search for information in the Help, type a word or phrase in the Search box. When you enter a group of words, OR is inferred. You can use Boolean operators to refine your search.
Results returned are case insensitive. However, results ranking takes case into account and assigns higher scores to case matches. Therefore, a search for "cats" followed by a search for "Cats" would return the same number of Help topics, but the order in which the topics are listed would be different.
Search for | Example | Results |
---|---|---|
A single word | cat
|
Topics that contain the word "cat". You will also find its grammatical variations, such as "cats". |
A phrase. You can specify that the search results contain a specific phrase. |
"cat food" (quotation marks) |
Topics that contain the literal phrase "cat food" and all its grammatical variations. Without the quotation marks, the query is equivalent to specifying an OR operator, which finds topics with one of the individual words instead of the phrase. |
Search for | Operator | Example |
---|---|---|
Two or more words in the same topic |
|
|
Either word in a topic |
|
|
Topics that do not contain a specific word or phrase |
|
|
Topics that contain one string and do not contain another | ^ (caret) |
cat ^ mouse
|
A combination of search types | ( ) parentheses |
|
- Using JavaScript in Service Manager
- Avoiding the use of the for…in loop over an array
- Avoiding variable declaration inside a loop
- Counting records
- Avoiding the use of getLast()
- Restricting fields selected by a query
- Avoiding the use of assignment instead of comparison
- Accessing system language array data
- Working with system variables
- Accessing a JavaScript class definition from another JavaScript
Avoiding variable declaration inside a loop
JavaScript is a language with a dynamic garbage collection. Memory allocated even if inaccessible, will not be given free before the garbage collector deallocates it.
If a variable is declared inside a loop, JavaScript will allocate fresh memory for it in each iteration, even if older allocations will still consume memory. While this might be acceptable for variables of scalar data types, it may allocate a lot of memory for SCFile variables, or huge arrays or objects.
Unrecommended implementation
The following implementation, in which a variable is declared inside a loop, is not recommended.
var arr = new Array();
arr = [ "IM10001", "IM10002", "IM10003", "IM10004" ];
for(i=0;i<arr.length;i++)
{
var file = new SCFile("probsummary");
file.doSelect('name="'+arr[i]+'"');
// do something with file
}
Recommended implementation
The following implementation, in which a variable is declared before a loop, is recommended.
var arr = new Array();
arr = [ "IM10001", "IM10002", "IM10003", "IM10004" ];
var file = new SCFile("probsummary");
for(i=0;i<arr.length;i++)
{
file.doSelect('name="'+arr[i]+'"');
// do something with file
}
We welcome your comments!
To open the configured email client on this computer, open an email window.
Otherwise, copy the information below to a web mail client, and send this email to ovdoc-ITSM@hpe.com.
Help Topic ID:
Product:
Topic Title:
Feedback: