bug or no bug?

Just starting out? Need help? Post your questions and find answers here.
morosh
Enthusiast
Enthusiast
Posts: 335
Joined: Wed Aug 03, 2011 4:52 am
Location: Beirut, Lebanon

bug or no bug?

Post by morosh »

Hello:
the following snippet didn't run when parentheses are used with StructureUnion, isn't strange?

Code: Select all

Structure wrdbyte
  StructureUnion
    word.w
    byte.b[2]
  EndStructureUnion
EndStructure

Define xx.wrdbyte

xx\byte[0]+1    ; good
(xx\byte[0])+1  ; error

PureBasic: Surprisingly simple, diabolically powerful
User avatar
mk-soft
Always Here
Always Here
Posts: 6324
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: bug or no bug?

Post by mk-soft »

No bug ...
Your syntax not right

Not valid syntax

Code: Select all

Define a
(a)+1
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Little John
Addict
Addict
Posts: 4805
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: bug or no bug?

Post by Little John »

I don't think that it's strange. It's just invalid syntax.
The situation is not specific for a StructureUnion.

Oops! mk-soft was quicker. :-)
morosh
Enthusiast
Enthusiast
Posts: 335
Joined: Wed Aug 03, 2011 4:52 am
Location: Beirut, Lebanon

Re: bug or no bug?

Post by morosh »

Thanks guys!!
PureBasic: Surprisingly simple, diabolically powerful
Post Reply