تقييم الموضوع :
  • 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
الرد
تم الشكر بواسطة:


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  سؤال حول البحث ahmadpal 0 11 منذ 29 دقيقة مضت
آخر رد: ahmadpal
  سؤال في حماية البرنامج Emam emam 2 32 منذ 3 ساعة مضت
آخر رد: fouadhdfouad
Wink سؤال عن خصائص الكومبوبكوس ahmadpal 1 35 أمس, 10:42 PM
آخر رد: 5000
  سؤال : كيفية اختيار لون للخلية redazero 2 87 18-03-19, 02:11 PM
آخر رد: 5000
Wink [سؤال] سؤال حول انشاء مجلد ونسخ ملفات الى هذا المجلد ahmadpal 2 64 18-03-19, 12:39 AM
آخر رد: ahmadpal
Wink [سؤال] سؤال حول البحث ahmadpal 6 123 17-03-19, 11:28 PM
آخر رد: ahmadpal
  [سؤال] سؤال حول كود جمع سعر بضاعة cayo12300 2 77 17-03-19, 02:25 PM
آخر رد: Amir_Alzubidy
  [كود] سؤال حول عشوائية الصور لسه مبتدئ 5 128 17-03-19, 09:52 AM
آخر رد: لسه مبتدئ
  سؤال فى عرض برنامج فيجوال احمد خطاب 0 43 17-03-19, 01:10 AM
آخر رد: احمد خطاب
  سؤال فى الفيجوال والاكسيس احمد خطاب 6 106 17-03-19, 01:09 AM
آخر رد: احمد خطاب

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


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