Program Memory Data Initialization

Discussion about the ZBasic language including the System Library. If you're not sure where to post your message, do it here. However, do not make test posts here; that's the purpose of the Sandbox.
Post Reply
cloxwerx
Posts: 37
Joined: 01 December 2005, 9:27 AM
Location: Tucson, Arizona

Program Memory Data Initialization

Post by cloxwerx »

I just received a ZX-24 and began working with the IDE. Taking a BX-24 program that functions I tried to recompile it with “Option Language BasicX� compatibility. It received errors on IntegerTableData definitions so I went to no compatibility. In using the Program Memory Data Initialization I find that a negative integer won’t work in the initialization string and had to go to the following:

Public TEMPERATURE As New IntegerTableData ({
' Sensor Temperature
4481, &hfff3 '-13
4357, &hfffc '-4
4211, 5
4047, 14
......

Is there a way to directly specify negative values without the compiler complaining about the wrong number of values per line?

Thanks,
Dennis
mikep
Posts: 796
Joined: 24 September 2005, 15:54 PM

Post by mikep »

It looks like a minor problem in the compiler. Don is very responsive so I'm sure you will see a fix soon. In the meantime try this:

Code: Select all

Private Const x as Integer = -13
Private Const y as Integer = -4

Public TEMPERATURE As New IntegerTableData ({
' Sensor Temperature
4481, x
4357, y
4211, 5
4047, 14 
})
Using constants for this kind of read-only data might be a good idea in any case for readability and maintainability of your code.

Mike
http://home.austin.rr.com/perks/micros/
Last edited by mikep on 04 December 2005, 11:32 AM, edited 1 time in total.
cloxwerx
Posts: 37
Joined: 01 December 2005, 9:27 AM
Location: Tucson, Arizona

Post by cloxwerx »

Thanks for the work-around idea, Mike.

Dennis
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

Thanks for pointing this out. We'll post an update to the compiler as soon as the testing is completed.
- Don Kinzer
Post Reply