ed08724 6 Posted December 25, 2017 Report Share Posted December 25, 2017 really beating my head against a wall here.my code was working fine now all of a sudden I can't load a list from file and get empty clear list(%test)save to file("{$special folder("My Documents")}\\test.csv",%test)add list to list(%test,$list from file("{$special folder("My Documents")}\\test.csv"),"Delete","Global") when I run that I end up with a list with 1 blank item instead of a list with 0 items https://www.screencast.com/t/6LhZ6eRmh this messes up all the rest of the code.this is just a new snipit of code I wrote to test my issue. thanks and happy holidays! Quote Link to post Share on other sites
ed08724 6 Posted December 25, 2017 Author Report Share Posted December 25, 2017 I have fixed the issue although don't know why its all of a sudden an issue.load the file in as a table then convert to list create table from file("{$special folder("My Documents")}\\test.csv",&test)clear list(%test)add list to list(%test,$plugin function("TableCommands.dll", "$list from table", &test, "Column", 0),"Delete","Global"). Quote Link to post Share on other sites
HelloInsomnia 1103 Posted December 30, 2017 Report Share Posted December 30, 2017 I think its because the file you create will still have the first line and so it will register as a list item. However, there are no values and so you get an empty list item and when you use a table you also get an empty table. If you convert the table to a list then it would have no items. Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted December 30, 2017 Report Share Posted December 30, 2017 clear list(%test) save to file("{$special folder("My Documents")}\\test.csv",%test) add list to list(%test,$list from file("{$special folder("My Documents")}\\test.csv"),"Delete","Global") remove from list(%test,0) Remove from list will take care of that item Regards,CD Quote Link to post Share on other sites
ed08724 6 Posted December 30, 2017 Author Report Share Posted December 30, 2017 Code Docta, that was just a test case. when there are actually items in the list I can't just delete the first 1 Quote Link to post Share on other sites
HelloInsomnia 1103 Posted December 30, 2017 Report Share Posted December 30, 2017 Code Docta, that was just a test case. when there are actually items in the list I can't just delete the first 1 But you can check to see if it's blank, if that's what you're looking for? Like so: clear list(%test) save to file("{$special folder("My Documents")}\\test.csv",%test) add list to list(%test,$list from file("{$special folder("My Documents")}\\test.csv"),"Delete","Global") if($comparison($trim($list item(%test,0)),"=",$nothing)) { then { remove from list(%test,0) } else { } } Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.