IBUC 2006 Abstract

Calculator DLL
Roberto Picha; US Census Bureau, USA

One of the frustrating tasks during data collection is the use of the windows calculator. In order for an interviewer
to accomplish this task satisfactory, it would require them to perform several keystrokes in order to transfer the
value from the calculator to the DEP (answer field). They would have to use CTRL-C (to copy) inside the calculator
textbox, close the calculator, and then finally CTRL-V (to paste) in the textbox of the DEP. Some of our interviewers
suggested that it would be useful if the contents of the calculator could be transferred into the data entry program
automatically. At that time the only answer was - “It’s not possible”. This was mainly because the calculator is an
external application outside of the Data Entry Program.

Some possible solutions were presented that could have been available to satisfy our interviewers. One of them
was to create a procedure for items where calculation could be performed. However, the use of recursive calls
inside a procedure is not possible in Blaise. Another possible solution was the creation of an alien router.
However, this would imply some work around the variables in need of this functionality – you would have to define
up-front all variables that may require this functionality. One more alternative was the use of BCP. This would
allow us to use Visual Basic to build a customized calculator. This was the approach that was taken.

One of the BCP examples shipped in the early versions of Blasie in 4.6 was for the use of an ActiveX DLL that
would allow the user to select a color from a pick list and dump the text content into the DEP. The code for this
seemed relatively easy to follow. The ActiveX would permit us to display a form. This form could actually be a
simple application (i.e., calculator) and the content from the form could be sent to the DEP via the DLL. This
approach was used for the Calculator application and the same approach can be utilized for other applications as
well.

In order for this DLL to work within our environment we must consider the following:
1. We must register (system32 directory) the new DLL so that the DEP can access it.
2. We also need the run time Blaise B4API.DLL (required file to interact with our DLL)

Contact: roberto.v.picha@census.gov