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

Hexadecimal operations in latest WIP

Started by
10 comments, last by Deyja 19 years, 1 month ago
bits tmp = 50; bits x = tmp + 0x50; //says missing semicolon With further experiment, in the latest WIP you pretty much cannot use the form of 0xXXXX for anything it appears. I can't get it to work anyways.
Advertisement
With WIP 2 (coming out in a couple of days) the following works without any problems:

r = engine->ExecuteString(0, "bits tmp = 50; bits x = tmp + 0x50;", &out);if( r < 0 ){  printf("%s: bits failed\n", TESTNAME);  fail = true;}


In 2.1.0b I fixed a bug where the bits type wasn't correctly converted implicitly to/from int/uint. This bug fix hasn't been applied to WIP 1, since it was released before 2.1.0b, but WIP 2 will have it.

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

I had noticed that a few versions ago that that was the case: bits were not implicitly converted to int or uint, but I was still able to use and assign values such as 0x15 to variables
It could be a specific case that I don't test in my regression tests.

I have WIP 2 ready to be uploaded already, though I'll probably only get time to do the actual upload until tomorrow or in the worst case on sunday. Let me know then if the problem persists.

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

Have you thought of setting up some sort of CVS system?
It appears that the hexadecimal form of an numbers does not work in this build.


void main()
{
bits x = 0x50;
}

gives the following error message: "Error: expected "," or ";"

I can't reproduce the problem. What version of the library are you really using? Did you download the latest WIP 2 that I released yesterday?

Could you send me a small sample (in the style of test_feature) that reproduces the problem?

I've thought about CVS, but I didn't make any efforts to start using it. I'm quite satisfied with the way things work today.

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

I've located the problem.

It is with Deyja's script preprocessor.

it changes hexadecimal from 0x50 to 0 x50 for example.
Phew! I'm glad to hear that the bug is not really with the library.

I've added a known issues section to the download of Deyja's preprocessor. I won't fix the bug myself in his add-on, but if you or anyone else does I'd be happy to upload the new version to the site.


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

My fix is kind of hackish. By the time I had it fixed, I finally understood his method of parsing/tokenizing.

This topic is closed to new replies.

Advertisement