PDA

View Full Version : beginers-how to escape from loop



xxxxxx
- 15th February 2011, 08:27
ok here it is i want to escape and go sub from this loop but seems that nothing is working for me!!!


main:

Clear ' ocisti sve varijable
Low PORTD.0 ' usli smo u mod za prikaz poruke
a=14
k=120
j=0
leddata[0-13] = $00 ' varijabla ledadta od 0 do 13 je 00
For b = 0 To 11 ' moguci broj slova u poruci
For i = 0 To 4
c=i+a 'povecaj a=14-19; a=20-24; a=26-30 itd...
d=i+j+k 'povecaj j=120-124; a=126-130; a=131-135 itd...
leddata [c]= ERead d 'filuj ledadtu od 14 do max broja slova za prikaz iz eeproma pocevsi od 120 pa nadalje
DelayUS 20
Next
leddata [a+5]=ERead 119 'upisi prazanu kolonu izmedju slova
a=a+6
j=j+6
Next
For scroll = 0 To c ' skrolaj poruku c zadnji leddata

For scan = 0 To 35
PORTC.1 = 1 'reseting 4017
PORTC.1 =0
For kolona = 0 To 14 'broj kolona
PORTC.0 = 1 'clock 4017
PORTC.0 =0
PORTB = leddata[kolona]
DelayUS 250
PORTB=0
Next
Next
For brojac = 0 To (c-1)
leddata[brojac]=leddata[brojac+1]' pomjeri za jedan
Next
Next
GoTo main
End

Ioannis
- 15th February 2011, 10:25
What exactly is it you are trying to do?

I would always place the variable after NEXT command, just to be sure.

But exiting the FOR-NEXT loop never was a problem.

Ioannis

xxxxxx
- 15th February 2011, 10:43
thx well i solved it with this piece of code, i forgot basic stuff :(...


If PORTD.1=1 Then
GoSub odaberporuku
Break
End If

Ioannis
- 15th February 2011, 10:52
Break ???

There is no such command in PBP...

Ioannis

Acetronics2
- 15th February 2011, 11:13
Nor those ones :



leddata[0-13] = $00
.
.
.
DelayUS 20


Alain

xxxxxx
- 15th February 2011, 11:17
yeah you are right this is from ProtonIde compiler...