Skip to content

Instantly share code, notes, and snippets.

@jbratu
Created November 11, 2019 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbratu/34151af5a161116e46d2b055b55c52be to your computer and use it in GitHub Desktop.
Save jbratu/34151af5a161116e46d2b055b55c52be to your computer and use it in GitHub Desktop.
Subroutine CS_LIST_TABLES_AND_CLEAR(void)
Declare Function Get_Status, List_Index_Detailed
declare function Set_FSError, CS_RLIST_UTIL, Dialog_box, List_Volume_Sub
declare subroutine RLIST
$Insert Logical
Volume = 'C:\SomePath\Volume\ToClean'
Tables = List_Volume_Sub(Volume,'','','')
TablesCount = DCOUNT(Tables, @FM)
TablesToClear = ''
TablesWithIndexes = ''
For i = 1 To TablesCount
Table = Tables<i,1>
If Table[1,1] NE '!' and Table[1,5] NE 'DICT.' then
TablesToClear<-1> = Table
end
If Table[1,1] EQ '!' then
TablesWithIndexes<-1> = Table
end
Next i
Table = ''
TablesToClearCount = DCOUNT(TablesToClear,@FM)
For i = 1 TO TablesToClearCount
Table = TablesToClear<i>
Call Clear_Table(Table)
Next i
TablesWithIndexesCount = DCOUNT(TablesWithIndexes, @FM)
For i = 1 To TablesWithIndexesCount
Table = TablesWithIndexes<i>
Call Update_Index(Table, "", "")
Next i
Debug
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment