Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Limitation in Format() function?
Re: Limitation in Format() function? [message #13640 is a reply to message #13638] Fri, 18 January 2008 15:28 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14267
Registered: November 2005
Ultimate Member
alex100 wrote on Fri, 18 January 2008 06:02

Hi
I am trying to send an SQL command to SQLite database and I an building it using the Format function. Target databse table has lots of fields.
IF I use more then ten % in the first argunt of the Format function and erro appears like this:

error: invalid conversion from `const char*' to `int'
error: initializing argument 1 of `Upp::String Upp::Format(int, const char*,Upp::Value, Upp::Value, Upp::Value,Upp::Value, Upp::Value, Upp::Value, Upp::Value, Upp::Value, Upp::Value, Upp::
Value)'

Example:

This works: strSQL=Format("( ...) %d,'%0.2d-%0.2d-%0.2d','%s',%d,'%s','%0.2d-%0.2d-%0.2d')",1,2008,1,1, "aaa",1,"aaa",2008,1,1);

This doesnt works: strSQL=Format("( ...) %d,'%0.2d-%0.2d-%0.2d','%s',%d,'%s','%0.2d-%0.2d-%0.2d',%d)",1,2008,1,1, "aaa",1,"aaa",2008,1,1,1);


Is that a limitation?

Alex




Yes, currently, Format is limited to 10 parameters. Adding more is simple, but slightly increases the size of any linux binary using Format...

You can also use:

String Format(const char *s, const Vector<Value>& v);

- that has no limit at all.

Should I increase the limit?

Mirek
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: logs in release builds (801.r97, SVN rev 90)
Next Topic: DLI does not compile
Goto Forum:
  


Current Time: Sat Aug 02 15:24:06 CEST 2025

Total time taken to generate the page: 0.16021 seconds