Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / [SOLVED] Viewing array of Type data in Debugger

Author
Message
GreekToMe
14
Years of Service
User Offline
Joined: 27th Oct 2009
Location: Colorado
Posted: 17th Mar 2020 12:55
Not really that important and definitely not a game breaker, but...
I have the following code (which works just fine)

type _xyPositions
x as float
y as float
endtype

xyPosition as _xyPositions

//Create a variable array
xyPos as _xyPositions[]

Further down the code the array is loaded etc .
Trying to read xyPositions[] in the debugger and haven't been able to accomplish it.
I am pretty sure that the debugger cannot read an array of "type", or can it?
Perhaps some of you have devised a "sneaky" way to accomplish this.
Always all of you Much Appreciated!
Cheers!

The author of this post has marked a post as an answer.

Go to answer

Mesher
User Banned
Posted: 17th Mar 2020 13:09
Hows this, maybe you need to add some with the "insert" command to an empty array

GreekToMe
14
Years of Service
User Offline
Joined: 27th Oct 2009
Location: Colorado
Posted: 17th Mar 2020 14:43
Hi Mesher,
I learned this from you! Hey I never refuse help and other ideas. I have been reading/analyzing the code snippet you supplied for the "Galaga like" sprite moving. Everything is pretty clear and straight forward. I have actually been doing some fancy stuff (just movement, not part of anything). And... having a lot of fun with moving a multitude of sprites!!! I downloaded all of the Galaga sprite sheet from some "freebie" on the web and moving them around the screen in different "orbits"
I am trying to figure out ( that's the only part which escapes me) how an x,y point gets inserted in a one dimensional array. Unless an undeclared array creates more than one dimension on its own, based on what is coming in. If so, I need to read up on AppGameKit arrays again.
I didn't want to bother you again for an explanation, so I posted it for everyone else. I should have guessed you would be the first one to reply!!!
So, I "add my watches" and see all the changes in the point and other variables, but can't see what actually goes in the array. I just would like to see how the xy elements are arranged in the array.
So, is there a way in the debugger to display the array elements from a "type" created array?
Cheers!
GreekToMe
14
Years of Service
User Offline
Joined: 27th Oct 2009
Location: Colorado
Posted: 17th Mar 2020 14:46
Sorry I missed the "code snippet" above.
Which part of the world are you located, if I may ask. You don't have to reply, if there is a reason. Fully understandable.
Cheers!
Mesher
User Banned
Posted: 17th Mar 2020 14:56
I dont think can unless someone else knows, but i would imaging they are stored in a 1D array like this

Array = [ [x,y], [x, y], [x, y], ...... ]

if you wish to see the length of the array. then put something like



Or am I still been a wally of misunderstanding
GreekToMe
14
Years of Service
User Offline
Joined: 27th Oct 2009
Location: Colorado
Posted: 17th Mar 2020 15:00
This post has been marked by the post author as the answer.
I understand of reading the length and such. Just having (seems like) a mental thing dealing with the comma separator in the array element. As I said before, stupidity abounds.!
Good and clear now!
Thanks!
Cheers!

Login to post a reply

Server time is: 2024-03-29 15:58:44
Your offset time is: 2024-03-29 15:58:44