Opening project must not load previous open file list

Opening project must not load previous open file list

24
Basic UserBasic User
24

    Aug 25, 2006#1

    Hi

    Does anyone know how to prevent Open Project/Workspace from loading the previous open file list? The setting 'Reload file previously open on Startup" is not ticked and I can't find a setting to disable a project reloading files when I open it. Is this possible?

    Thanks

    344
    MasterMaster
    344

      Aug 25, 2006#2

      Well, it works by hand.
      Example: Remove all the red settings under section "openFiles" in the prj-file:
      [Open Files]
      Open File0=FTP::bla
      Open File Pos0=0
      Open File Line0=0
      Active File Index=1
      Open File Window Pos0=0,1,-1,-1,-4,-30,132,174,1063,718
      Open File1=FTP::blabla
      Open File Pos1=0
      Open File Line1=0
      Open File Window Pos1=2,3,-1,-1,-4,-30,154,203,1089,751
      Open File2=

      Active File Display Mode=3
      You might write a macro or perl-script or whatever to automate it.

      rds Bego
      Normally using all newest english version incl. each hotfix. Win 10 64 bit

      6,681583
      Grand MasterGrand Master
      6,681583

        Aug 25, 2006#3

        You maybe can also set the read-only file attribute on the project file after removing the open file settings. But I never tested it. Well, you have to remove the read-only attribute when you add or remove files/folders from the project or you want to change a project setting.

        However, projects/workspaces are designed for opening last used files and restore their windows, cursor positions, bookmarks and code foldings. That's what I and I think also most other users expect from a project/workspace. So there is no "Do not open files when opening a project" option.
        Best regards from an UC/UE/UES for Windows user from Austria

        24
        Basic UserBasic User
        24

          Aug 25, 2006#4

          Thanks
          @Mofi - Well that is ONE of the reasons I guess you could give for having a workspace - but projects in UEdit are useful to me for the following reasons:
          1. I can add CTags
          2. I can filter on file types and hence
          3. I can do a "search in" more effectively

          Having a project re-open all previously open files makes the project load slowly and that is why I am interested in having this functionality. Obviously the other way to prevent a project reloading previously open files is to close the files before I close the project.

          Thanks for taking the time to post your replies.

          344
          MasterMaster
          344

            Aug 25, 2006#5

            Hi to both of you,

            I found a comfortable solution:

            - copy the ff. vbscript to your disk e.g. c:\ue_kill_open_files_from_prj.vbs
            - make a shortcut to it in your Windows SendTo folder (see Mofis windows explorer settings if you can't find it in e.g. "C:\Documents and Settings\YOURUSERNAME\SendTo"

            now when you see the open Project Window and you see your prj, just before double-clicking and opening it, press right mouse and choose "send to ue_kill_open_files_from_prj.vbs".
            Your open-files will be removed from the prj-file :-)
            then double click or press open for opening it like before.

            NO WARRANTY ! Make a backup of your prj file before trying.


            rds Bego

            Code: Select all

            Option Explicit
            
            'ue_kill_open_files_from_prj.vbs
            'deletes all entries with "open file" lines, so that when opening prj, no files are shown
                Dim fso
                Dim objFile
                'Dim objTextStream
                Dim fileName
                Dim args
                dim newLines()
                dim i
                dim j
                dim strLine
                set args = WScript.Arguments
                if (args.Count <> 1) Then
                    MeldungRaus "Wrong arguments"
                End If
                fileName = args(0)
            
                Set fso     = CreateObject("Scripting.FileSystemObject")
                Set objFile = fso.OpenTextFile(fileName)
                i = 0
                Do while not objFile.AtEndOfStream
                strLine = objFile.ReadLine()
                'collect olny lines without "open file" inside
                if (InStr(1,strLine, "open file", 1) = 0 and InStr(1,strLine, "Active File", 1) = 0 ) then
                    i = i + 1
                    redim preserve newLines(i)
                    newLines(i) = strLine
                end if
                Loop
                objFile.Close
            
                'now write back the stuff without filtered lines
                Set objFile = fso.OpenTextFile(fileName,2, true)
                for j = 1 to i
                    objFile.write newLines(j) & vbcrlf
                    'msgbox (newLines(j))
                next
                objFile.Close
            
                wscript.quit
            
            Sub MeldungRaus (strMeld)
            
                wscript.echo strMeld
                wscript.quit 1
            
            End Sub
            
            Normally using all newest english version incl. each hotfix. Win 10 64 bit