الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

كيف نكتب if في الفيجول

مغلق
بدأه albahrain في 19 مارس 2006 · 2 رد · 586 مشاهدة · في لغة Ms Visual Basic 6 وما قبلها من إصدارات
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم

ياريت طريقة كتابة

if

switch

for

while

ياريت طريقة كتابتهم

وشكرا

#2

لو راجعت اي كتاب او مرجع لوجدتهم مليئين بالامثلة, ايضا لا يخلو اي كود منهم.. باي حال, في الفيجوال بسيك لا يوجد امر Swith وانما هو موجود في C

' simple IF clause
IF conditionTHEN
        statement
END IF
' Nested IF clause
IF condition THEN
       statement1
ELSE
       statement2
END IF
' Another type of nested clause
IF condition1 THEN
       statement1
ELSEIF condition2 THEN
       statement2
ELSEIF condition3 THEN
       statement3
ELSEIF conditionN THEN
       statementN
ELSE
       statementX
END IF

' Simple FOR
FOR i = start_value TO end_value    ' where "i" stands for the counter
    ' write whatever you want here to be executed
    ' "n" times, where  start_value =< i =< end_value
NEXT
' Nested FOR..NEXT caluse is the same as the IF one

i = start_value
n = end_value
WHILE i =< n  ' ofcourse you can use any comparison type, > < = <> =< =>
   ' write what ever you wanna execute "n" times
   ' i & n must be defined before using WHILE..LOOP statement
   i = i + 1      ' or i = i + 2 .. or whatever
LOOP
' FOR increases "i" automatically by 1, if you wanna increase it by "n" number then use:
' FOR i = start TO end STEP  n --  where "n" is the increasing number
' WHILE does the same but you must increase "i" manually with the line: i = i + 1

hope that helps.

تم تعديل هذه المشاركة بواسطة Xacker في 21 مارس 2006 في 15:47

Do as I say, not as I do

We are Anonymous. We are Legion. We don't forgive. We don't forget

هذا الموضوع مغلق.

مواضيع مشابهة