Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > Delphi программирование > БД в Delphi
Регистрация

Восстановить пароль

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 22.11.2010, 21:09   #1
Ingrida
 
Регистрация: 16.05.2010
Сообщений: 3
По умолчанию Метод Lookup

Подскажите пожалуйста, что здесь не так???

Код:
procedure TForm1.Button14Click(Sender: TObject);
var
  LookupResult:Variant;
begin
  if CheckBox1.Checked=true then
    Case RadioGroup1.ItemIndex of
    0: LookupResult:=Table1.Lookup('Name',Edit3.Text,'Genre; Producer; Language');
          if VarType(LookupResult)=VarNull then
             ShowMessage(Edit3.Text+ ' not found') else
                if VarType(LookupResult)=VarEmpty then
                ShowMessage('Поиск не проведен!') else
                   if VarIsArray(LookupResult) then
                   begin
                     Label6.Caption:=LookupResult[0];
                     Label7.Caption:=LookupResult[1];
                     Label8.Caption:=LookupResult[2];
                   end; // здесь ошибка :( ''constant expression expcted
     1: LookupResult:=Table1.Lookup('Producer',Edit3.Text,'Genre; Language; Popularity');
          if VarType(LookupResult)=VarNull then
             ShowMessage(Edit3.Text+ 'not found') else
                if VarType(LookupResult)=VarEmpty then
                ShowMessage('Поиск не проведен') else
                   if VarIsArray(LookupResult) then
                   begin
                     Label6.Caption:=LookupResult[0];
                     Label7.Caption:=LookupResult[1];
                     Label8.Caption:=LookupResult[2];
                   end;
end;
end;
Ingrida вне форума Ответить с цитированием
Старый 23.11.2010, 10:16   #2
BeJIuKuu_Hexo4yxa
Пользователь
 
Регистрация: 13.10.2010
Сообщений: 96
По умолчанию

Попробуй каждый из вариантов case обрамить в begin end
Код:
   Case RadioGroup1.ItemIndex of
    0: begin
          LookupResult:=Table1.Lookup('Name',Edit3.Text,'Genre; Producer; Language');
          if VarType(LookupResult)=VarNull then
             ShowMessage(Edit3.Text+ ' not found') else
                if VarType(LookupResult)=VarEmpty then
                ShowMessage('Поиск не проведен!') else
                   if VarIsArray(LookupResult) then
                   begin
                     Label6.Caption:=LookupResult[0];
                     Label7.Caption:=LookupResult[1];
                     Label8.Caption:=LookupResult[2];
                   end; // здесь ошибка :( ''constant expression expcted
        end;
     1: begin
          LookupResult:=Table1.Lookup('Producer',Edit3.Text,'Genre; Language; Popularity');
          if VarType(LookupResult)=VarNull then
             ShowMessage(Edit3.Text+ 'not found') else
                if VarType(LookupResult)=VarEmpty then
                ShowMessage('Поиск не проведен') else
                   if VarIsArray(LookupResult) then
                   begin
                     Label6.Caption:=LookupResult[0];
                     Label7.Caption:=LookupResult[1];
                     Label8.Caption:=LookupResult[2];
                   end;
        end;
Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете. (Стив Макконнелл)
BeJIuKuu_Hexo4yxa вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск


Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Lookup поля Snake999 БД в Delphi 1 08.05.2010 03:54
Фильтр по lookup в ADOTable cyphers1313 БД в Delphi 16 21.04.2010 17:43
lookup-поле freez1992 БД в Delphi 4 25.02.2010 20:38
Lookup Question london735 Microsoft Office Excel 5 26.10.2009 08:18
Lookup BAV БД в Delphi 0 07.09.2008 12:31