File fhutils - function createResultTable


Provides an easier way to work with standard result sets, especially when working with multiple columns

Sample Usage

    fhu = require("fhUtils")
    local tblResults = fhu.createResultTable()
    -- Define Columns
    tblResults.indi  = {title='Record'}    = {title='id',type='integer',align='align_right',width=20} 
    tblResults.death = {title='Death'}  = {title='Name',type='text'}
    tblResults.birth = {title='Birth',width=40}
    pi = fhNewItemPtr() -- declare pointer
    pi:MoveToFirstRecord("INDI") -- and set to the first record.
    while pi:IsNotNull() do
        -- Add Row
        -- Set Columns
    fhOutputResultSetTitles("All Individuals", "All Individuals", "Item List Example Date: %#x")
getParam (sTitle, sTopMessage, fields, tButtons, shortcuts, hParent)
This function allows a dynamic prompt box to be created with 5 different line types with a variety of controls for ranges and prompting.

Defining Columns

Define each column by simply adding a table as the column

For more information on the column values please see the function help for fhOutputResultSetColumn. The table can contain

  • title: The column title
  • type: The type text|number|item
  • width: required column width
  • alignment: align_left - column is left aligned | align_right - Column is right aligned | align_mid - Column is centered
  • sort: sort order
  • sortAscending: true/false
  • sortType: default
  • visibility: show|hide

All values other than the title are optional

Setting a Column

To set the value for the column simply call the set function on the column passing the value required.

Outputing the Results

First call fhOutputResultSetTitles to set the titles and then call


Row Count

The count of rows can be accessed at any point using the function.