Better code check before compile?


Closed Thread
Results 1 to 30 of 30

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,621


    Did you find this post helpful? Yes | No

    Default Re: Better code check before compile?

    You may have found something you did not know and it IS something to be aware of but it's not a bug. It's like that by design.
    It's all covered in details thru out section 7.6 in the manual - read it ;-)

    /Henrik.

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170


    Did you find this post helpful? Yes | No

    Default Re: Better code check before compile?

    It is common to other languages too like C for example.

    Ioannis

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,621


    Did you find this post helpful? Yes | No

    Default Re: Better code check before compile?

    And the compiler is really only able (if so designed) to catch out-of-bounds error when you have a static index like that MAS[10]=20 but in many cases you're using an index variable like MAS[x]=20 and then there is no way for the compiler to know what x is going to be at runtime.

    On your typical 80's computer running BASIC, like the ZX Spectrum referenced earlier, the execution was interpreted so the interpreter could catch out of bounds errors during execution. PBP isn't interpreted but say it was or that it in some other way COULD detect that out-of-bounds error - what should happen?
    Last edited by HenrikOlsson; - 2nd November 2020 at 10:37.

  4. #4
    Join Date
    Feb 2013
    Posts
    1,153


    Did you find this post helpful? Yes | No

    Default Re: Better code check before compile?

    Yes the example I have is static, not runtime occurrence.

  5. #5
    Join Date
    Feb 2013
    Posts
    1,153


    Did you find this post helpful? Yes | No

    Default Re: Better code check before compile?


    Found another "bug" - if you put more DATA lines in code, than size of built-in eeprom, it will compile without errors, but PicKit 3 programmer will show you "Warning: Hex file loaded is larger than device."

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170


    Did you find this post helpful? Yes | No

    Default Re: Better code check before compile?

    Interesting... This is easy to check I guess.

    Ioannis

  7. #7
    Join Date
    Feb 2013
    Posts
    1,153


    Did you find this post helpful? Yes | No

    Default Re: Better code check before compile?

    I made a typo, putting = instead of -

    hpwm 2,rmd*rmd=1,20000

    This statement does not produce any errors, as it should. Also, RMD value remains the same

Similar Threads

  1. Code check and refinement suggestions?
    By kevlar129bp in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 31st July 2013, 02:37
  2. Replies: 4
    Last Post: - 24th January 2007, 22:20
  3. Code check -- button not working
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 2nd March 2006, 22:43
  4. Can some one please check my code out thanks
    By Jhdgkss in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 10th February 2006, 08:19
  5. Code check (sorry)
    By barkerben in forum General
    Replies: 5
    Last Post: - 30th November 2004, 15:54

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