Hi guys.
So, i'm suppose to make a translator, here's my form:
[IMG]http://img213.imageshack.us/img213/6067/12081833.jpg[/IMG]
When i press the middle button i have to check every word from left memo (MEMO1) and insert the translated word in the memo on the right (MEMO2).
So my middle button has the following code :
void __fastcall TForm1::BitBtn4Click(TObject *Sender)
{
AnsiChar *p;
Memo2->Lines->Clear();
p=strtok(Memo1->Text.c_str()," ,.-");
while (p != NULL)
{
Edit1->Text=p; //to see the word translated at the moment
if (p=="functie") Memo2->Text=Memo2->Text+"function ( )"; //function
if (p=="inceput") Memo2->Text=Memo2->Text+"{ "; //begin
if (p=="sfirsit") Memo2->Text=Memo2->Text+" }"; //end
if (p=="intreg") Memo2->Text=Memo2->Text+"integer "; //integer
//and so on...
p=strtok(NULL, " ,.-");
}
}
As a result if i insert (in memo1) the text: "functie inceput sfirsit"
I should get (in memo2) the text : "function () { }"
The problem is i just don't get anything, and i meen not 1 word or even char, and edit1 contains this crap "dgdg¸U" (wtf ?).
So what the hell am i doing wrong ? Any help will be very apreciated.