Problem with constants string in DataSection

Just starting out? Need help? Post your questions and find answers here.
PicardDontoro
New User
New User
Posts: 5
Joined: Fri Aug 06, 2004 2:55 pm

Problem with constants string in DataSection

Post by PicardDontoro »

Hi,

I've this code:

Code: Select all


#test_const1 = $FFFF
#test_const2 = "my string constant"

Read test1.w
Read test2.s

Debug test1
Debug test2

DataSection

Data.w #test_const1
Data.s #test_const2

EndDataSection

#test_const1 is corretly putted in data section, while #test_const2 not :cry: .

Why?

TIA
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Not sure why this should be so.

You have to put the literal value in the data statement:

Code: Select all

#test_const1 = $FFFF 
Read test1.w 
Read test2.s 

Debug test1 
Debug test2 

DataSection 

Data.w #test_const1 
Data.s "my string constant"

EndDataSection 
I may look like a mule, but I'm not a complete ass.
Post Reply