>Hi All!
>
>What is the best way to pack a table in a multiuser env?
>Is there any way to detect if a table is open by other users.
>I need to do some cleanup when the program is terminated, if
>the table is not in use.
>
>
>Best regards
>
>Per Simmersholm
Per,
I simply open the table exclusively (USE ... EXCLU) and trap the error (ON ERROR) that is triggered if the table could not be opened exclusively is open on an other station. The error that is generated is nr 108 if the table is in used on another station is 108 ... most of the time. The easiest is to create and set a private variable (say to 0) just before you open the file, let your error handler set the variable (say to 1) if it exist (use TYPE()) and test the variable after the opening sequence. If it is still 0, then you opened your file exclusively, otherwise, the opening instruction failed of one or another reason. Do not forget to RELEASE the variable if you do not need it anymore.
HTH,
Marc
If things have the tendency to go your way, do not worry. It won't last. Jules Renard.