Changeset 1408 for trunk


Ignore:
Timestamp:
Mar 16, 2009, 6:58:20 PM (17 years ago)
Author:
John Small
Message:

CFGMGR.CMD: Changed to copy old dircnr state keys to new names

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cfgmgr.cmd

    r1150 r1408  
    33
    44   CFGMGR.CMD - manage installation, maintenance and deinstallation
    5                                  of FM/2 configuration files
     5                of FM/2 configuration files
    66
    77   Optional Parameters:
     
    588588            LastToolbar = 'CMDS.TLS'
    589589         else
    590                 LastToolbar = LastToolbox
     590            LastToolbar = LastToolbox
    591591        call SysIni cfg.inifile, 'FM/3', 'LastToolbar', LastToolbar
    592592      end
     
    595595   if SysIni(cfg.inifile, 'FM/4', 'LastToolbar') = 'ERROR:' then
    596596                call SysIni cfg.inifile, 'FM/4', 'LastToolbar', LastToolbar
     597   do /* Copy old details keys to new names */
     598      /* Check for old/new version numbers first? */
     599      StateNames = SysIni(cfg.inifile, 'FM/3', 'LastSetups')
     600      KeyFragments = 'Dir Filter Pos Sort View'
     601      NumKeyFragments = words(KeyFragments)
     602      null = '00'x
     603      if StateNames = 'ERROR:' then
     604         StateNames = 'FM2Shutdown' || null
     605      else
     606         if pos('FM2Shutdown' || null, StateNames) = 0 then
     607            StateNames = StateNames || 'FM2Shutdown' || null
     608      do while StateNames \= ''
     609         parse var StateNames StateName (null) StateNames
     610         NumDirCnrs = SysIni(cfg.inifile, 'FM/3', StateName || '.NumDirsLastTime')
     611         if NumDirCnrs \= 'ERROR:' then
     612            do
     613               NumDirCnrs = c2d(reverse(NumDirCnrs)) - 1  /* for 0 to num-1 loop */
     614               do d = 0 to NumDirCnrs
     615                  do f = 1 to NumKeyFragments
     616                     frag = word(KeyFragments, f)
     617                     OldKey = StateName || '.DirCnr' || frag || '.' || d
     618                     OldKeyValue = SysIni(cfg.inifile, 'FM/3', OldKey)
     619                     NewKey = StateName || '.DirCnr.' || d || '.' || frag
     620                     NewKeyValue = SysIni(cfg.inifile, 'FM/3', NewKey)
     621                     if (OldKeyValue \= 'ERROR:' & NewKeyValue = 'ERROR:') then
     622                        rcx = SysIni(cfg.inifile, 'FM/3', NewKey, OldKeyValue)
     623                  end
     624               end
     625            end
     626      end
     627   end
    597628return
    598629
Note: See TracChangeset for help on using the changeset viewer.