Board index » delphi » Process Persistance using Dynamic Array of Boolean

Process Persistance using Dynamic Array of Boolean


2006-01-23 02:13:38 AM
delphi141
I have a process that I want to persist between run instances.
The process consists of:
- a series of steps ... a wizard interface for clarification,
- all of which must, at some point be completed,
- any step of which the user can (on the short term) skip and
- where the user can quit and come back as required being presented with the last step that was visible on returning.
My initial though was to use a dynamic array of booleans persisted to a byte data type where (considering ProcessStatus as a byte data type variable being used):
- the array is increased in size each time the user moves to the next step. Just prior to this High(ProcessStatus) will be set to True if the last step was completed or remain as False.
- when loading the persisted data, High(ProcessStatus) will give me the last step in the process that was visible and "For i = 1 to (High(ProcessStatus) - 1) do IsDone := ProcessStatus[i];" will tell me which steps have been completed and which have not.
I haven't tried any of this yet, just researching/designing at the moment so I hope that this makes some sort of sense.
Am I on the right track?
--
Dave Keighan
XanaNewser [ 1.17.6.6]
 
 

Re:Process Persistance using Dynamic Array of Boolean

FWIW: I have noticed the pseudocode mistakes :(
--
Dave Keighan
XanaNewser [ 1.17.6.6]
 

Re:Process Persistance using Dynamic Array of Boolean

Quote
Am I on the right track?
Further contemplation would lead me to believe ... no.
I'm now thinking, that the easiest way using a standard storage mechanisms (TClientDataSet for example) I will have to use two byte data types. One to store the last known position as a number less than 256 and the other to store the status of each step by toggling the bits manually.
Sorry for the annoyance, I will start posting to notepad or EverNote so that the process of writing out my contemplations, which tends to lead me where I need to go, but ... I don't bother you with them :)
--
Dave Keighan
XanaNewser [ 1.17.6.6]