Retrieve scalars for the persistent filters

After your application gets the handle to a persistent filter, your application can retrieve the scalars for that filter. A persistent filter has four scalars:

Query Key
String that corresponds to the identifier of the query. The identifier is an eight-character identifier that the SMS system assigns to the query when it is first added to the site database. Note that the default queries provided with SMS have a six-character identifier.
Name
String that corresponds to the Query Name in the Query Properties of the query in the SMS Administrator.
Comment
String that corresponds to Comment in the Query Properties of the query in the SMS Administrator.
Architecture
String that corresponds to Architecture in the Query Properties of the query in the SMS Administrator.

Unlike the scalars for folders, the scalars for persistent filters can be retrieved in sequence only.

To retrieve scalars in sequence, use the SmsGetNextScalar function. SmsGetNextScalar retrieves the next scalar in the list of scalars within the persistent filter and writes the scalar's information into a SCALAR structure. To start at the beginning of the list again, use SmsRewind to reset a filter's internal scalar index so that the filter's scalars can be reiterated.

Example:

// Get the next scalar in the persistent filter 
// and print it on the screen.

SCALAR scalar;
char szName[50];          //Buffer for scalar name.
char szValue[BUFF_SIZE];  //Buffer for string value.

scalar.pszName  = szName;
scalar.pszValue = szValue;
scalar.dwLen = sizeof(szValue)-1;

// Retrieve the next scalar.
stat = SmsGetNextScalar(hFilter,  // Handle to filter.
                        &scalar   // Pointer to SCALAR struct to 
                                  // place data for the scalar.
                        );

// Print the scalar name and value.
printf("\t%20s: %s\n", scalar.pszName, scalar.pszValue);