>The function call FrmCustomAlert() does this with up to three substrings in
>it. You can easily implement this with the support of StrPrintF in the API.
>It would go like this...
>
>int ParamStr(char *pEmbeddedStr, *p1, *p2, *p3)
>{
> char output[80];
> int result = StrPrintF(output, pEmbeddedStr, p1, p2, p3);
> StrCopy(pEmbeddedStr, output);
> return(result);
>}
>
>Where the param string passed in would be "Hello %s. Where is %s. Good %s".
>
>Palm Programming wrote:
>
>> On the mac and newton, there was a function ParamStr that would take a
>> string embedded with a ^0, ^1, ^2 etc and replace those place holders with
>> a list of supplied substrings.
>>
>> I saw a textreplacestr mentioned in the docs but i can't find it in any of
>> my includes
>>
>> steve weintraut
>> [EMAIL PROTECTED]
1. One problem with using StrPrintF to create a parameterized string is
that it doesn't let you re-order the parameters. This typically causes
problems for localizers, where the order of words in a sentence frequently
needs to be changed. For this reason, the template string in FrmCustomAlert
uses ^1, ^2, and ^3 as the substrings to be replaced.
2. In Palm OS 3.1 or later, there's a new TxtReplaceStr, which can be used
to do parameterized substring insertion.
3. The 3.1 SDK also contains a routine called TxtGlueParamStr, which is
slightly easier to use and is also designed to work on older (pre-3.1)
versions of the OS.
-- Ken
Ken Krugler
TransPac Software, Inc.
<http://www.transpac.com>
+1 530-470-9200 (direct) +1 408-261-7550 (main)