R
Rackover
Guest
Hi, i'm getting trouble with the buffers. I've read the documentation but to no avail.
I only made a little test, to experiment, but it doesn't even work and I do not understand why.
Here is the code :
I expect it to debug something like :
I only made a little test, to experiment, but it doesn't even work and I do not understand why.
Here is the code :
Code:
msgBuffer = buffer_create(1024, buffer_fixed, 1);
buffer_poke(msgBuffer, 0, buffer_string, "A");
buffer_poke(msgBuffer, 1, buffer_string, "B");
buffer_poke(msgBuffer, 2, buffer_string, "C");
buffer_save(msgBuffer, "savedBuffer.bin");
show_debug_message(buffer_peek(msgBuffer, 0, buffer_string));
show_debug_message(buffer_peek(msgBuffer, 1, buffer_string));
show_debug_message(buffer_peek(msgBuffer, 2, buffer_string));
show_debug_message(buffer_peek(msgBuffer, 0, buffer_u8));
show_debug_message(buffer_peek(msgBuffer, 1, buffer_u8));
show_debug_message(buffer_peek(msgBuffer, 2, buffer_u8));
I expect it to debug something like :
But the output is :A
B
C
65
66
67
Why can't it read back the strings ?0
0
0
65
66
67