Hi!
(PC, CWR4, PalmOS 2 & 3, POSE 2.0b3 & 2.1d25)
I posted this once but there was no answer (at least I didn't recive any).
I noticed slight DebugROM2.0 <-> DebugROM3.0 incompatibilities.
1) What's the difference between
FrmGetFormId(FrmGetActiveForm() and FrmGetActiveFormID() ?
Both work well under 2.0, but under 3.0 the first one crashes the program
with 'Null Form passed!' in debugger.
2) String truncation: when I want to put label for a popup trigger not to
exceed some length, I copy wanted number of chars from source string to
temporary destination string using FntCharsInWidth and then CtlSetLabel...
The slippery thing is StrNCopy call! When src string is shorter than
allowed number of chars, I copy StrLen(src)+1 (without that '1' it's not
well terminated - it seems without /0 at the end) and it works well under
2.0 & 3.0.
Now, when src is greater then allowed length, StrNCopy copies well
considering number of chars, but it:
-terminates dst string well under 2.0
-doesn't terminate dst string at all under 3.0 (i have to put /0
manually).
Again, I don't understand why (same documentation text for 2.0 & 3.0)
here's the code excerpt:
//label is src string
//TrigLabel is dst string
//TrigLabelP is dst string pointer
len=CharsInWidth(label,width)+1;
temp=StrNCopy(TrigLabel,label,len);
if (len<StrLen(label))
TrigLabel[len]=0; //manual termination for 3.0
CtlSetLabel(ctl,TrigLabelP);
I managed to get through, but I'd like some experienced 2.0->3.0 user to
warn everybody what to expect!