21-10-17, 08:54 PM
السلام عليكم ورحمة الله
استفسار عن الدالة الشرطية if
هل اللي اكتبه صحيح او لا
مثلا
ال nema مسحوب من قاعدة البيانات
اذا الطلب على اسمين
هل صحيح الكود التالي
XOR
او
AND
او
OR
والسؤال الثاني مثلا هل في عدد معين للطلب او عادي يكون مثلا 5 او 6
كمثال
افيدوني بارك الله فيكم ما هي الكتابة الصحيحه
وشكرا
هل طريقة في كتابة الكود صحيحه
استفسار عن الدالة الشرطية if
هل اللي اكتبه صحيح او لا
مثلا
كود :
If nema = "khalid" Xor nema = "ahmed" And Not IsNumeric(Exchange_r.Text) Thenال nema مسحوب من قاعدة البيانات
اذا الطلب على اسمين
هل صحيح الكود التالي
كود :
If nema = "khalid" Xor nema = "ahmed" And Not IsNumeric(Exchange_r.Text) ThenXOR
او
كود :
If nema = "khalid" and nema = "ahmed" And Not IsNumeric(Exchange_r.Text) ThenAND
او
كود :
If nema = "khalid" or nema = "ahmed" And Not IsNumeric(Exchange_r.Text) ThenOR
والسؤال الثاني مثلا هل في عدد معين للطلب او عادي يكون مثلا 5 او 6
كمثال
كود :
If nema = "khalid" or nema = "ahmed" or nema = "mhhmed" or nema = "salem" or nema = "ali" And Not IsNumeric(Exchange_r.Text) Then
MsgBox("OK")
ElseIf nema = "khalid" or nema = "ahmed" or nema = "mhhmed" or nema = "salem" or nema = "ali" And IsNumeric(Exchange_r.Text) Then
MsgBox("NO")
ElseIf nema = "khalid" or nema = "ahmed" or nema = "mhhmed" or nema = "salem" or nema = "ali" And Exchange_r.Text Then
MsgBox("NO")
ElseIf nema = "khalid" or nema = "ahmed" or nema = "mhhmed" or nema = "salem" or nema = "ali" And UU_r.Text Then
MsgBox("NO")
ElseIf nema = "khalid" or nema = "ahmed" or nema = "mhhmed" or nema = "salem" or nema = "ali" And GG.Text Then
MsgBox("NO")
ElseIf nema = "khalid" or nema = "ahmed" or nema = "mhhmed" or nema = "salem" or nema = "ali" And EE.Text Then
MsgBox("NO")
ElseIf nema = "khalid" or nema = "ahmed" or nema = "mhhmed" or nema = "salem" or nema = "ali" And GWWG.Text Then
MsgBox("NO")
End Ifافيدوني بارك الله فيكم ما هي الكتابة الصحيحه
وشكرا
هل طريقة في كتابة الكود صحيحه
كود :
If contestnx = "CQ 160 Meter" And Continentx = "AS" And WORKinfo.Continent.Text = "NA" Then
Points.Text = "10"
ElseIf contestnx = "CQ 160 Meter" And Continentx = "AS" And WORKinfo.Continent.Text = "SA" Then
Points.Text = "10"
ElseIf contestnx = "CQ 160 Meter" And Continentx = "AS" And WORKinfo.Continent.Text = "EU" Then
Points.Text = "10"
ElseIf contestnx = "CQ 160 Meter" And Continentx = "AS" And WORKinfo.Continent.Text = "OC" Then
Points.Text = "10"
ElseIf contestnx = "CQ 160 Meter" And Continentx = "AS" And WORKinfo.Continent.Text = "AS" Then
Points.Text = "5"
ElseIf contestnx = "CQ 160 Meter" And Continentx = "NA" And WORKinfo.Continent.Text = "NA" Then
Points.Text = "5"
ElseIf contestnx = "CQ 160 Meter" And Continentx = "NA" And WORKinfo.Continent.Text = "SA" Then
Points.Text = "10"
ElseIf contestnx = "CQ 160 Meter" And Continentx = "NA" And WORKinfo.Continent.Text = "EU" Then
Points.Text = "10"
ElseIf contestnx = "CQ 160 Meter" And Continentx = "NA" And WORKinfo.Continent.Text = "OC" Then
Points.Text = "10"
ElseIf contestnx = "CQ 160 Meter" And Continentx = "NA" And WORKinfo.Continent.Text = "AS" Then
Points.Text = "10"
ElseIf contestnx = "CQ 160 Meter" And Continentx = "SA" And WORKinfo.Continent.Text = "NA" Then
Points.Text = "10"
ElseIf contestnx = "CQ 160 Meter" And Continentx = "SA" And WORKinfo.Continent.Text = "SA" Then
Points.Text = "5"
ElseIf contestnx = "CQ 160 Meter" And Continentx = "SA" And WORKinfo.Continent.Text = "EU" Then
Points.Text = "10"
ElseIf contestnx = "CQ 160 Meter" And Continentx = "SA" And WORKinfo.Continent.Text = "OC" Then
Points.Text = "10"
ElseIf contestnx = "CQ 160 Meter" And Continentx = "SA" And WORKinfo.Continent.Text = "AS" Then
Points.Text = "10"
ElseIf contestnx = "CQ 160 Meter" And Continentx = "EU" And WORKinfo.Continent.Text = "NA" Then
Points.Text = "10"
ElseIf contestnx = "CQ 160 Meter" And Continentx = "EU" And WORKinfo.Continent.Text = "SA" Then
Points.Text = "10"
ElseIf contestnx = "CQ 160 Meter" And Continentx = "EU" And WORKinfo.Continent.Text = "EU" Then
Points.Text = "5"
ElseIf contestnx = "CQ 160 Meter" And Continentx = "EU" And WORKinfo.Continent.Text = "OC" Then
Points.Text = "10"
ElseIf contestnx = "CQ 160 Meter" And Continentx = "EU" And WORKinfo.Continent.Text = "AS" Then
Points.Text = "10"
ElseIf contestnx = "CQ 160 Meter" And Continentx = "OC" And WORKinfo.Continent.Text = "NA" Then
Points.Text = "10"
ElseIf contestnx = "CQ 160 Meter" And Continentx = "OC" And WORKinfo.Continent.Text = "SA" Then
Points.Text = "10"
ElseIf contestnx = "CQ 160 Meter" And Continentx = "OC" And WORKinfo.Continent.Text = "EU" Then
Points.Text = "10"
ElseIf contestnx = "CQ 160 Meter" And Continentx = "OC" And WORKinfo.Continent.Text = "OC" Then
Points.Text = "5"
ElseIf contestnx = "CQ 160 Meter" And Continentx = "OC" And WORKinfo.Continent.Text = "AS" Then
Points.Text = "10"
ElseIf contestnx = "CQ 160 Meter" And PFXX = WORKinfo.PFX.Text Then
Points.Text = "2"
End IF