> --- Todd Cary wrote: > > var > > Dst: PChar; > > Src: PChar; > > begin > > StrCopy(Src, 'Demo string'); > > // So far so good > > // Now, how do I copy "string" to Dst? > > // I need a substring > > // This does not work: StrCopy(Dst, Src + 5); > > end; > > In C, you could do this: > > Char Src[12]; > Char Dst[7]; > > StrCopy(Src, "Demo string"); > StrCopy(Dst, Src+5);
Personally, I like to use: StrCopy(Dst, &Src[5]); But that's just a personal preference... Quite likely, Joe's assessment that you are not allocating space for the strings before copying into them, so you are copying "Demo string" and "string" into random (and probably protected) memory spaces. -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
