Watchlist management

I have written a block of code to delete all watchlist and then I want to create a new index with just 3 entries: List 0, List 1, and List 3. However, every time when I tried to create a watchlist with List entries that are less than 63 (the default original number of lists), the index although did create only 3 lists, but when I get out and get back in, the index automatically writes back to 63 List entries again. Here are my code.

Param("WATCHLIST PROPERTIES ++++++++++++++++++++++++++++++++++++", 0,0,0,0);
		ListEntries = Param("Number of entries in WatchList Index: ", 3, 1, 63, 1);
		OriginalEntry = ParamToggle("Create Original WatchList Index ? ", "No|Yes", 0);    // default No

default_Directory = "I:\\";
default_Directory += GetDatabaseName();
default_Directory += "\\WatchLists\\";


for ( i = 0; i < ListEntries + 1; i++ ) 
 { 
     CategoryRemoveSymbol("", categoryWatchlist, i);
 } 


// delete all files
_N(list = fdir( default_Directory + "*.*", 1 )); 
for ( i = 0; ( filename = StrExtract( List, i ) ) != ""; i++ ) 
 { 
     fdelete( default_Directory + filename) ;
 } 

if (OriginalEntry) ListEntries = 63;

// Create the orginal index file
outfile = default_Directory + "index.txt";
fh = fopen(outfile, "w");

if(!fh == 0){
		for (i=0; i < ListEntries + 1; i++) {
				fputs("List " + i + "\n", fh);
		}
		
		fclose (fh);
}

Please help. Thanks,

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.