25 September 2014, 06:02 | #1 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
|
Blitz2: Pointer to array
While doing setup of a level, stored as an array of blocks, it would be helpful to have a pointer into that array, but I can't seem to figure out the correct usage of * and & and (), or need I resort to peek and poke?
|
30 November 2014, 04:27 | #2 |
Registered User
Join Date: Oct 2014
Location: Europe
Posts: 470
|
What are 'blocks'?
The address of an array something() is &something(0), the pointer to the first entry. Or, do you have a newtype you made your array of? Anyway: Code:
; Blitz 2 Array pointer test CloseEd as.w=10 Dim array.w (as) ;words, 2bytes na.l =0 ona.l=0 NPrint"" For a = 0 To as-1 na.l = &array(a) Print na NPrint "(",na-ona," bytes)" ona.l=na Next a MouseWait End |
24 March 2015, 15:28 | #3 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
|
What does &array() point at? Some kind of arraybase?
|
26 March 2015, 21:44 | #4 | |
Registered User
Join Date: Oct 2014
Location: Europe
Posts: 470
|
Yes.
Quote:
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Blitz2: Hires laced | BippyM | Coders. Language | 25 | 06 February 2020 01:07 |
Blitz2 keyboard issues | htdreams | Coders. Blitz Basic | 2 | 16 August 2013 15:58 |
Blitz2 Newcommandset | BippyM | Coders. Language | 0 | 21 July 2012 23:59 |
Coding my game in Blitz2 | r0ber7 | Coders. General | 103 | 11 September 2011 20:14 |
Blitz2 Manual | AlfaRomeo | Amiga scene | 18 | 01 May 2009 10:53 |
|
|