Shop OBEX P1 Docs P2 Docs Learn Events
I think I found a bug with SXkey3.2 — Parallax Forums

I think I found a bug with SXkey3.2

Basic JimBasic Jim Posts: 106
edited 2006-09-15 18:41 in General Discussion
I think I stumbled onto a small bug in SX Key 3.2. I have a program that has been compiling fine with 3.1 however, when I try to load it with 3.2 I get numerous compile errors from the .SCR file. What seems to be happening is that as my if-then routines are interpreted as assembly language all of the _else_XX conditions are not incremented. They all come out as 0’s when I think they should probably increment. If I manually increment them the errors go away but when I recompile the program all the errors return. I have attached my program for download. If you load it and compile it with 3.1 it compiles fine but if the try it with 3.2 you will get a slew of errors. All these errors are related to the If then conditions.



Best,

Jim W.

Comments

  • DunnseptDunnsept Posts: 115
    edited 2006-07-10 18:09
    did the exact same thing to me. Change all of your if, else and endif to upper case and it will compile without error

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    stand back! I have a slide rule and I know how to use it!
  • Basic JimBasic Jim Posts: 106
    edited 2006-07-10 19:57
    Thanks Dunnsept,

    That did fix it! Apparently 3.2 doesn't like lower case with IF-Then and Endif

    Best,
    Jim W.
  • BeanBean Posts: 8,129
    edited 2006-07-10 20:10
    You need to download 3.2R3 (it is the current version on the download page).
    3.2R2 had that problem. The wrong version accidentally got into the IDE.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com

    "I'm a man, but I can change, if I have to, I guess" The Red Green Show
    ·
  • Basic JimBasic Jim Posts: 106
    edited 2006-07-10 21:53
    Thank you Bean,

    I downloaded the R3 version and it works now. This project uses one of your hc4led's It works great for the price.

    Jim W.
  • PaulPaul Posts: 263
    edited 2006-07-17 17:27
    FYI: I downloaded R3 on 7/15 and have a similar problem with ON x GOTO ... It seems the 'GOTO' must be in caps also.

    Excellent work otherwise! I like then INTERRUPT {rate} addition. Saves a lot of calulations!

    Paul
  • BeanBean Posts: 8,129
    edited 2006-07-17 17:40
    Paul,
    Thanks for the tip. I'll check into it.
    [noparse][[/noparse]edit] Paul, you were correct. It will be corrected in the next release. Thanks.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com

    "I'm a man, but I can change, if I have to, I guess" The Red Green Show


    Post Edited (Bean (Hitt Consulting)) : 7/17/2006 6:08:56 PM GMT
  • PaulPaul Posts: 263
    edited 2006-07-17 18:16
    Check "ON x gosub ..." also, Beanman
  • BeanBean Posts: 8,129
    edited 2006-07-17 18:49
    Yeah, I got "bof-a-dem" bad boys...
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com

    "I'm a man, but I can change, if I have to, I guess" The Red Green Show
    ·
  • BeanBean Posts: 8,129
    edited 2006-07-18 10:09
    Okay,
    There is a different bug in "ON x GOSUB" too.
    When you use a defined SUB in the list, it tried to jump directly to the subroutine name (as if it was not defined).
    This causes assembler errors that the address is not in the first half of a page.
    For now the fix is to prefix any DEFINED subroutine names with two underscores.

    MySub SUB 0
    ON a GOSUB __MySub

    This will also be fixed in the next release.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com

    "Remember, you are unique, just like everyone else." Unknown.
    ·
  • AmitAmit Posts: 27
    edited 2006-09-15 18:21
    I think the bug with the If-Then-else statements is still present. I just downloaded the ver3.2R3 on 9/12 to upgrade from 3.1 and some of my code wouldn't compile anymore. I narrowed it down to this example:


    DEVICE          SX48, OSCHS2
    FREQ              50_000_000
    PROGRAM       MainLoop
    
    value     var    byte
    value2    var    byte
    
    MainLoop:
     
        watch value, 8, UDEC
        break
    
        If value = 1 Then
            value = 2
        Else
            If value = 2 Then
                value = 4
                value2 = 0
            Endif
            value2 = 3
        Endif
    
    GOTO MainLoop
    
    
    



    This will not compile. It gives me an Else or Endif without If "ENDIF" error. However if I capitalize the second if so it reads "IF value = 2 Then" then it works.
  • BeanBean Posts: 8,129
    edited 2006-09-15 18:30
    Are you using SX/B version 1.51.01 ?

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    There are only two guaranteed ways to become weathy.
    Spend less than you make.
    Make more than you spend.
    ·
  • AmitAmit Posts: 27
    edited 2006-09-15 18:37
    There we go... that fixed it. Now I don't have to change all my code. Thanks a bunch Bean. It's amazing how you always answer problems so quickly that takes me hours to figure out. As always your help is appreciated!

    -Amit
  • BeanBean Posts: 8,129
    edited 2006-09-15 18:41
    Amit,
    That's what the forums are all about. People helping people. It's my pleasure.

    In fact there is one small bug in 1.51.01 that I found. The virtual word port RDE doesn't work properly. I will post a version 1.51.02 in a week or two with that fixed. (Waiting to see if anything else shows up).

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    There are only two guaranteed ways to become weathy.
    Spend less than you make.
    Make more than you spend.
    ·
Sign In or Register to comment.