Class StatResult
Used to access the results of a StatLib execution.
Syntax
Constructors
StatResult()
Initializes a new instance of the StatResult class.
Declaration
StatResult
Methods
atGroupBegin(Integer)
Checks if the current row is the first row for a given group.
Declaration
Bool atGroupBegin(Integer column)
Parameters
| Type | Name | Description |
|---|---|---|
| Integer | column | The column which identifies the group. |
Returns
| Type | Description |
|---|---|
| Bool | True if we're at the first row for this group; otherwise, false. |
atGroupEnd(Integer)
Checks if the current row is the last row for a given group.
Declaration
Bool atGroupEnd(Integer column)
Parameters
| Type | Name | Description |
|---|---|---|
| Integer | column | The column which identifies the group. |
Returns
| Type | Description |
|---|---|
| Bool | True if we're at the last row for this group; otherwise, false. |
dumpParser()
Returns a string with everything in the StatResult parser listed.
Declaration
String dumpParser()
Returns
| Type | Description |
|---|---|
| String | A string with everything in the StatResult parser listed. |
Remarks
Mainly used for debugging and development. It will show you every variable in the StatResult parser.
eof()
Checks if the internal iterator is past the last element.
Declaration
Bool eof()
Returns
| Type | Description |
|---|---|
| Bool | True if the internal iterator is past the last element; otherwise, false. |
getField(Integer)
Returns the value for the given field at the current row.
Declaration
String getField(Integer column)
Parameters
| Type | Name | Description |
|---|---|---|
| Integer | column | The zero-based index of columns. |
Returns
| Type | Description |
|---|---|
| String | The value for the given column at the current row. |
Remarks
You can specify the field either by its name or its column. Normally used to retrieve values from aggregate functions.
getField(String)
Returns the value for the given field at the current row.
Declaration
String getField(String field)
Parameters
| Type | Name | Description |
|---|---|---|
| String | field | The name of the field to retrieve. |
Returns
| Type | Description |
|---|---|
| String | The value for the given field at the current row. |
Remarks
You can specify the field either by its name or its column. Normally used to retrieve values from aggregate functions.
next()
Moves the internal iterator to next element.
Declaration
Bool next()
Returns
| Type | Description |
|---|---|
| Bool | Eof() after move. |
rewind()
Rewinds the internal iterator.
Declaration
Void rewind()
Returns
| Type | Description |
|---|---|
| Void |
saveAsResult(Integer,Integer,Integer)
Returns a reference to a result set.
Declaration
Integer saveAsResult(Integer column, Integer ownerId, Integer maxRows)
Parameters
| Type | Name | Description |
|---|---|---|
| Integer | column | What column to use as ID field |
| Integer | ownerId | ID of the owner of the result set (so it can be deleted at logout time) |
| Integer | maxRows | Maximum number wanted in the result set. |
Returns
| Type | Description |
|---|---|
| Integer | A reference to the result set. |
Examples
The result set reference can be used like this to display tickets in the result set (if the result set references tickets):
setVariable("url", getProgram(1) + "&action=listTickets&special=11&resultKey=" + resKey .toString());