Professional Documents
Culture Documents
Program Kontrol Ve Döngü Deyi̇mleri̇
Program Kontrol Ve Döngü Deyi̇mleri̇
DÖNGÜ DEYİMLERİ
PROGRAM KONTROL VE
DÖNGÜ DEYİMLERİ
PROGRAMLAR NORMALDE SATIR SATIR
ÇALIŞTIRILIRLAR.
İSTENİRSE BELİRLİ ŞARTLAR
ARANARAK PROGRAMIN BİR KISMININ
ÇALIŞTIRILMASI VEYA
ÇALIŞTIRILMAMASI SAĞLANABİLİR.
BUNDAN SONRAKİ DERSLERİMİZDE BU
TÜR YAPILAR İLE ÇALIŞACAĞIZ.
IF DEYİMİ-1
dim ogrnot
ogrnot=val(text1.text)
if ogrnot>=50 then
text2.text=“geçti”
else
text2.text=“kaldı”
end if
IF DEYİMİ-2
İf şart1 then
Komutlar
Elseif şart2 then
Komutlar
Elseif şart3 then
Komutlar
Else ‘eğer hiçbir şart çalışmadıysa...
Komutlar
Endif
IF DEYİMİ-2
İf yas<5 then
print “anaokula gitmeli”
Elseif yas<12 then
prrint “ilkokula gitmali”
Elseif yas<18 then
print “liseye gitmali”
Else
Print “üniversiteye gitmali”
End if
IF DEYİMİ-3
İf şart then komutlar
ÖRNEK:
İf yas>12 then msgbox(“ilkokul bitmiş”)
IF DEYİMİ-4
İf şart then
komutlar:komutlar:komutlar:komutlar
ÖRNEK:
İf a>50 then x=x+1: z=5*x
SELECT CASE DEYİMİ
dim ogrnot
ogrnot=text1.text
select case ogrnot
case is<0, is>100:text2.text=“notunuzu yanlış
girdiniz”
case 1 to 49:text2.text=“kaldı”
case 50: text2.text=“sınırda bir not aldınız”
case 51 to 70:text2.text=“iyi”
case else:text2.text=“pekiyi”
end select
ÖRNEK
dim aileyard,mks
mks=3315
select case combo1.text
case “bekar”: aileyard=0
case “eşçalş”: aileyard=0
case evli1ç: aileyard=int(50*mks1000)*1000
case evli2ç: aileyard=int(100*mks)*1000
case else
end select
DÖNGÜ DEYİMLERİ
while şart
komutlar..........
wend
ÖRNEK
do while şart
komutlar
loop
ÖRNEK
dim i,top,n
do while i<=n
i=i+1
top=top+i
loop
DO UNTIL-LOOP
dim i,top,n
do until i=n
i=i+1
top=top+i
loop
DO-LOOP UNTIL
do
komutlar
loop while şart