In ROBOTC, an "int" is 16-bits. This is common practice in many embedded systems that are memory constrained. Larger system may use a 32-bit default for "int". A short is 16-bits.

I recall that around 15000 bytes are available for variable declarations in ROBOTC so it is likely with other program declarations you may very well be running out of memory.

Also make sure you're using the latest version of ROBOTC. In an earlier version pointer and call by reference variables were sometimes being incorrectly allocated as the size of the "item" rather than a single pointer value. The code worked OK but it was wasteful on memory space.

Sat Mar 15, 2008 11:27 pm

Ford Prefect

Guru

Joined: Sat Mar 01, 2008 12:52 pmPosts: 1030

hello Dick,
thx for your reply.
In this case of my aStar algorithm and navigation programs it could be helpful if RobotC
char (signed byte)
declaration and conversiion to int (and back) worked without faults, because most of my map coordinates got a range from maximum -128 to 127.
But working with byte or ubyte or char causes many compiler and run time errors!

[EDIT]
The program works fine, but I just wanted to enlarge the Map
(mapsize now 30x30 (with an additional edge/margin, actually it's 31x31),
the limit for compilation is supposed to be close to 36x36,
but 50x50 (51x51) would be perfect).

In order to save memory, I even tried to change all variable declarations from
short varname
to
byte varname

(as far as possible);
but calculating with these byte values (which are supposed to be signed, as you wrote some time) always gives calculation errors and converting errors from byte to int and back converting errors from int to byte as well!!

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum