Code: Select all
Warning(13): task stack for "Main" is too small, 223 bytes needed, 134 bytes available
No errors. Target device: ZX328n, Code: 21224 bytes, RAM: 1402 bytes, Persistent memory: 32 bytes
-Christopher
Code: Select all
Warning(13): task stack for "Main" is too small, 223 bytes needed, 134 bytes available
No errors. Target device: ZX328n, Code: 21224 bytes, RAM: 1402 bytes, Persistent memory: 32 bytes
It may or may not be - it depends on your program. The heap is used for all computed string values (as opposed to constant string values) so if you have a lot of computed string values that have a long lifetime you may run out of heap space.cadillackid wrote:I changed my option heapsize and was able to clear the warning but not sure if this was a good idea or not??
Code: Select all
Dim s1 as String, s2 as String
Sub Main()
s1 = "Hello, world!" & Chr(&H0d) & Chr(&H0a)
Call foo()
s2 = Mid(s1, 2, 5) & "xxx"
End Sub
Sub foo()
End Sub
Code: Select all
sub main()
call foo1
call foo2
end sub
sub foo1()
dim x as integer
for x =1 to 20
... do stuff here
next
end sub
sub foo2()
dim y as integer
for y=1 to 50
... do stuff here
next
end sub
To get a grasp on how RAM is used, you need to understand how RAM is partitioned and how space is allocated for different types of variables.cadillackid wrote:so the fact that I use a lot of variables could be a reason why I use so much space for such a small program
Code: Select all
Private Const pulsestreamLength as Integer = 164
private spulse(1 to (pulsestreamlength)+8) as new unsignedinteger
Private pulses(1 to pulsestreamLength) as New UnsignedInteger
private tempset as byte
Code: Select all
private sub unitcom()
dim pulsestreamLength as Integer
pulsestreamlength = 164
dim spulse(1 to (pulsestreamlength)+8) as new unsignedinteger
dim pulses(1 to pulsestreamLength) as New UnsignedInteger
dim x
for x=1 to 8
if getbit(tempset,x)=1 then
.... yada yada
else
... yada yada
end if
next
end sub