Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
109 user(s) are online (105 user(s) are browsing Forums)

Members: 0
Guests: 109

more...

Support us!

Headlines

 
  Register To Post  

Anonymous
ILocale->FormatString32() example
I'm searching for an example of ILocale->FormatString32() showing how to write custom PutCharFunc. I'm particularly interested in a PutCharFunc just counting characters.

Go to top
Anonymous
Re: ILocale->FormatString32() example
Well, I've found that I can use IUtility->VSNPrintf() for both counting characters and do formatting to a buffer. I guess that locale.library "takes over" the VSNPrintf() when installed, so the result is exactly the same. Still an example showing non-standard PutChProc for FormatString32() may be interesting, as the autodoc is not clear (for example it specifies the third parameter as "TEXT", whatever it means...).

Go to top
Re: ILocale->FormatString32() example
Just popping in
Just popping in


See User information
@krashan

TEXT is the base type for STRPTR and CONST_STRPTR. So basically it is equal to "char", which matches the Autodoc:

Quote:
A1 - character for hook to process (not a pointer!)


This means the third parameter is just a single character and NOT a pointer to a NUL terminated string.

Go to top
Re: ILocale->FormatString32() example
Not too shy to talk
Not too shy to talk


See User information
@krashan

Here are examples for various format functions:

http://www.amiga-news.de/forum/thread ... id=25548&BoardID=7#257442

It's for OS 3.x, though, i.e. FormatString32 is not contained. But it should be similar to the older FormatString.

Bye,
Thomas

Go to top
Re: ILocale->FormatString32() example
Quite a regular
Quite a regular


See User information
@krashan

Also be aware that SNPrintf and its kin return a count that includes the terminating null, so you get a return value one more than you would expect from the C library printf() or sprintf().

cheers
tony
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project