Hi Pablo
I'm glad to the consensus
Pablo César wrote:
Returning to tech details in STRU:
And now I am implementing another button option which is gonna give us a chance to make "process" in runtime mode (with xBase code) of each importing data of each field. I means, when is creating or even changing a field, you can do your own routine to take the right data for each field.
what do you think about it ?
Designing a form for editing a table structure is an easy task; open a grid, fill it with structure info, wait modification will make by user, until a "done / apply" button pressed.
The 1.st difficulty is validating user input: field names must be upper-case, field type must one of predefined types (CDLNM), width and decimal position values must match with types, standard widths ( 8 for D, 1 for L, 10 for M) must suggest by program and can't change by user etc.
If user defined a "new" field or didn't include an existing field, no problem, this is a situation easy to implement.
The 2.nd difficulty is bigger: and arise when user changed properties of a field without changing its name: how will convert types to other and how will modify other properties according to types without losing user data?
For example :
D type changed to C : DTOC()
C type changed to D : CTOD() does already recorded C type data is a properly convertible to date ? fe: does field with is 8 ? If no, what can be do ?
N type changed to C : STR() What about decs ?
C type changed to N : VAL() What about decs and commas ?
If decreased field width ?
if changed a L type field to one of others and vice versa ?
In short : Since we have five different types, we have at least 5^5 probabilities, some are easy to implement, some are not
As a result, it's almost impossible to develop a resolution to satisfy everybody
However, these type of difficulties are challenge and a programmer haven't any possibility to escape form theme
Saludos