Guest_imported
New member
- Jan 1, 1970
- 0
In the below code I want to be able to bypass the switch statment when the following condition is met, (MaskEdit1->Text==" : " . Could I put another case statment testing for " : " then break. Something like, case " : ": break; But how do I make a DWORD = " : "; ???
void __fastcall TForm1::MaskEdit1Exit(TObject *Sender)
{
const TDateTime HKoffsetStandard = TDateTime(8, 0, 0, 0);
TIME_ZONE_INFORMATION tzi2;
DWORD rValue2;
if(MaskEdit1->Text==" : " //thinking of putting this statment here but then what??????
TDateTime dtTime = StrToTime(MaskEdit1->Text);
rValue2 = GetTimeZoneInformation((LPTIME_ZONE_INFORMATION) &tzi2);
switch (rValue2)
{
case TIME_ZONE_ID_UNKNOWN:
{
Label9->Caption="ERROR3..";
break;
}
case TIME_ZONE_ID_STANDARD:
{
TDateTime dt;
try
{
MaskEdit2->Text=FormatDateTime("hh:mm", dtTime+HKoffsetStandard);
}
catch(...)
{
Application->MessageBox("Invalid hour, minute.", "ATZ Calculator", MB_OK);
}
break;
}
case TIME_ZONE_ID_DAYLIGHT:
{
TDateTime dt;
try
{
MaskEdit2->Text=FormatDateTime("hh:mm", dtTime+HKoffsetDaylight);
}
catch(...)
{
Application->MessageBox("Invalid hour, minute.", "mtprog", MB_OK);
}
break;
}
default:
Label9->Caption="ERROR4..";
break;
}
}
void __fastcall TForm1::MaskEdit1Exit(TObject *Sender)
{
const TDateTime HKoffsetStandard = TDateTime(8, 0, 0, 0);
TIME_ZONE_INFORMATION tzi2;
DWORD rValue2;
if(MaskEdit1->Text==" : " //thinking of putting this statment here but then what??????
TDateTime dtTime = StrToTime(MaskEdit1->Text);
rValue2 = GetTimeZoneInformation((LPTIME_ZONE_INFORMATION) &tzi2);
switch (rValue2)
{
case TIME_ZONE_ID_UNKNOWN:
{
Label9->Caption="ERROR3..";
break;
}
case TIME_ZONE_ID_STANDARD:
{
TDateTime dt;
try
{
MaskEdit2->Text=FormatDateTime("hh:mm", dtTime+HKoffsetStandard);
}
catch(...)
{
Application->MessageBox("Invalid hour, minute.", "ATZ Calculator", MB_OK);
}
break;
}
case TIME_ZONE_ID_DAYLIGHT:
{
TDateTime dt;
try
{
MaskEdit2->Text=FormatDateTime("hh:mm", dtTime+HKoffsetDaylight);
}
catch(...)
{
Application->MessageBox("Invalid hour, minute.", "mtprog", MB_OK);
}
break;
}
default:
Label9->Caption="ERROR4..";
break;
}
}