wxString.Format()

wxWindows

    Next

  • 1. Info about CTB library
    I have to send an hexadecimal number via serial port, but I'm not able.....(for example 06h) wxSerialPort::write() take as arguments a char[].. Best Frank --------------------------------------------------------------------- To unsubscribe, e-mail: XXXX@XXXXX.COM For additional commands, e-mail: XXXX@XXXXX.COM
  • 2. Data access, server, ODBC ? server applications and planning
    Hi, i want to do a planning application and lot of people can access the base and works on a planning, but i want to prevent people to work on the same day data so i think of several solutions (or idea maybe) : * to use a Data Base and access it with ODBC but it is then possible to prevent people to work on the same day for example * to use a client/server application but then i lost the avantage to work on a classic Data Base * to have each instance of the applications to talk to others one to know the data they are working on (but difficult if an instancer is not on the intranet) Thanks a lot for idea
  • 3. Convert string to long long
    There is a method to convert long long to wxString, namely wxLongLong::ToString There is no method for converting from a wxString to a long long. Also, the unsigned counterparts are missing. Is there a reason for this or did it just get missed? Peter --------------------------------------------------------------------- To unsubscribe, e-mail: XXXX@XXXXX.COM For additional commands, e-mail: XXXX@XXXXX.COM

wxString.Format()

Postby linus » Fri, 25 Jul 2003 04:09:06 GMT

Hello!

In my app, I have a string that contains more than one value: 'xxx %d yyy %d'. 
When this string is translated the %d's might need to change order. 

On linux, I can do this by using %1$d and %2$d instead of plain %d's - but 
this doesent show up correctly on windows.

I'm unable to find anything in the string docs or i18n topic overview, is 
there a way to do it in wx?

thanks

/Linus

-- 
 http://www.**--****.com/ 

---------------------------------------------------------------------
To unsubscribe, e-mail:  XXXX@XXXXX.COM 
For additional commands, e-mail:  XXXX@XXXXX.COM 


Re: wxString.Format()

Postby linus » Fri, 25 Jul 2003 04:26:40 GMT

Ok, thanks alot for the quick reply!

/Linus






-- 
 http://www.**--****.com/ 

---------------------------------------------------------------------
To unsubscribe, e-mail:  XXXX@XXXXX.COM 
For additional commands, e-mail:  XXXX@XXXXX.COM 


Similar Threads:

1.Formatting double with wxString::Format

Hi,

my program is compiled with MinGW on XP with wxWidgets-2.8.8.

Using wxString::Format("<%010.2f>", 3.14) I get the result
"<      3.14>" (padded with blanks).
When I use sprintf(buf, "<%010.2f>", 3.14) instead, then I get the
correct result "<0000003.14>".

Is this a bug in wxString?

Lutz



2.wxString::Format way of putting commas in numbers: ie 10,000

3.CVS HEAD wxString::Format crash

I'm trying to port my codebase to wxWidgets 2.7 CVS HEAD from 2.6.3

this code worked in 2.6.3

    wxString fun = "FLASH_GetWidth";
    wxString arg = "";
    wxString::Format("<invoke name=\"%s\"
returntype=\"xml\"><arguments><string>%s</string></arguments></invoke>", fun
, arg );

but it crashes in CVS HEAD


if i change it to

    wxString::Format("<invoke name=\"%s\"
returntype=\"xml\"><arguments><string>%s</string></arguments></invoke>",
fun.c_str() , arg.c_str() );

or even to

    wxString::Format("<invoke name=\"%s\"
returntype=\"xml\"><arguments><string>%s</string></arguments></invoke>",
fun.c_str() , arg );


it works.


So it seems the last parameter can be a wxString and automatically gets
converted. but the ones before that do not.


I'm using visual studio 2005 professional, UNICODE=0, WCHAR_T=1


Does anyone know if this is a bug? or do I just have to add .c_str() in
hundreds of places in my code?


Thanks,
Willem

I'm trying to port my codebase to wxWidgets 2.7 CVS HEAD from 2.6.3<br><br>this code worked in 2.6.3<br><br>    wxString fun = "FLASH_GetWidth";<br>    wxString arg = "";<br>    wxString::Format("<invoke name=\"%s\" returntype=\"xml\"><arguments><string>%s</string></arguments></invoke>", fun , arg );
<br><br>but it crashes in CVS HEAD<br><br><br>if i change it to <br><br>    wxString::Format("<invoke name=\"%s\" returntype=\"xml\"><arguments><string>%s</string></arguments></invoke>", 
fun.c_str() , arg.c_str() );<br><br>or even to<br><br>    wxString::Format("<invoke name=\"%s\" returntype=\"xml\"><arguments><string>%s</string></arguments></invoke>", 
fun.c_str() , arg );<br><br><br>it works.<br><br><br>So it seems the last parameter can be a wxString and automatically gets converted. but the ones before that do not. <br><br><br>I'm using visual studio 2005 professional, UNICODE=0, WCHAR_T=1
<br><br><br>Does anyone know if this is a bug? or do I just have to add .c_str() in hundreds of places in my code?<br><br><br>Thanks,<br>Willem<br><br><br>

4.wxString::Format and Unicode

5.wxString::Format

Why does the third line of this code:

wxString s = wxT("");
s.Printf(wxT("%d"), parseIndex);
s += wxString::Format(wxT("%d"), parseIndex);

give me this error from the gcc compiler: "parse error before numeric 
constant" , while the second line is fine?

Bill


---------------------------------------------------------------------
To unsubscribe, e-mail:  XXXX@XXXXX.COM 
For additional commands, e-mail:  XXXX@XXXXX.COM 

6. [2.5.3] wxString::Format and unicode

7. wxString, Format etc.

8. wxString::Format and %



Return to wxWindows

 

Who is online

Users browsing this forum: No registered users and 63 guest