// // REBAK.VDM Christian Ziemski 15.06.2001 // 23.01.2003 // 01.06.2006 // // Reactivates the .BAK file version of the currently open file. // // => The current buffer and file is deleted!!! // If the cuurent buffer/file has been modified since last open the macro // will ask the user for confirmation to reactivate the .BAK file // if(! Is_Open_Write){ Return } Reg_Set(103, PATHNAME) if(Config(F_BACKUP_MODE) == 1){ Reg_Set(104, PATHONLY) Reg_Set(104, "/", APPEND) Reg_Set(104, FILEONLY, APPEND) Reg_Set(104, ".BAK", APPEND) } if(Config(F_BACKUP_MODE) == 2){ Reg_Set(104, BACKUP) Reg_Set(104, "/", APPEND) Reg_Set(104, FILENAME, APPEND) } if(Config(F_BACKUP_MODE) > 2 ){ // 3 or 4 Reg_Set(104, PATHNAME) Reg_Set(104, ".BAK", APPEND) } if(Is_Altered){ Alert() Statline_Message("Modified! Back to .BAK? Y/N") while ((#103=Get_Key()&0xFFDF)!='Y' && #103!='N') { Alert() } if(#103=='N'){ Statline_Message("Nothing done!") return } } if(File_Exist(@104)){ Buf_Empty(OK) File_Rename(@104, "|@(103).rebak") // save bak File_Rename(@103, @104) // orig becomes bak File_Rename("|@(103).rebak", @103) // bak becomes orig File_Open("|@(103)") Statline_Message(".BAK file reactivated!") }else{ Alert() Statline_Message("No .BAK file found!") }