Curioser and curioser...
I just wrote a small test program that creates a large memo, in order to check
how MemoPad behaves when it is told to open such a memo.
Apparenly, under PalmOS 3.5 (the emulator), MemoPad has absolutely no problems
*opening* the large memo or even deleting parts from it - it just cannot
*insert* anything new in it.
Under PalmOS 5.2.1 (the simulator), it can even insert.
Has the 4 Kb limit been removed in the later versions of MemoPad? Or am I
missing something? Here is my program; it should create a memo about 20 Kb
large (there are 1000 lines and each line is 24-27 characters):
#include <PalmOS.h>
UInt32 PilotMain (UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags)
{
DmOpenRef MemoDB;
MemHandle recH, namesH;
MemPtr recP;
Char *text, *line = "12345678901234567890\n", lineNum [maxStrIToALen],
*ln;
UInt16 i, recID, size;
switch (cmd)
{
case sysAppLaunchCmdNormalLaunch:
MemoDB = DmOpenDatabaseByTypeCreator ('DATA',
sysFileCMemo, dmModeReadWrite);
namesH = MemHandleNew (1);
text = (Char *) MemHandleLock (namesH);
text [0] = '\0';
MemHandleUnlock (namesH);
size = 1;
for (i = 0; i < 1000; i++)
{
ln = StrIToA (lineNum, i + 1);
size += StrLen (ln) + 2 + StrLen (line) + 1;
MemHandleResize (namesH, size);
text = (Char *) MemHandleLock (namesH);
StrCat (text, ln);
StrCat (text, ": ");
StrCat (text, line);
MemHandleUnlock (namesH);
}
text = (Char *) MemHandleLock (namesH);
recH = DmNewRecord (MemoDB, &recID, StrLen (text) + 1);
recP = MemHandleLock (recH);
DmWrite (recP, 0, text, StrLen (text) + 1);
MemHandleUnlock (recH);
MemHandleUnlock (namesH);
DmReleaseRecord (MemoDB, recID, true);
DmCloseDatabase (MemoDB);
MemHandleFree (namesH);
}
return 0;
}
Regards,
Vesselin
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/support/forums/