** END HEADER -- do not remove this line // // Generated on 2008/10/20 // parameter bModal local f f = new create_subformForm() if (bModal) f.mdi = false // ensure not MDI f.readModal() else f.open() endif class create_subformForm of FORM with (this) onOpen = class::FORM_ONOPEN height = 16.0 left = 70.2857 top = 6.6818 width = 40.0 text = "Create Sub-form" endwith this.COMBOBOX1 = new COMBOBOX(this) with (this.COMBOBOX1) onChange = class::COMBOBOX1_ONCHANGE height = 1.0 left = 5.2857 top = 1.7727 width = 29.4286 style = 1 // DropDown endwith this.ENTRYFIELD1 = new ENTRYFIELD(this) with (this.ENTRYFIELD1) height = 1.0 left = 5.1429 top = 11.1818 width = 29.5714 value = "" endwith this.TEXTLABEL1 = new TEXTLABEL(this) with (this.TEXTLABEL1) height = 1.0 left = 7.1429 top = 9.3636 width = 27.7143 text = "Sub-form name (Edit if required)" endwith this.PUSHBUTTON1 = new PUSHBUTTON(this) with (this.PUSHBUTTON1) onClick = class::PUSHBUTTON1_ONCLICK height = 1.0909 left = 11.5714 top = 13.4545 width = 15.2857 text = "Create Sub-form" endwith function COMBOBOX1_onChange form.entryfield1.value = substr(form.combobox1.value,1,at('.',form.combobox1.value))+"sfm" return function form_onOpen clear form.combobox1.value = "Select a form to convert" aFullDir = new array() aNames = new array() aDir(aFullDir,"sub*.wfm") for n = 1 to aFullDir.size / 5 if not "BACKUP"$upper(aFullDir[n,1]) aNames.add(aFullDir[n,1]) endif next form.combobox1.datasource = 'array aNames' return function PUSHBUTTON1_onClick form.subname = form.entryfield1.value cfIn = form.combobox1.value cfOut = form.subname fIn = new File() fOut = new File() fIn.open(cfIn) fOut.create(cfOut) cRead = "" do while not "CLASS"$upper(cRead) cRead = fIn.readln() enddo cRead = stuff(cRead,at(" ",cRead,2),0,"( oParent, cTitle )") cRead = stuff(cRead,at("OF FORM",upper(cRead)),7,"of SUBFORM( oParent, cTitle )") fOut.puts(cRead) do while not fIn.eof() fOut.puts(fIn.readln()) enddo fIn.close() fOut.close() return endclass