>Simple once you see it! <g> Thanks to both of you. This stuff is only beginning to "jell". Long way to go.
>
>1. Would I be correct that:
>If I have the list of directives, it would be easier to create one list of:
>Thisform.text1.controlsource = [Thisform.S_data(ccn)]
>Thisform.text2.controlsource = [Thisform.S_data(cdate)]
>etc. etc.
>in the init of the Form instead of doing:
>
>this.controlsource="thisform.s_data(ccn)"
>since that type code would have to go in the init of *each* control?
Matter of style - whether you like to have control's stuff to be with the control, or to have it centralized in the form. Personally, I'd have a Setup() method for the form, and call it from the form's init. Anything related to setting the controls up would go there, including setting of controlsources.
>2. In the case where the forms's init sets the controlsource to Thisform.text1.controlsource = [Thisform.S_data(ccn)] but the controlsource property still had the S_date[cc] code, which "takes priority"?
>
>3. Is there any difference in priority if I use the control's init to set THIS.controlsource = [THISFORM.s_data(ccn)] but the control's controlsource property still had the S_date[ccn] code in it, again which "takes priority, the init or the controlsource property? What I wondering is with either or both do I HAVE to edit controlsource and physically remove the S_date[ccn]?
>With lots of controls and lots of forms to convert, it would certainly be easier to ignore it.
You can set the controlsource a thousand times if you want. The latest one holds. The one you set in a PEM window is what gets set first (before any code is executed), but you can override it on code - and the last override is the one it will use.
>2. The program that converted the old code created names for the controls according to its conventions.
>So if I use the forms init, and since I have to use the real names of the controls instead of "text1" that you've used, is there a way to general a list of the control names with their corresponding controlsources to cut and paste into the list that I have to create? Do I open the .scx, parse out the CONTROLSOURCE line from a "list for 'CONTROLSOURCE = 'S_DATA'$upper(PROPERTIES)?
>Do I write some code to get the Objname of the records set I want and Replace the init of the same record/object with it's contents plus:
>"this.controlsource=[thisform.s_data(ccn)"
>
>Or is there some nice utility that lists that type of "stuff" for me?
You can tweak the recurse class I recently uploaded here (download #
21923) and tweak the sample code to your purposes. You may actually make it generate the code for you, into a text file, and then just paste that code into your method.