Snippets

SeanB Reopen all files (untested)

Created by SeanB
Use cApplication.pkg


Procedure ReopenAll Integer hWorkspace 
    //first we need to reset the workspace. this can be different 
    //for clubwise because we do not use standard workspace objects. 
    //And we're still on 11. try it though.
    
    Set psDataPath of hWorkspace to "c:\new\data"
    Set psFileList of hWorkspace to "c:\new\data\filelist.cfg"
    Send DoSetPaths to hWorkspace 
    
    //next we need to close all open files - get list with DF_FILE_NEXT_OPENED
    Move 0 To hTable
    Repeat
        Get_Attribute DF_FILE_NEXT_OPENED of hTable to hTable
        If (hTable > 0) Begin
            Close hTable 
            Open hTable 
        End
    Until (hTable = 0)
End_Procedure

//Junior - If this does not work, you can try using OPEN AS to open the files 
//so...

Procedure ReopenAll 
    String sFolder 
    Move "c:\new\" to sFolder    
    //next we need to close all open files - get list with DF_FILE_NEXT_OPENED
    Move 0 to hTable
    Repeat
        Get_Attribute DF_FILE_NEXT_OPENED of hTable to hTable
        If (hTable > 0) Begin
            Get_Attribute DF_FILE_ROOT_NAME of hTable to sRoot
            Close hTable 
            Open (sFolder+sRoot+".int") as hTable 
        End
    Until (hTable = 0)
End_Procedure

//I've not tried any of these out - or even compiled, but see if they work for you. 

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.