ChrShe Member Licensed User Longtime User Mar 4, 2013 #1 Good day! Please see the below cobbled together snippit: Code: Copy Dim favs As List favs.Initialize favs = File.ListFiles(Main.FavPath) Dim Tst as string = "This is a test" favs.Add(Tst) For i = 0 to favs.Size If favs.Get(i) = Tst Then favs.RemoveAt(i) End If Next ... The problem I'm having is whenever I try to do a favs.Add() or favs.RemoveAt(), I get a java exception of "UnsupportedOperationException". I've tried all the variations of these methods that I can come up with... Any Ideas? Oh...Main.FavPath is a valid path and does work. It equates to File.DirDefaultExternal & "/Favorites" Also...Might there be a way to get File.ListFiles to get only a certain file type? *.txt for instance. THANKS MUCH!!!!
Good day! Please see the below cobbled together snippit: Code: Copy Dim favs As List favs.Initialize favs = File.ListFiles(Main.FavPath) Dim Tst as string = "This is a test" favs.Add(Tst) For i = 0 to favs.Size If favs.Get(i) = Tst Then favs.RemoveAt(i) End If Next ... The problem I'm having is whenever I try to do a favs.Add() or favs.RemoveAt(), I get a java exception of "UnsupportedOperationException". I've tried all the variations of these methods that I can come up with... Any Ideas? Oh...Main.FavPath is a valid path and does work. It equates to File.DirDefaultExternal & "/Favorites" Also...Might there be a way to get File.ListFiles to get only a certain file type? *.txt for instance. THANKS MUCH!!!!
agraham Expert Licensed User Longtime User Mar 4, 2013 #2 From the documentation for File.ListFiles Returns a read only list with all the files and directories which are stored in the specified path[/B] Click to expand... Upvote 0
From the documentation for File.ListFiles Returns a read only list with all the files and directories which are stored in the specified path[/B] Click to expand...
ChrShe Member Licensed User Longtime User Mar 4, 2013 #3 Oh! I'm mortified! I've looked at that a number of times and never saw the "Read only" part.:sign0161: Thank you! :sign0013: Upvote 0
Oh! I'm mortified! I've looked at that a number of times and never saw the "Read only" part.:sign0161: Thank you! :sign0013: