Start by creating a new Delphi package by selecting File | New | Package | Delphi from the IDE's main menu. Once you have saved it using the name FormatFloatPackage, you need to add a unit to the package. This is where we'll add the required code:
Figure 6.11
Once we've done this, we need to name the unit Methods.FormatFloat and save it. We'll need to add some unit names to the uses clauses of the unit so that we have visibility over the SysUtils.FormatFloat function and the LiveBindings infrastructure. Here are the units we are going to include:
- SysUtils: The FormatFloat function and the TFormatSettings type definition
- System.Bindings.Methods: The MakeInvokable function, the TMethodDescription type definition, and the TBindingsMethodFactory singleton
- System.Bindings.EvalProtocol: The IValue, TValueWrapper, and IInvokable type definitions
In the next section, we will...