' Stripper.ave ' Strips all DocAct and PanMgr objects from a project file if it doesn't ' depend on the Dialog Designer extension, and strips references to update ' scripts normally found in 3.1 but not in 3.0x infn = FileDialog.Show("*.apr","APR Files","Input 3.1 Project File") RFile = LineFile.Make(infn,#FILE_PERM_READ) outfn = infn.ReturnDir.MakeTmp("proj","apr") outfn = FileDialog.Put(outfn,"*.apr","Output 3.0 Project File") if (outfn = nil) then RFile.Close RFile = nil av.PurgeObjects return nil end '**** Get list of DocAct and PanMgr objects UsesDD = FALSE de_list = List.Make numr = RFile.GetSize r = 0 av.ClearMsg av.ClearStatus av.ShowMsg("Analyzing project file...") while (RFile.IsAtEnd.Not) buf = RFile.ReadElt r = r + 1 av.SetStatus(r / numr * 100) if (buf.IndexOf("Dependencies:") > -1) then if (buf.IndexOf("dialog.avx") > -1) then UsesDD = TRUE break end end s = buf.Left(8) if ((s = "(DocAct.") or (s = "(PanMgr.")) then objnum = buf.AsTokens(".").Get(1).AsNumber de_list.Add(objnum) end end RFile.GoToBeg s_list = {"Graphic.Neatline ShowUpdate", "Layout.TextToolUpdate", "Project.AddTableUpdate", "Project.ImportUpdate", "ShapeWin.PopUp Update", "TocDefs.ShowUpdate", "View.CalloutUpdate", "View.TextToolUpdate", "View.ToggleTolCursorUpdate", "WizardBuffer.OpenDialogUpdate"} WFile = LineFile.Make(outfn,#File_PERM_WRITE) r = 0 av.ClearMsg av.ClearStatus av.ShowMsg("Writing project file...") while (RFile.IsAtEnd.Not) buf = RFile.ReadElt r = r + 1 av.SetStatus(r / numr * 100) '**** strip DocAct and PanMgr objects if (UsesDD.Not) then if (buf.IndexOf("DocExts:") > -1) then objnum = buf.Extract(1).AsNumber if (de_list.FindByValue(objnum) > -1) then continue end end s = buf.Left(8) if ((s = "(DocAct.") or (s = "(PanMgr.")) then while (buf <> ")") buf = RFile.ReadElt r = r + 1 end continue end end '**** strip 3.1 update script references if (buf.IndexOf("Update:") > -1) then sn = buf.AsTokens(":").Get(1).Trim.Unquote if (s_list.FindByValue(sn) > -1) then continue end end WFile.WriteElt(buf) end av.ClearMsg av.ClearStatus RFile.Close WFile.Flush WFile.Close