Lazarus

Programming => Packages and Libraries => KOL => Topic started by: Neoc on August 18, 2010, 12:08:11 pm

Title: Why it not work? KOL-CE
Post by: Neoc on August 18, 2010, 12:08:11 pm
KOL-CE Application, ComboBox1 is TKOLComboBox .
dbf1: TDBF

dbf1.Edit;
dbf1.FieldbyName('CurrentStatus').AsString := ComboBox1.Text;
dbf1.FieldbyName('CurrentID').AsInteger := 1;
dbf1.Post;

dbf1.FieldbyName('CurrentID').AsInteger := 1; This line worked, but
dbf1.FieldbyName('CurrentStatus').AsString := ComboBox1.Text; not work.
Why?

Thanks!
Title: Re: Why it not work? KOL-CE
Post by: Neoc on August 19, 2010, 12:24:58 am
ComboBox1.Text is a chinese word.
ComboBox1.Text is KOLString, must change to string?
dbf1.FieldByName('CurrentStatus').AsString := WideCharToString(PWideChar(ComboBox1.Text)); it still doesn't work.

Anybody tell me why?
Thanks!
Title: Re: Why it not work? KOL-CE
Post by: felipemdc on August 19, 2010, 12:49:58 pm
Try this:

dbf1.FieldbyName('CurrentStatus').AsString := UTF8Encode(ComboBox1.Text);