On 05/07/17 11:58, Fernando Cabral wrote:
I have found and worked around the problem. When you do the following:
*Dim Expressions as string[] =
Split(File.Load("/home/fernando/.config/libreoffice/4/user/basic/indesejaveis.txt"),
"\n") *
The last item pushed into *Expressions* is an empty string ("") even though
it DOES NOT exist
in the file. So, the expressions are compiled one after the other til the
last one, that is empty. Then the program crashes.
So it seems there is a bug in the *load.file()*. Bug that I was able to
compensate for by adding the option *True* in the call to the functions
*split()*.
I think you might find that the last character of indesejaveis.txt is a
\n (as is the case for many, many files) so in actual fact your original
split did exactly what it was supposed to do.
And your work around is correct. Although it is not actually a work
around it is a very common construct when dealing with text files.
So, I very much doubt there is a bug in File.Load()
b
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user