#pragma rtGlobals=1 // Use modern global access method. Menu "Folder", dynamic FolderMenuItems(), /Q, HandleFolderMenuItem() End Function/S FolderMenuItems() if(exists("root:Segment")==2) nvar Segment=root:segment else variable /g root:Segment =0 endif String topFolder= GetDataFolder(1) String itemList ="(!"+ num2char(18) + topFolder+";" if( CmpStr(topFolder,"root:") != 0 ) itemList +="::;" endif Variable i,n= CountObjects(topFolder, 4) if(n>25 && Segment !=0) itemList +="Previous Folders"+";" endif variable imax if(n>25) imax = (Segment+1)*25 else imax =n endif for(i=(Segment*25); i25 && i