DatStat Illume 4.5 SDK Class Reference

HookContext.GetParameter Method 

Returns the value of the named survey parameter.

public string GetParameter(
   String parameterName
);

Parameters

parameterName
The friendly name of a survey parameter.

Return Value

The value of the named survey parameter.

Remarks

Survey parameters are custom variables consisting of a name and a value. Generally, you use them to display data that may appear in several places throughout the survey and/or data that may have to change frequently. For example, if you administer an employee satisfaction survey every quarter you may create a parameter called "quarter", and then change the value of this parameter from "Spring" to "Summer" to "Fall" to "Winter", as necessary.

Parameters are always of type String but can be coerced in .NET if it is known that the parameter value will always hold an appropriate value.

It may be desirable to write some of your hooks in a more generalized fashion but have them run slightly differently in the case of certain surveys. You can use parameters to achieve this. For example, an EndPageContent hook could be coded to provide the content as an html table with borders or not. You can set up the hook to look at the value of a survey parameter named “ECBORDERSTYLE” to dictate which style to return. Parameters also have the added benefit of being translatable, mitigating the need for hook changes when different languages are needed.

If the named parameter does not exist, an empty string is returned.

See Also

HookContext Class | DatStat.Collector Namespace