// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // ! This script is provided "as is" by Applied Maths. ! // ! You are free to use and modify this script for your own needs. ! // ! Redistribution or reproduction of the script is prohibited. ! // ! DISCLAIMER: ! // ! Improper use of scripts may corrupt your database. ! // ! Running this script is entirely at your own responsibility. ! // ! Applied Maths accepts no lialibility for any consequences ! // ! resulting from its use. ! // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! integer i,save; DIALOG dlg; string fieldlst,fieldname,string1,string2; string key; save=1; for i=1 to DbGetFieldCount do fieldlst=fieldlst+DbGetFieldName(i)+" "; DlgAddText(dlg,"Select a database field",15,15,150,15); DlgAddList(dlg,fieldlst,fieldname,15,35,150,150,"LIST"); DlgAddText(dlg,"Replace",180,20,100,15); DlgAddEdit(dlg,string1,190,40,170,20); DlgAddText(dlg,"By",180,80,100,15); DlgAddEdit(dlg,string2,190,100,170,20); DlgAddCheck(dlg,"Save changes",save,15,190,150,15); while length(fieldname)<=0 do if not(DlgShow(dlg,"Replace database fields",380,250)) then stop; for i=1 to DbGetEntryCount do { key=DbGetEntryKey(i); if DbGetField(key,fieldname)=string1 then DbSetField(key,fieldname,string2); } if save then DbSaveFields;