Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
String Arrays and memory
#1
Hi,

I wonder if someone could help me?

I have started writing a game but it uses a lot of String arrays.
The problem is I am compiling okay but on the screen things are missing where text should be.

I have compiled it using :-

Code:
zxbc MainEngine.bas --tzx --BASIC --autorun  --heap=6000 --optimize 2  --org=25000 --mmap=memory_map.txt
I am not sure where the issue but let me know if you need more information

Thanks
Ken
Reply
#2
(02-27-2021, 10:51 PM)RandomiserUsr Wrote: Hi,

I wonder if someone could help me?

I have started writing a game but it uses a lot of String arrays.
The problem is I am compiling okay but on the screen things are missing where text should be.

I have compiled it using :-

Code:
zxbc MainEngine.bas --tzx --BASIC --autorun  --heap=6000 --optimize 2  --org=25000 --mmap=memory_map.txt
I am not sure where the issue but let me know if you need more information

Thanks
Ken

Sure. Please send me the code (or a small code snippet) to debug it.
You can also compile with:
--debug-memory        to enable out-of-memory check
--debug-array            to enable array boundary checking
Reply
#3
Thank you Boriel for you response.

I have actually just now progressed further.
Seems there is a limit on DIM A$(100) character width  i.e.

Code:
A$(1) =" 160(about) Characters" 

one string had 205 characters so I thought just cut it down bit by bit to see if it was an issue and it was.
I have a print routine which has a print to a "window" which has a word wrap so I expect it was the word wrap that is causing the pain.

I have a work around but interested to know if my thoughts were correct or not?


Regards
Ken
Reply
#4
(02-28-2021, 05:43 PM)RandomiserUsr Wrote: Thank you Boriel for you response.

I have actually just now progressed further.
Seems there is a limit on DIM A$(100) character width  i.e.

Code:
A$(1) =" 160(about) Characters" 

one string had 205 characters so I thought just cut it down bit by bit to see if it was an issue and it was.
I have a print routine which has a print to a "window" which has a word wrap so I expect it was the word wrap that is causing the pain.

I have a work around but interested to know if my thoughts were correct or not?


Regards
Ken
There should be no limit in character length. Strings are limited to 65535 (64K) length. This is either a bug on the compiler or a problem with the heap.

Can you please send me a code snippet which reproduces de issue, plz?
Reply
#5
(03-01-2021, 07:59 AM)boriel Wrote:
(02-28-2021, 05:43 PM)RandomiserUsr Wrote: Thank you Boriel for you response.

I have actually just now progressed further.
Seems there is a limit on DIM A$(100) character width  i.e.

Code:
A$(1) =" 160(about) Characters" 

one string had 205 characters so I thought just cut it down bit by bit to see if it was an issue and it was.
I have a print routine which has a print to a "window" which has a word wrap so I expect it was the word wrap that is causing the pain.

I have a work around but interested to know if my thoughts were correct or not?


Regards
Ken
There should be no limit in character length. Strings are limited to 65535 (64K) length. This is either a bug on the compiler or a problem with the heap.

Can you please send me a code snippet which reproduces de issue, plz?
Hi boriel thanks for this and sorry I've not been on *health issues* 

I have not been able reproduce this again so perhaps it was a glitch ?

Thank you for this :-)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)