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 |
|
- List: JavaScript functions in the ScriptLibrary
- JavaScript function: addToGroup
- JavaScript function: checkAllowedOption
- JavaScript function: checkVersionString
- JavaScript function: isfileexist
- JavaScript function: isInGroup
- JavaScript function: removeFromGroup
- JavaScript function: returnGroupMembers
- JavaScript function: returnMyGroups
- JavaScript function: skipApproval
JavaScript function: checkAllowedOption
Returns the next valid version number of a Configuration Management baseline group if there is only one valid version number available.
Syntax
lib.versionControl.checkAllowedOption( oldVersion, maxIncrement );
Arguments
The following arguments are valid for this function:
Name | Data type | Required | Description |
---|---|---|---|
oldVersion
|
String | Yes | This argument contains the previous version number. |
maxIncrement
|
Array | Yes | This argument contains an array of numbers representing the decimal value of the maximum number increments possible. For example, if maxIncrement equals [0,1,0] then there are ten possible increments permissible from versions 0.0.1 to 0.1.0. |
Return values
A valid version number or the string more
.
The function returns a valid version number if there is one and only one valid next version number. The function returns the string more
if there is more than one valid next version number.
Description
This function is part of a system JavaScript and should not be directly modified.
This function returns the next valid version number of a Configuration Management baseline group if there is one and only one valid version number available. If there is more than one valid next version number then the function returns the string more
.
Example
This example attempts to create the next valid version from two variables.
This example requires the following sample data:
- A variable storing the old version number
- A variable storing the maximum number of increments allowed
/* Use oldVersion to store the old version number as a string. * Use maxIncrement to store the maximum number of increments as an array. */ var oldVersion; var maxIncrement = new Array(); /* Create a function to test the checkAllowedOption function */ function nextVersionTest( versionOld, increment ) { var nextVersion = lib.versionControl.checkAllowedOption( versionOld, increment ); if ( nextVersion == "more" ) { print( "Error. There is more than one valid next version number for " + versionOld + ".\n"); return versionOld } else { print( "Success. The next valid version number is " + nextVersion + ".\n" ); return nextVersion } } /* Test a valid version number update */ print( "Testing checkAllowedOption...\n" ); oldVersion = "1.0"; maxIncrement = [0,1]; print( "The current version number is " + oldVersion + "." ); print( "The maximum allowed increment is " + maxIncrement + "."); nextVersionTest( oldVersion, maxIncrement ); /* Test a valid version number update */ print( "Testing checkAllowedOption...\n" ); oldVersion = "0.9.9"; maxIncrement = [0,0,1]; print( "The current version number is " + oldVersion + "." ); print( "The maximum allowed increment is " + maxIncrement + "."); nextVersionTest( oldVersion, maxIncrement ); /* Test an invalid version number update */ print( "Testing error condition...\n" ); oldVersion = "1.0"; maxIncrement = [0,2]; print( "The current version number is " + oldVersion + "." ); print( "The maximum allowed increment is " + maxIncrement + "."); nextVersionTest( oldVersion, maxIncrement );