Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DIM At?
#6
(11-21-2019, 04:28 PM)boriel Wrote:
(11-21-2019, 01:03 PM)maeloterkim Wrote:
(11-10-2019, 10:02 PM)boriel Wrote: This has been implemented in ZX Basic 1.9+

Hi Smile 

What is the sintaxis for DIM at?

Can you put some examples with initialized array and not initialized array?

thanks

DIM AT does not allow initialized values. The content will be whatever there exists already at the given location.

For arrays the syntax is

DIM varname(dim1, dim2, dim3...) AS <type> AT <address>. For example:

DIM a(6144) As UByte AT 16384

This is undocumented (yet) for arrays, but will be updated here: https://zxbasic.readthedocs.io/en/latest/dim/

Hope this helps

Well i'm doing now this for the UDGs

DIM MyUDGs(167) As uByte => {MY...UDG...BYTES}
poke uinteger 23675, @MyUDGs

would be very good do something like this  Wink   

DIM MyUDGs(167) As uByte  AT (PEEK uinteger 23675)  
=> {MY...UDG...BYTES} 

OR 

DIM MyUDGs(167) As uByte  
=> {MY...UDG...BYTES}  AT (PEEK uinteger 23675)

where the UDGs are poked directly where they must be

maybe you can "know" where the programmer want to put the values of the array ( calculate all the memory used and the memory left )

then you know what memory is left to put the compiled program 

and then you know if is compilable or not

i don't know if i'm saying somethig stupid or is a posible idea  Tongue

Hope this helps
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)