Can you store a string in a constant?
Is this possible?
I looked in the Propeller manual but it only shows using a decimal. When I tried this in the software it gives me an exception error for this line. I refer to the serial number several times in the code and would like to enter it one time.
Is there an obvious work around for this?
THANKS!
Post Edited (Joms) : 3/7/2010 3:32:10 AM GMT
Con
SerialNum ="000012"
TextCon ="Test"
I looked in the Propeller manual but it only shows using a decimal. When I tried this in the software it gives me an exception error for this line. I refer to the serial number several times in the code and would like to enter it one time.
Is there an obvious work around for this?
THANKS!
Post Edited (Joms) : 3/7/2010 3:32:10 AM GMT
Comments
DAT mystring "1234"
then refer to it as @mystring
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
8x8 color 80 Column NTSC Text Object
Safety Tip: Life is as good as YOU think it is!
DAT SerialNum Byte 64, "SN:002211 V1.2"
I then use
PutStr(@SerialNum)
in my program. It works, however I still see the "@" printed with the serial number. This shouldn't be happening because isn't that what shows where to point in the memory? Also, refering to the "64", is that how long the data is, or is that the exact location?
Joms, why do you have the byte 64 preceding your SN string? That is the ascii code for "@"!
Try this...
DAT SerialNum byte "SN:002211 V1.2",0
--Steve
Edit--typo
I had the 64 in there because I was reading the book wrong... After I put your example with the book example I understand whats going on now.
THANKS FOR YOUR HELP!