Say, you create a form designer for a DB
Now you want the "custom" fields on the form (in fact the DB) to be represented by real a Structured Array name, not something like creating 20 preconfigured arrays (Field 1, Field 2) with referenced names.
IS THIS POSSIBLE ? (at least, in PB)
Purely.
Creating Named Structured Arrays during Runtime
Do you mean that you want a structure that has fields and names like a database object, or other runtime creation? If so, then you would use any suitable runtime data type for it. I would use an Array1(#of records) of pointers to blocks of memory that were the individual records of whatever size and type. To access their contents you would have to keep track of the fields within the structure through the use of another Array2(#of fields) which would record record offsets and types, and possibly the field's name.purely wrote:Now you want the "custom" fields on the form (in fact the DB) to be represented by real a Structured Array name, not something like creating 20 preconfigured arrays (Field 1, Field 2) with referenced names.
I am sure other options are viable.
If you meant instead about creating an interpreter type construct where the program modifies itself to refer to the parts of a form by changing it's sourcecode, I think you heading down the wrong path. If need be, you could have a program write source code and cause it to be compiled and then executed (at least according to my theories). Since PB is not interpreted, a runtime custom procedure would be best. IMHO
I thought about the last option, it's too complex.Demivec wrote:Do you mean that you want a structure that has fields and names like a database object, or other runtime creation? If so, then you would use any suitable runtime data type for it. I would use an Array1(#of records) of pointers to blocks of memory that were the individual records of whatever size and type. To access their contents you would have to keep track of the fields within the structure through the use of another Array2(#of fields) which would record record offsets and types, and possibly the field's name.purely wrote:Now you want the "custom" fields on the form (in fact the DB) to be represented by real a Structured Array name, not something like creating 20 preconfigured arrays (Field 1, Field 2) with referenced names.
I am sure other options are viable.
If you meant instead about creating an interpreter type construct where the program modifies itself to refer to the parts of a form by changing it's sourcecode, I think you heading down the wrong path. If need be, you could have a program write source code and cause it to be compiled and then executed (at least according to my theories). Since PB is not interpreted, a runtime custom procedure would be best. IMHO
The first option sounds good...
I am not used to using pointers in this way, will do some experiments next days...
Thanks so far.