Jump to content

Can we use "return" in mobile application?


Lena

Recommended Posts

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

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

  • 2 weeks later...

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

  • Administrators

 

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

×
×
  • Create New...