تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[VB.NET] سؤال : عن الدالة الشرطية if
#1
السلام عليكم ورحمة الله


استفسار عن الدالة الشرطية 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) Then

XOR

او

كود :
        If nema = "khalid" and nema = "ahmed" And Not IsNumeric(Exchange_r.Text) Then

AND

او


كود :
        If nema = "khalid" or  nema = "ahmed" And Not IsNumeric(Exchange_r.Text) Then

OR



والسؤال الثاني مثلا هل في عدد معين للطلب او عادي يكون مثلا 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
الرد }}}
تم الشكر بواسطة:



التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم