Yes, Look in Help under variables string and you will find the default length.
10 bytes for chips with less than 16 bytes of RAM.
20 bytes for chips with 16 to 367 bytes of RAM.
40 bytes for devices with more RAM than 367 bytes.
I have not tried this but you may be able to
Also read:
To change the default string size handled internally by the Great Cow BASIC compiler you add increase/decrease the default string size
'To define the default string size as the follows constant.#define STRINGSIZE 24
Defining a length for the string is the best way to limit memory usage. It is good practice if you need a string of a certain size to set the length of a strings, since the default length for a string variable changes depending on the amount of memory in the microcontroller (see above).
To set the length of a string, see the example below:
'Create buffer variables to store received messages as 16 bytes longDimOutBufferAsString*16
In this case the buffer is HSerString.
Remember two things:
1) HSerString(0) contains the length.
2) 13, 0x0D, Carriage return terminates the entry, hsersgetstring can wait forever for this end
BR
Mike
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is there a buffer size limitation on the hsersgetstring? Is there a way around it?
thanks.
Yes, Look in Help under variables string and you will find the default length.
10 bytes for chips with less than 16 bytes of RAM.
20 bytes for chips with 16 to 367 bytes of RAM.
40 bytes for devices with more RAM than 367 bytes.
I have not tried this but you may be able to
Also read:
To change the default string size handled internally by the Great Cow BASIC compiler you add increase/decrease the default string size
Defining a length for the string is the best way to limit memory usage. It is good practice if you need a string of a certain size to set the length of a strings, since the default length for a string variable changes depending on the amount of memory in the microcontroller (see above).
To set the length of a string, see the example below:
In this case the buffer is HSerString.
Remember two things:
1) HSerString(0) contains the length.
2) 13, 0x0D, Carriage return terminates the entry, hsersgetstring can wait forever for this end
BR
Mike
Thanks! Excellent info.