// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // ! 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. ! // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! DIALOG dlg; string fieldlst,fieldname; string key; integer i,save; for i=1 to DbGetFieldCount do fieldlst=fieldlst+DbGetFieldName(i)+" "; DlgAddText(dlg,"Select the field to copy the key to:",15,15,150,15); DlgAddList(dlg,fieldlst,fieldname,15,35,150,150,"LIST"); DlgAddCheck(dlg,"Save changes to disk",save,15,190,150,15); while length(fieldname)<=0 do if not(DlgShow(dlg,"Copy key to field",300,240)) then stop; setbusy("Processed 0"); for i=1 to DbGetEntryCount do { if floor(i/5)=i/5 then setbusy("Processed "+str(i,0,0)); key=DbGetEntryKey(i); DbSetField(key,fieldname,key); } if save then DbSaveFields; setbusy("");