The utility object is an ActiveX server-side control, which means it is an automation object with a dual interface supporting IDispatch.
Methods
Named by IXSSO.Utility, the utility object consists of the following methods for script writers who use the Index Server query object.
Adds a scope restriction to a query specification.
- Syntax
- AddScopeToQuery QueryObj, Path[ , Depth ]
- Returns
- Nothing.
- Arguments
- QueryObj is the query object to be modified.
- Path is the scope to be added. This path can be virtual or physical.
- Depth determines whether a scope covers only the named directory or the named directory and all its subdirectories. A scope can be SHALLOW (only the named directory) or DEEP (the named directory and all its subdirectories).
- Example
util.AddScopeToQuery Q, "/kb", "deep"
Accesses a variant array element.
- Syntax
- varResult = GetArrayElement( varArray, iElem )
- Returns
- varResult is a variant that contains the iElem element of varArray.
- Arguments
- varArray is a variant containing a singly-dimensioned safearray.
- IElem identifies the array element that should be returned.
- Remarks
- If varArray is not a safearray, or iElem is either less than the lower limit of varArray or more than its higher limit, the type of varResult will be VT_EMPTY.
- Example
Request.Write (Util.GetArrayElement( RS("vector-col"), i ) )
Converts an ISO 639 language code into a Win32 locale identifier (LCID).
- Syntax
- LocaleID = ISOToLocaleID( strLanguage )
- Returns
- LocaleID is a Win 32 LCID that gives the translation of the ISO language code in strLanguage.
- Arguments
- strLanguage is a client browser language string from the HTTP Accept-Language header.
- Remarks
- The first recognized language code found in the input string is converted to a Win32 LCID. The recognized language codes include all those from the ISO 639 standard that map to Win 32 language IDs and some country codes that have sublanguage codes in Win 32. If a language code is recognized, but the country code is not, the language code alone will be used, unless there is a better match later in the string. In addition to the ISO language codes, the name neutral can be used. If there is no matching language code, 1 is returned.
- Example
Lcid = Util.ISOToLocaleID(
Request.QueryString("HTTP_ACCEPT_LANGUAGE") )
Converts a Win 32 locale identifier (LCID) into an ISO 639 language code.
- Syntax
- strLanguage = LocaleIDToISO( LocaleID )
- Returns
- strLanguage is the name of the language identified by LocaleID.
- Arguments
- LocaleID is a Win 32 LCID to be translated.
- Example
Response.Write "Language is " & Util.LocaleIDToISO(iLocale)
Ends a string at a white-space character.
- Syntax
- NewStringTruncateToWhitespace( String, Length )
- Returns
- NewString is the truncated string.
- Arguments
- String is the string to be truncated.
- Length is the maximum length of the string.
- Remarks
- With this method, script writers can display short forms of long properties, such as description, without being cut off in the middle of a word. Word breakers are impractical for this function.
- Example
Response.Write util.TruncateToWhitespace(RS("Characterization"), 200)
© 1997 by Microsoft Corporation. All rights reserved.