Page 1 of 1

PostPosted: Thu May 29, 2003 7:35 am
by Hark0

Where is the limit of String size????


string TEXT;
TEXT="Hello World!";

Console Shows:

How I define a size of string to 1024 chars????

Thx in advance.


PostPosted: Thu May 29, 2003 2:12 pm
by wolfgang
Your example does not look right - shouldn't the length be 12 rather than 11?

To your question: I know the PalmOS version of PocketC has a limit for string constants of 255 characters. It may be that the WindowsCE version has the same. This means you cannot simply write

mystr = "sfdbaj......adssa";

with the string on the right side having more than 255 characters. But this only concerns string constants that you assign to a string. Strings themselves can be any length up to the available storage space of your device (at least I haven't yet hit any limit even with very long strings, and I know string storage space allocation is done dynamically). And for the string constant problem, there is an easy workaround: concatenate several smaller strings when you assing them to the variable:

mystr = "first chunk" + "second chunk" + .... + "nth chunk";

where each chunk can be up to 255 characters.


Composing music on the PocketPC! -

PostPosted: Fri May 30, 2003 2:05 pm
by Hark0
ok thanks

No is my idea....

I search another method....



PostPosted: Fri May 30, 2003 9:10 pm
by KOU
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Your example does not look right - shouldn't the length be 12 rather than 11?<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

It should be 13 if the string is NULL terminated string.
Maybe PocketC is different.

PocketC had no problem storing a whole HTML file into one string.
(I wrote HTML2TXT tool)


PostPosted: Mon Jun 02, 2003 12:24 pm
by guy
I think that string lengths are limited only by the amount of available memory.

Look at ustring.h from the example extension dll kit.

PocketC CE API interface:
PCForm and CE API forum: