🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Object Handle to Array's

Started by
2 comments, last by JimSpree 9 years, 10 months ago

Hi all,

I'm working on a debugger for my AngelScript implementation and I'm wondering if it supposed to be allowed to have object handles pointing to Array's?

For example:

array<int> a = {1,2,3};
array<int>@ aptr;
int arrayValue = aptr[1];
seems to be an accepted script (using the Array addon).
The engine seems to stall at the 3rd line. Should the engine be throwing an error at compile time?
Best regards,
Jim
Advertisement

While the compiler could deduce that aptr[1] is a null pointer access, it is valid to have array handles and to access them in that way.

What do you mean by 'The engine seems to stall at the 3rd line'?

The asIScriptContext::Execute should be returning -3 (asEXECUTION_EXCEPTION) when reaching this line, not stall. You can get more information on the exception that occurs (should be a null pointer access) by querying the context (see the GetExceptionInfo function from the helper add-on for one way of formatting the information into a human readable string).

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Hi Andreas,

Ah, thanks! Stupid me, I had stubbed out the code I had in place for handling exceptions sometime ago and not realized it. :)

Thanks again,

Jim

This topic is closed to new replies.

Advertisement