Save + Restore form variables
From: Davids (nowhere_at_nowthere.com)
Date: 02/17/04
- Next message: Nelson Esmai: "Re: Scalable memory manager for Delphi."
- Previous message: Yorai Aminov: "Re: Shorter Path Planners for VCL and VCL.NET"
- Next in thread: Jim McKay: "Re: Save + Restore form variables"
- Reply: Jim McKay: "Re: Save + Restore form variables"
- Reply: Kevin Powick: "Re: Save + Restore form variables"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 16 Feb 2004 18:55:39 -0700
I've got an app that's has a bunch of processing buried inside some forms that
are normally presented to the user sequentially to set operational parameters
and then do some fairly hairy computations in preparation for the next step.
We're trying to turn this highly-interactive app into a CGI app that can run in
a sort of "batch" mode. In this particular instance, we don't need the full
functionality of the program, just a small part of it. However, that small part
touches so much of the code that it's not practical to simply extract the
necessary code.
So, suppose you've got a form with a bunch of edit fields and local variables in
it. Some local variables are set up as public and published properties, and
others are private to the form class.
You want somebody to be able to run the application once to set up some values
that are used in subsequent processing by saving the results to, eg., an INI
file, when the form closes.
Then you want to be able to process a batch of input data that uses the saved
settings in the form, but without displaying the form.
That is, you'd have an instance of the form, show it modally to let the user set
some parameters, then it would hide when the OK button is clicked. The form's
data is saved at that point.
Later on, the form would be used, eg, by calling a 'restoreSettings' method, and
then a 'processData' method in the form is called that depends on those
settings. (The processData method already exists and is called when you click
the OK button; it's the restoreSettings method we'd need to add.)
The idea is to separate the settings from the processing, to a certain extent.
If the application displays the form, then it saves its settings. If it runs
without displaying the form, then there's a way to use previously saved settings
without crashing the program. (A form instance is created, but just not made
visible.)
The question is, is there a simple way of saving/restoring variables contained
in an instance of a Form? I know there are a couple of components, eg., from
Dream Controls and Orpheus, that will save/restore PUBLISHED property values on
a form, but in this case we've got data in the form that's not published and can
NOT be published.
I'm trying to avoid having to write an explicit serializer/deserializer here.
Any ideas...?
TIA
-David
- Next message: Nelson Esmai: "Re: Scalable memory manager for Delphi."
- Previous message: Yorai Aminov: "Re: Shorter Path Planners for VCL and VCL.NET"
- Next in thread: Jim McKay: "Re: Save + Restore form variables"
- Reply: Jim McKay: "Re: Save + Restore form variables"
- Reply: Kevin Powick: "Re: Save + Restore form variables"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]