beginers-how to escape from loop


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2009
    Posts
    48

    Default beginers-how to escape from loop

    ok here it is i want to escape and go sub from this loop but seems that nothing is working for me!!!

    Code:
    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

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,825


    Did you find this post helpful? Yes | No

    Default Re: beginers-how to escape from loop

    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

  3. #3
    Join Date
    Mar 2009
    Posts
    48


    Did you find this post helpful? Yes | No

    Default Re: beginers-how to escape from loop

    thx well i solved it with this piece of code, i forgot basic stuff ...

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

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,825


    Did you find this post helpful? Yes | No

    Default Re: beginers-how to escape from loop

    Break ???

    There is no such command in PBP...

    Ioannis

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default Re: beginers-how to escape from loop

    Nor those ones :
    Code:
     
     leddata[0-13] = $00
    .
    .
    .
     DelayUS 20
    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  6. #6
    Join Date
    Mar 2009
    Posts
    48


    Did you find this post helpful? Yes | No

    Default Re: beginers-how to escape from loop

    yeah you are right this is from ProtonIde compiler...

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts