Kilowatt Software L.L.C.
Welcome to
TopHat™
Kilowatt Software L.L.C.'s
Generic Form Interface
for
and roo!™
Click here
to download r4™ and TopHat™
it's

   TopHat™ is a generic form interface
   A collection of forms is defined in a text file.
   The collection of forms is displayed as a tabbed folder.
   Each tab within the folder contains a fill-in-the-blank form.
   A form contains an arbitrary assortment of input fields, and output fields that are processed by the associated program.
   TopHat™ passes form information to the associated program in the registry.
   The REXX program returns information to TopHat™ in the registry.
   The result is a simple separation of generic form definition, from associated logic.
   Often a form can be implemented without any complicated implementation details.
   Form input fields can have associated tool tips.
   TopHat™ operates as a standard application in Windows 98/ME/2000/XP or NT 4.0 environments
   TopHat™ forms can be customized for foreign languages.
   Extensive multi-tab applications can be easily created, without intricate GUI programming logic.

An example TopHat™ form, with values computed by an R4 program:
The associated r4™ program:

  /* LoanCalc.rex
   this program computes loan payment values

   this program communicates with TopHat.EXE via the registry

   a tab delimited request is received from registry value:
    HKLM\Software\Kilowatt Software\R4\LoanCalc[Request]

   a tab delimited response is returned in registry value:
    HKLM\Software\Kilowatt Software\R4\LoanCalc[Response]
  */

  tab = d2c( 9 )

  /* get TopHat request */

  request = value( 'HKLM\Software\Kilowatt Software\R4\LoanCalc[Request]', , 'Registry' )

  /* parse tab delimited request fields */

  parse var request downPayment (tab) principal (tab) pctRate (tab) periodType (tab) nperiods

  /* compute loan payment values */

  workingPrincipal = principal - downPayment

  interest = ( pctRate / 100 ) / 12 /* convert annual interest rate to monthly rate */

  if translate( left( periodType, 1 ) ) = 'Y' then
    nperiods = nperiods * 12 /* #payments in a year */

  x = ( 1 + interest ) ** nperiods

  monthly = ( workingPrincipal * x * interest ) / ( x - 1 )

  monthlyPayment = trunc( monthly, 2 )

  total = monthly * nperiods

  totalPayment = trunc( total, 2 )

  totalInterest = trunc( total - principal, 2 )

  totalExpense = trunc( total + downPayment, 2 )

  /* prepare tab delimited TopHat response */

  response = monthlyPayment || tab || totalPayment || tab || totalInterest || tab || totalExpense

  'set R4REGISTRYWRITE=Y' /* enable registry writing */

  call value 'HKLM\Software\Kilowatt Software\R4\LoanCalc[Response]', response, 'Registry'
Another TopHat™ form, with values returned to an R4 program:
The associated r4™ 'Contact' program:

  /* LoanCalc.rex
  /* GetContact.rex
    this program obtains contact information via TopHat

    this program communicates with TopHat.EXE via the registry

    a tab delimited input value is acquired from registry value:
      HKLM\Software\Kilowatt Software\R4\Contact[Request]
  */

  tab = d2c( 9 )

  /* invoke TopHat with input file: Contact.TopHat */

  trace off /* ignore error code when cancel is pressed */

  'TopHat Contact.TopHat'

  if rc <> 0 then /* cancel button was pressed */
    exit 1

  /* get TopHat input field values */

  input = value( "HKLM\Software\Kilowatt Software\R4\Contact[Request]", , "Registry" )

  /* parse tab delimited input field values */

  parse var input ,
    name (tab) ,
    address1 (tab) ,
    address2 (tab) ,
    city (tab) ,
    state (tab) ,
    mailCode (tab) ,
    phone (tab) ,
    email (tab) ,
    emailAlt (tab) ,
    dateOfContact (tab)

  say 'Contact information:'

  say left( 'Name', 20 ) name
  say left( 'Address1', 20 ) address1
  say left( 'Address2', 20 ) copies( address2, address2 <> '-' )
  say left( 'City', 20 ) city
  say left( 'State', 20 ) state
  say left( 'Zip/Mail code', 20 ) mailCode
  say left( 'Phone', 20 ) phone
  say left( 'E-mail', 20 ) email
  say left( 'Alternate e-mail', 20 ) emailAlt
  say left( 'Date of contact', 20 ) dateOfContact

  exit 0
The 'Contact' TopHat™ form:
The 'Contact' program output::

 Contact information:

 Name John Doe
 Address1 11 Oak Street
 Address2
 City Pleasantville
 State ZW
 Zip/Mail code 55555
 Phone 999-555-1212
 E-mail jdoe@bitbucket.com
 Alternate e-mail johndoe@elsewhere.com
 Date of contact 23 May 2001


Send e-mail product inquiries to: r4inquiries@kilowattsoftware.com

Brightening your way into the future !