🎉 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!

Array doesn't properly document find and findByRef

Started by
0 comments, last by WitchLord 8 years, 6 months ago

http://www.angelcode.com/angelscript/sdk/docs/manual/doc_datatypes_arrays.html

It doesn't document that for find and findByRef "-1" means "not found".

Also using signed int's -1 is quite a bad kludge because it means you sacrifice 50% of the value range for a single option.

Also since the array uses uint length it won't be able to return anything above signed int's max value.

A better solution is to use uint max value (in C++ it can be represented by uint -1). This way there's 1 value to 1 option match up, there's no performance trade-off, and it's possible to address all indexes - 1.

Advertisement

Thanks. I'll make the necessary adjustments.

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

This topic is closed to new replies.

Advertisement