dmla
04-07-2005, 06:21 AM
This function is for word searching in SQLite database. I cannot get error message. I need to write "Word was not find" when it will be an error during sqlite searching. HELP ME PLEASE.
tWords_Selected = SQLite.QueryToTable (db, "Select * from Words Where Label='"..input_result.."'");
if tWords_Selected.Data[1]["Label"] ~= nil then
word_id = tWords_Selected.Data[1]["RecordID"];
word_label = tWords_Selected.Data[1]["Label"];
word_text = tWords_Selected.Data[1]["Text"];
word_sound = tWords_Selected.Data[1]["Sound"];
speak_word();
Paragraph.SetText("label", word_label);
Paragraph.SetText("text", word_text);
if word_id == 1 then
Button.SetVisible("ButtonLeft", false);
Button.SetVisible("ButtonRight", true);
end
if word_id == word_id_max then
Button.SetVisible("ButtonLeft", true);
Button.SetVisible("ButtonRight", false);
end
end
tWords_Selected = SQLite.QueryToTable (db, "Select * from Words Where Label='"..input_result.."'");
if tWords_Selected.Data[1]["Label"] ~= nil then
word_id = tWords_Selected.Data[1]["RecordID"];
word_label = tWords_Selected.Data[1]["Label"];
word_text = tWords_Selected.Data[1]["Text"];
word_sound = tWords_Selected.Data[1]["Sound"];
speak_word();
Paragraph.SetText("label", word_label);
Paragraph.SetText("text", word_text);
if word_id == 1 then
Button.SetVisible("ButtonLeft", false);
Button.SetVisible("ButtonRight", true);
end
if word_id == word_id_max then
Button.SetVisible("ButtonLeft", true);
Button.SetVisible("ButtonRight", false);
end
end