Shop OBEX P1 Docs P2 Docs Learn Events
Propeller IDE 1.2 objects & CASE limitation — Parallax Forums

Propeller IDE 1.2 objects & CASE limitation

GiemmeGiemme Posts: 85
edited 2008-08-28 19:02 in Propeller 1
Hi All

I found following not documented limitation in the Propeller IDE 1.2

- you cannot have more that 256 PUB/PRI objecs in one .spin file

- you cannot have more that 64 CASE in one PUB/PRI objects

Regards
Gianni



·

Comments

  • BradCBradC Posts: 2,601
    edited 2008-08-28 10:01
    Yes, there are more limits that that also..

    8 Nested blocks (IF/Repeat/Case)
    32 Objects
    16 ELSEIF

    I've only hit them when really pushing things past practical limits [noparse]:)[/noparse] (ie not actually in real use but code to stretch the limits of the compiler)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Pull my finger!
  • RaymanRayman Posts: 14,243
    edited 2008-08-28 13:45
    Yes, I was rudely informed of that 8 nested block limitation via error message while writing a Chess code...
  • hippyhippy Posts: 1,981
    edited 2008-08-28 15:17
    The '255 methods only' is a limitation of the current bytecode design.

    The others seem to be restrictions imposed by the PropTool; fixed size arrays for holding the nesting information ? It would be nice if nesting could go deeper as I've run into that problem a few times, particularly with large Case statements. For a 256 Case variant, the solution is to nest Case statements ...

      case n & $F0
       $00 : case n & $0F
               $00 :
               $01 : etc
       $10 : case n & $0F
               $00 :
               $01 : etc
       $20 :
    
    
    
  • jazzedjazzed Posts: 11,803
    edited 2008-08-28 15:30
    The smaller but harder to read solution is to replace "CASE ..." with a string of "IF N == VALUEn"
    This is smaller for each individual IF (on average) and does not require special cases.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --Steve
  • GiemmeGiemme Posts: 85
    edited 2008-08-28 18:52
    I could solve the CASE limitation in that way....hop.gif
    Regards

    Gianni
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-08-28 19:02
    I'll second Hippy's nesting suggestion. Even if there were no CASE limitation, it would be a good idea, since it probably just runs faster.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
Sign In or Register to comment.