Skip to content

dataform vs wxform

Forums Forums SIMPOL Programming dataform vs wxform

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #62
    Jim Locker
    Member

    On the app I am converting from SBL, I have LOTS of forms, and most of those forms display filtered subsets of multiple tables which are related to each other by some relevant criteria. Now, it appears that I cannot define complex filters using simpol, so it looks like I am going to have to do some coding and build temporary datasets to display the data I need to display in these forms. That being the case, are dataforms for me? I’ll frequently have to change the data on the fly, including relational links such that I’ll be searching several datatables to present new data to the user. If the only useful query feature available is a selectkey function, then I am going to have to step through a table, identify what I need, build a temporary database of the selected records, sift through that by another criterion, build a temporary database of the records that come back, and so forth until all criteria are satisfied. Then I will have to rinse and repeat for every other table that has information to present on the form, then dump the temporary database files currently displayed, and replace with the ones I want to display. Somehow I suspect that dataforms will break if I try this. Should I just use wxforms and manually change the contents of every text and combo box on the form when I make a change? Or will dataforms handle this without breaking? On a related note, can I construct temporary datatables in RAM? If so, can I construct this table then assign its contents to a dataform?

    #1537
    Michael
    Keymaster

    Jim wrote:
    > On the app I am converting from SBL, I have LOTS of forms, and most
    > of those forms display filtered subsets of multiple tables which are
    > related to each other by some relevant criteria.

    Basic single file filters in Superbase were generally slow, unless you
    could guarantee that the primary filter condition also matched the
    current index. It sounds like you are using forms to show what are
    effectively result sets. Depending on how many records you might be
    talking about, you can probably use the volatable.sml library for
    creating volatile tables in memory. This is implemented in SIMPOL (as
    opposed to C), but is acceptably fast and is compatible to
    type(db1table) (it is essentially compatible to sbme1table, but doesn't
    included table modification, which was added later).

    > Now, it appears that I cannot define complex filters using simpol, so
    > it looks like I am going to have to do some coding and build
    > temporary datasets to display the data I need to display in these
    > forms.

    Actually, there is a library for doing SQL92 style queries, but it
    hasn't yet been documented: sql1.sml. I am expecting to document that in
    December, once the initial cut of detail blocks is finished.

    > That being the case, are dataforms for me? I'll frequently have to
    > change the data on the fly, including relational links such that I'll
    > be searching several datatables to present new data to the user. If
    > the only useful query feature available is a selectkey function, then
    > I am going to have to step through a table, identify what I need,
    > build a temporary database of the selected records, sift through that
    > by another criterion, build a temporary database of the records that
    > come back, and so forth until all criteria are satisfied.

    Actually, dataform1 *should* work with vola1tables. It was designed to
    do so, but could fall over in certain places in early testing. As for
    modifying the form on the fly, that is what the form designer also does,
    and it is also written in SIMPOL, so it is certainly possible to do
    this. There is probably not a lot of documentation about on how
    (dataform1 is not yet really documented either), but if you want to
    travel that route, we are willing to help.

    > Then I will have to rinse and repeat for every other table that has
    > information to present on the form, then dump the temporary database
    > files currently displayed, and replace with the ones I want to
    > display.
    >
    > Somehow I suspect that dataforms will break if I try this.

    Probably not, though it will be more complicated than you imagine.
    Data-aware form controls carry a datasource member. That contains a
    reference to a field object and a dataform1table object. If you are
    going to drop the table and replace it, you will need to go through all
    the controls on the form checking the control source, and replace the
    field ref with the new one.

    > Should I just use wxforms and manually change the contents of every
    > text and combo box on the form when I make a change? Or will
    > dataforms handle this without breaking?

    Like I said, it will work both ways. Essentially that is what dataform1
    does when a record changes. It also takes into account display format
    information, and converts non-string data to string for display. It also
    has to convert the other way when doing data entry.

    > On a related note, can I construct temporary datatables in RAM? If
    > so, can I construct this table then assign its contents to a
    > dataform?

    You can. If the table exists in memory before you open the form, you
    should be able to pass it to the opendataform1() function, together with
    the vola1base data source.

    Ciao, Neil

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.