English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 30 June 2015, 00:39   #1
jayminer
Registered User

jayminer's Avatar
 
Join Date: Jun 2015
Location: Umeå / Sweden
Posts: 175
Using addr

I'm trying to do something in Blitz and I want to get the memory-address of an array but I can't figure out how Addr works and there's not really much documentation about it.

Let's say I have done a:

Dim test(30,30)

Is there anyway to get the start of this array in memory? I was hoping for something in the style of:

memaddr=Addr (test(0,0))

But this doesn't work and not any of the other variants I have tried :/

Does anyone have any idea?
jayminer is offline  
Old 30 June 2015, 01:53   #2
clenched
Registered User

 
Join Date: Sep 2008
Location: Gainesville U.S.A.
Posts: 639
I think ADDR is mainly concerned with the address of structures. Stuff like bitmaps, banks and the like. You want to use the ampersand to get a variable's address.

Dim test(30,30)
test(0,0)=$eab ;give element some value.
NPrint &test(0,0)
clenched is offline  
Old 30 June 2015, 10:33   #3
jayminer
Registered User

jayminer's Avatar
 
Join Date: Jun 2015
Location: Umeå / Sweden
Posts: 175
Ah perfect!

Thanks!
jayminer is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 22:56.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.31561 seconds with 14 queries