You are on page 1of 1

-cliclo while (ciclo por condicion)

sintaxis:

while (condicion logica)


instrucciones
-instrucciones que controla la condicion logica
end while

EJEMPLO:

{{BOTON CALCULAR}} 3,4,5,6,7,8,9

dim x as byte, suma as integer = 0


dim fin as integer

x= val(textbox1.text)
fin= val(texbox2.text)

while (x<= fin)


suma = x+ suma
x=x+1
listbox1.items.add(str(suma))

end while

texbox3.text = str(suma)

EJEMPLO;

dim I as byte =0 , existe as booblean=true

while (i<=4) and (existe)


if (carnet(I) = val(textbox1.text) then
existe = false
else
I= I+1
end if
end while

if (existe) then
msgbox

You might also like