Making Use of formlib.sml
The formlib.sml
library contains a copy of the
databaseforms.sml
library, and so if you add
formlib.sml
to your project, you don't need to add
databaseforms.sml
. There are quite a few types and functions in the
library, but only a few are of any real relevance. The two most likely to be used functions are:
opendataform1()
and savedataform1()
. The first opens a
dataform1 from a file, and the second saves an existing dataform1 as a file. SIMPOL
forms are stored in XML format, which is a standard text file that can edited in any editor, such as
notepad.exe
. When opening a dataform1 using the
opendataform1()
function, there are a large number of parameters that can (and should) be
supplied. These include the defaults for various display formats, a dring of data sources that may
be already open, and an array of database tables that are already open. Any database table that is passed in will
prevent a database table of the same name being opened using the data source information stored with the form.
This approach means that the form can be created using the single-user engine but can be opened using a
previously opened set of tables that are being accessed using the multi-user engine.
The data sources are expected to be in a dring of datasourceinfo objects (these are not
dataform1datasource types, but they are similar). The array of tables is expected to begin at 1
(like all arrays in SIMPOL) and to consist of entries of type(db1table). Both of these are easily
retrieved when using the appframework.sml
library and architecture. See
the next section for details.