04-02-2011, 10:49 PM
Okay: The bug seems to be (finally!) fixed. It's been a very tough one :x
It happened when ADDing initialized (NULL) strings (if you had initalized Char$ = "" in your function the bug). NULL (uninitialized) strings are allowed by the compiler and managed as empty ones. :roll: So:
Should print just 5. The problem was the STRADD routine had a bug for this case. :roll: Now fixed.
Also, #include <alloc.bas> had a bug of bad included (also fixed), and now contains 2 new important functions:
It happened when ADDing initialized (NULL) strings (if you had initalized Char$ = "" in your function the bug). NULL (uninitialized) strings are allowed by the compiler and managed as empty ones. :roll: So:
Code:
A$ = A$ + "5"
PRINT A$
Also, #include <alloc.bas> had a bug of bad included (also fixed), and now contains 2 new important functions:
- Memavail() .- Returns the total available (and maybe fragmented) free Heap Memory. Notice that if there are 1Kb of free memory it can be a single contiguous block or, for example, 4 chunks of 256 bytes (in such case you can only get at most 256 bytes when calling allocate() ).
- MaxAvail() .- Returns the size (in bytes) of the largest continuous available/free memory block in the Heap. Calling Allocate(N) with N greater than the value returned by this function will result in a memory error (NULL returned or Out Of Memory error if --check-memory is enabled).