PROGRAM Missing_VA; {-- *************************************************************************** -- ** Descr. : This demo script reports all visible items that don't have a -- ** visual attribute assigned. -- *************************************************************************** -- ** 17/12/01 1.001.00 Initial Creation, muellers@orcl-toolbox.com -- ***************************************************************************} var ps : TParamScreen; x : tparamboard; i,i2 : integer; s : string; frm : integer; v_obj : integer; ts : tstringlist; ol : tstringlist; formsname : string; shortname : string; fname : string; BEGIN ps := TParamScreen.create; x := ps.AddBoard('Analyze missing Shortcuts',picOptions); x.addparam(parLabel,'MYLABEL','Please select the basepath of the modules that you wish to analyze for missing visual attributes:','',''); x.addparam(parPathname,'MYPATH','Basepath',extractfiledir(paramstr[0]),''); x.addparam(parLabel,'MYLABEL2','... and specify the filename for the results:','',''); x.addparam(parsaveFilename,'P_LOGSAVE','Log Filename','c:\miss_visattribs.txt',''); x.addparam(parLabel,'MYDBLAB','Connection to use:','',''); x.addparam(parDatabaseLogon,'MYDB','Database',{'keyowner/ty12@ty12'}'',''); if ps.ShowParamScreen('') then begin fname := ps.paramvalue('P_LOGSAVE'); deletefile(fname); ts := GetFileList(ps.paramvalue('MYPATH') ,'*.fmb', true); logadd('number of objects: '+inttostr(ts.count)); api_connect(ps.paramvalue('MYDB')); for i := 0 to ts.count-1 do begin try frm := api_loadmodule(ts.strings[i],false); shortname := rpad(extractfilename(ts.strings[i]),20); formsname := generic_GetTextProp(frm, D2FP_NAME); logadd(formsname+' ('+inttostr(i+1)+'/'+inttostr(ts.count)+')'); ol := API_getallitemobjects(frm); for i2 := 0 to ol.count-1 do begin v_obj := ol.objects[i2]; if generic_GetNumProp(v_obj, D2FP_ITM_TYP) = D2FC_ITTY_PB then continue; s := api_GetObjectName(v_obj); if (generic_getTextProp(v_obj,D2FP_VAT_NAM)='DEFAULT') and (generic_getBoolProp(v_obj,D2FP_VISIBLE) = true) and (s<>'FIRST_PLACE_TO_GO') and (leftstring(s,4)<>'Z___') and (generic_getTextProp(v_obj,D2FP_CNV_NAM) <> '') then saveappendstring(shortname+api_getobjectpath(v_obj)+' [missing visual attribute!]'+c_cr,fname); end; api_destroymodule(frm); except logadd('Error loading '+ts.strings[i],logerror); end; end; api_disconnect; ts.free; host('notepad.exe '+fname,false); end else begin logadd('pressed cancelbutton on parameterscreen!'); end; ps.free; END.