Compiler Bug?


Closed Thread
Results 1 to 4 of 4

Thread: Compiler Bug?

  1. #1
    Join Date
    Aug 2003
    Posts
    985

    Default Compiler Bug?

    This works:
    Code:
    rotatearray:
    i = 95							'
    FOR cntx = 1 to 95					'
    segs[i] = segs[i - 1]					'
    i = i - 1						'
    NEXT cntx						'
    segs[0] = newcell					'
    return							'
    This compiles, but doesn't work as expected:
    Code:
    rotatearray:
    FOR cntx = 1 to 95					'
    segs[cntx] = segs[cntx - 1]				'
    NEXT cntx						'
    segs[0] = newcell					'
    return							'
    Cheers, Art.

  2. #2
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    Substituting the array values for the first three executions of the loops...

    Quote Originally Posted by Art View Post
    This works:
    Code:
    rotatearray:
    i = 95							'
    FOR cntx = 1 to 95					'
    segs[i] = segs[i - 1]					'
    i = i - 1						'
    NEXT cntx						'
    segs[0] = newcell					'
    return							'

    segs[95] = segs[94]
    segs[94] = segs[93]
    segs[93] = segs[92]
    .....

    Quote Originally Posted by Art View Post
    This compiles, but doesn't work as expected:
    Code:
    rotatearray:
    FOR cntx = 1 to 95					'
    segs[cntx] = segs[cntx - 1]				'
    NEXT cntx						'
    segs[0] = newcell					'
    return							'
    Cheers, Art.
    segs[1] = segs[0]
    segs[2] = segs[1]
    segs[3] = segs[2]

    They dont do the same thing !!!!
    Keith

    www.diyha.co.uk
    www.kat5.tv

  3. #3
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default

    Oops. Human bug.

  4. #4
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    LOL, there isnt a man or woman amongst us who hasnt created a bug at some point
    Keith

    www.diyha.co.uk
    www.kat5.tv

Similar Threads

  1. PIC BASIC Compiler for ARM machines?
    By stone20008 in forum General
    Replies: 2
    Last Post: - 22nd August 2008, 07:14
  2. Compiler refuses to compile
    By CodeShredder in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 21st June 2008, 19:41
  3. compiler help!!!!
    By MINHLE in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 20th April 2008, 18:52
  4. How can I update my compiler 2.46 to 2.47 ?
    By muskut in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 22nd June 2007, 12:35
  5. Compiler Error
    By mikep in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 6th November 2003, 18:53

Members who have read this thread : 1

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