Syntax Error in DataSection

Just starting out? Need help? Post your questions and find answers here.
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1282
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Syntax Error in DataSection

Post by Paul »

this gives syntax error in 5.20, worked fine in all previous versions ...

Code: Select all

DataSection
  _MyIcon:IncludeBinary "exit.ico"
EndDataSection
code must be changed to this to work...

Code: Select all

DataSection
  _MyIcon:
  IncludeBinary "exit.ico"
EndDataSection
Image Image
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Syntax Error in DataSection

Post by c4s »

Try this:

Code: Select all

DataSection
  _MyIcon: : IncludeBinary "exit.ico"
EndDataSection
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
Little John
Addict
Addict
Posts: 4777
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Syntax Error in DataSection

Post by Little John »

Paul wrote:code must be changed to this to work...

Code: Select all

DataSection
  _MyIcon:
  IncludeBinary "exit.ico"
EndDataSection
... or to this:

Code: Select all

DataSection
  _MyIcon: : IncludeBinary "exit.ico"
EndDataSection
This has been changed deliberately. No bug.

//edit: Oops! c4s was about half a minute faster. :-)
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Syntax Error in DataSection

Post by netmaestro »

Image
Fred's point is well taken. It wasn't so obvious but in earlier versions where that worked, we were getting a newline "for free" as the single colon is part of the label.
BERESHEIT
User avatar
luis
Addict
Addict
Posts: 3893
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: Syntax Error in DataSection

Post by luis »

netmaestro wrote:in earlier versions where that worked, we were getting a newline "for free" as the single colon is part of the label.
And that also caused the problem of letting mistyped keywords/procedures go unnoticed since they were silently interpreted as labels.


http://www.purebasic.fr/english/viewtop ... 17#p421117
"Have you tried turning it off and on again ?"
A little PureBasic review
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1282
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Re: Syntax Error in DataSection

Post by Paul »

netmaestro wrote:we were getting a newline "for free" as the single colon is part of the label.
Ah, this explanation make sense :)
Image Image
Post Reply