[galib] GAListGenome raise exception in C++ Builder

xm yang vchs62003 at yahoo.com.cn
Mon May 28 20:32:30 EDT 2007


Hi,
There is a method in my class TMyGenome  derivd from  GAListGenome<AnsiString> as follows:

void __fastcall TMyGenome::SetGeneString(AnsiString value)
{
        value = value.Trim();
        int l = value.Length();
        if(l < FMinLength || l > FMaxLength)
                throw("Length of genome is too long!");
        AnsiString s;
        head();
        for(l = Length; l > 0; l--)
                this->destroy();
        while(value != "") 
        {
                l = value.Pos(".");
                s = value.SubString(1, l - 1);
                this->insert(s);  /*add node*/
                value = value.SubString(l + 1, value.Length());
        }
}

However,  when the number of  calling insert  is great than 1 a exception class EAccessViolation with message. Why about it and what can I do.




      ___________________________________________________________ 
ÇÀ×¢ÑÅ»¢Ãâ·ÑÓÊÏä3.5GÈÝÁ¿£¬20M¸½¼þ£¡ 
http://cn.mail.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/galib/attachments/20070529/0065e4ad/attachment.htm


More information about the galib mailing list