I'm starting out designing my first Alpha 5v4.5 application, and was perusing the forums here for ideas on how to design it efficiently. I ran across Tom Cone's marvelous "Basic Data Entry" versions in the code archive, which looks great as a start and a teaching tool. Thanks, Tom!
My question is: Is it possible to make the scripts completely generic? They are oh so close to being so, but some have code like:
parentform:idnum.activate() ' set focus
which requires that the form have a field named "idnum". It seems like it should be possible to get from the form the name of the first user-accessible field, and activate that instead of hard-coding the field name there. I've found how to list the form's children with .child(N), and figuring out which ones are fields with class(), but have not yet found how to determine which is the first one in the form. (child(1) doesn't do it, nor does the last child with class of "field").
I ask this because my application will have a number of forms for entering different kinds of data, and with this refinement, I would only have to copy the code, not copy, and remember to edit the field name wherever it appears in the code. Also, it would speed my development, and lend a better appearance to the applilcation if the record entry/edit forms all look the same - is is possible to build a "generic" form with the buttons and explanatory text, then copy it and attach it to the requisite table, and place the fields needed in?
Thanks again to Tom for a great example to steal^h^h^h^h^hborrow ideas from!
Greg McMullan, still posting from Rose's account
My question is: Is it possible to make the scripts completely generic? They are oh so close to being so, but some have code like:
parentform:idnum.activate() ' set focus
which requires that the form have a field named "idnum". It seems like it should be possible to get from the form the name of the first user-accessible field, and activate that instead of hard-coding the field name there. I've found how to list the form's children with .child(N), and figuring out which ones are fields with class(), but have not yet found how to determine which is the first one in the form. (child(1) doesn't do it, nor does the last child with class of "field").
I ask this because my application will have a number of forms for entering different kinds of data, and with this refinement, I would only have to copy the code, not copy, and remember to edit the field name wherever it appears in the code. Also, it would speed my development, and lend a better appearance to the applilcation if the record entry/edit forms all look the same - is is possible to build a "generic" form with the buttons and explanatory text, then copy it and attach it to the requisite table, and place the fields needed in?
Thanks again to Tom for a great example to steal^h^h^h^h^hborrow ideas from!
Greg McMullan, still posting from Rose's account
Comment