-
مشکل این کد کجاست؟؟؟
در پایان کامپایل 8 ارور نشون میده.
کد:
int num=0;
int a;
void CTaghvimDlg::OnRadio1()
{
// TODO: Add your control notification handler code here
num=1;
}
void CTaghvimDlg::OnRadio2()
{
// TODO: Add your control notification handler code here
num=2;
}
void CTaghvimDlg::OnRadio3()
{
// TODO: Add your control notification handler code here
num=3;
}
void CTaghvimDlg::OnRadio4()
{
// TODO: Add your control notification handler code here
num=4;
}
void CTaghvimDlg::OnRadio5()
{
// TODO: Add your control notification handler code here
a=5;
}
void CTaghvimDlg::OnRadio6()
{
// TODO: Add your control notification handler code here
a=6;
}
void CTaghvimDlg::OnRadio7()
{
// TODO: Add your control notification handler code here
a=7;
}
void CTaghvimDlg::OnRadio8()
{
// TODO: Add your control notification handler code here
a=8;
}
void CTaghvimDlg::OnNext()
{
// TODO: Add your control notification handler code here
UpdateData(true);
switch(num);
{
case 1:
cal.NextYear();
case 2:
cal.NextMonth();
case 3:
cal.NextWeek();
case 4:
cal.NextDay();
}
UpdateData(false);
}
void CTaghvimDlg::OnPrev()
{
// TODO: Add your control notification handler code here
UpdateData(true);
switch(a);
{
case 5:
cal.PreviousYear();
case 6:
cal.PreviousMonth();
case 7:
cal.PreviousWeek();
case 8:
cal.PreviousDay();
}
UpdateData(false);
}
-
یه توضیح در مورد برنامه:
من میخوام با انتخاب یه دکمه رادیویی که مثلا جلویش نوشته Next year توسط یه دکمه دستور مربوط به این گزینه اجرا بشه.
-
جلوي دستور switch نبايد ; قرار بدي. در ضمن حتما شما قوانين کار با switch و break رو ميدونين چون اصلا ازش استفاده نکردين گفتم شايد عمدي باشه.
-
اقا خیلی خیلی ممنون
واقعا کمک کردی