[Mono-dev] Possible problem with 2.0RC1
Paul
paul at all-the-johnsons.co.uk
Wed Sep 17 18:31:55 EDT 2008
Hi,
> I have some very simple code which has become unpredictable.
I've done some more tests and it looks like there may be a problem with
when adding code to a list<>
Changes to the previous code - if it was a bool, it's now a string (with
alterations in other methods to reflect this)
> private void splitline(string line)
> {
> string[] stringy = line.Split(new char[] {','});
>
> for (int m = 2; m < 6; ++m)
> {
> if (stringy[m] != "")
> stringy[m] = remquotes(stringy[m]);
> }
>
> // 1st column = plural (1 = yes) set as true if correct
> // 2nd column = verb (1 = yes) set as true if correct
if (stringy[0].Length > 1)
Console.WriteLine("position {0}. Plural is > 1 character",
counter);
if (stringy[1].Length > 1)
Console.WriteLine("position {1}. Verb is > 1 character",
counter);
> words.Add(new conversion((stringy[0] == "1" ? true : false),
> (stringy[1] == "1" ? true : false),
The test has gone and these become just stringy[0], stringy[1]
> stringy[2], stringy[3], stringy[4],
> stringy[5], stringy[6]));
>
> if (stringy[1] == "1")
> {
> Console.WriteLine("word {0}, is a verb", stringy[3]);
> }
> }
The potential problem of an incorrect assignment being made to isplural
or isverb has now gone. When I run the application, it's fine but still
comes up with the same problem of a noun suddenly becoming a verb. The
only way this can happen is if there is something up with the list<>.Add
method.
Full source (with binaries and test file)
http://www.all-the-johnsons.co.uk/csharp/proto.tar.bz2
If anyone can have a look to see if I've messed up or if it is
list<>.Add at fault, I'd appreciate it.
TTFN
Paul
--
Sie können mich aufreizen und wirklich heiß machen!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080917/5310b109/attachment.bin
More information about the Mono-devel-list
mailing list