I have tried this and cannot get it to work either!
The Print statement in DBPro would work as follows:
Print "You have "; Soldiers; " left"
I'm not sure that the documentation for dbPrint can be quite right as it states that the print list can be seperated by a semi-colon or a comma. If you attempt to use a semi-colon then the C++ compiler will see this as a statement terminator! Seperating with a comma doesn't work and I could never see how it could!
The dbPrint function clearly only takes a single argument, although it can be one of four types. So I can't see how your syntax would ever work either.
It could be the documentation is misleading. It certainly wouldn't be the first time!
I personally would use the following:
#include <string>
using namespace std;
string MyString;
int Soldiers;
Soldiers = 100;
MyString = "You have ";
MyString += dbStr(Soldiers);
MyString += " soldiers left";
dbText(10,10,(char*)MyString.c_str());
Not the most elequent of code but it works. You could easily convert it into a function and then the call becomes a single line as follows:
PrintLine(StartText, Value, EndText, XPos, YPos).
If anyone knows how the dbPrint statement is supposed to work I'd be interested. My guess is it just takes a single argument and no longer supports a list of values and TGC have just not bothered to update the documentation.
No matter how good your code is, someone will improve on it