Compile error & syntax error on the word "loop:" as a label?


+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378

    Default Compile error & syntax error on the word "loop:" as a label?

    I am getting a wierd compile error on my PICBASICPRO program in which I am using a loop on a label named "loop:". It also indicates a sytax error on the GOTO statement at the end of the loop. I don't understand why since the word loop is not a reserved word or a PICBASIC coding statement. Can anyone tell me why this would be happening. Here is the code excerpt where this is happening.
    Code:
    loop:
        I2CREAD PORTC.4,PORTC.3,$E0,0,[srfver]          ' Read version number from srf02
        SEROUT PORTC.1,2,[1,"Software v: ",#srfver,13]  ' Put it on the screen
        I2CWRITE PORTC.4,PORTC.3,$E0,0,[81]             ' Request start of ranging
        pause 100                                       ' Wait for ranging to finish
        I2CREAD PORTC.4,PORTC.3,$E0,2,[b1,b0]           ' Get the ranging results
        SEROUT PORTC.1,2,["Range: ",#w0,"   "]          ' Display range data to the screen
        PAUSE 100
    GOTO loop

  2. #2
    Join Date
    Aug 2008
    Posts
    66

    Default

    I have no problem here using "goto loop"

  3. #3
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323

    Default

    I believe that "Loop" is a reserved word in newer versions of PBP.

    Use a different label....



    steve

  4. #4
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378

    Default You are right, Butcher!

    Quote Originally Posted by Byte_Butcher View Post
    I believe that "Loop" is a reserved word in newer versions of PBP.

    Use a different label....



    steve
    You are right! I had checked all PBP statements in version 2.6 but didn't check Appendix C that lists reserved words....and there it was!

    Thanks for catching this!

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    To find LOOP ...

    Look at DO.
    <br>
    DT

Similar Threads

  1. Instant Interrupts - Revisited
    By Darrel Taylor in forum Code Examples
    Replies: 772
    Last Post: - 17th February 2016, 23:14
  2. Minimizing code space
    By Tobias in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th May 2009, 08:25
  3. DS2760 Thermocouple Kit from Parallax in PicBasicPro
    By seanharmon in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 9th July 2008, 00:19
  4. 18F452 "Unknown Processor" errors
    By schwinn_rider in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 27th April 2006, 04:56
  5. calculation problem
    By nicolelawsc in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st March 2006, 16:23

Posting Permissions

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