Lena Posted November 11, 2015 Share Posted November 11, 2015 Hi Can we use return in mobile application? I see form. Why is that? void __fastcall TUnimFormRooms::UnimDBGridRoomsClick(TObject *Sender) { UniMainModule()->FDQueryDat->Active = false; UniMainModule()->ClientDataSetDat->Active = false; UniMainModule()->FDQueryDat->ParamByName(L"ROOMSID")->AsInteger = UniMainModule()->ClientDataSetRooms->FieldByName(L"id")->AsInteger; UniMainModule()->FDQueryDat->Active = true; UniMainModule()->FDQueryDat->FetchAll(); UniMainModule()->FDQueryDat->First(); UniMainModule()->ClientDataSetDat->Active = true; if(UniMainModule()->ClientDataSetDat->RecordCount == 0) { ShowMessage(L"I am here!");//I see this message return;//does not work } UnimFormDat()->ShowModal();//Why I see this form? } Link to comment Share on other sites More sharing options...
Lena Posted November 11, 2015 Author Share Posted November 11, 2015 The same problem if I use else void __fastcall TUnimFormRooms::UnimDBGridRoomsClick(TObject *Sender) { UniMainModule()->FDQueryDat->Active = false; UniMainModule()->ClientDataSetDat->Active = false; UniMainModule()->FDQueryDat->ParamByName(L"ROOMSID")->AsInteger = UniMainModule()->ClientDataSetRooms->FieldByName(L"id")->AsInteger; UniMainModule()->FDQueryDat->Active = true; UniMainModule()->FDQueryDat->FetchAll(); UniMainModule()->FDQueryDat->First(); UniMainModule()->ClientDataSetDat->Active = true; if(UniMainModule()->ClientDataSetDat->RecordCount == 0) { ShowMessage(L"I am here!");//I see this message //return; } else { UnimFormDat()->ShowModal();//Why I see this form? } } Link to comment Share on other sites More sharing options...
Lena Posted November 20, 2015 Author Share Posted November 20, 2015 Up Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted November 21, 2015 Administrators Share Posted November 21, 2015 Hi, Have you debugged your code in IDE to see why "return" is skipped? Link to comment Share on other sites More sharing options...
Lena Posted November 23, 2015 Author Share Posted November 23, 2015 I debugged my code. Breakpoint in line ShowMessage(L"I am here!"); I see this message. Then I press F8 and I see UnimFormDat. if(UniMainModule()->ClientDataSetDat->RecordCount == 0) { ShowMessage(L"I am here!");//I see this message. Press F8 for the next line } else { UnimFormDat()->ShowModal();//and I see this form in my app. } Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted November 23, 2015 Administrators Share Posted November 23, 2015 I debugged my code. Breakpoint in line ShowMessage(L"I am here!"); I see this message. Then I press F8 and I see UnimFormDat. if(UniMainModule()->ClientDataSetDat->RecordCount == 0) { ShowMessage(L"I am here!");//I see this message. Press F8 for the next line } else { UnimFormDat()->ShowModal();//and I see this form in my app. } Can you reproduce in a small test case? Link to comment Share on other sites More sharing options...
Recommended Posts