For sprintf type of functions you could use the vprintf versions. Instead of variable number of arguments, it takes a pointer to the arguments in memory.
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
tinman wrote:wvsprintf() is available as a Win32 API function in user32.dll. Where does FormatString() come from?
In PureBasic you don't need to use printf if you don't want to. It's just a combination of numerical conversion, formatting and converting to a string. result$ = "Foo: "+Str(value) and so on
Unless of course the format string is specified externally to your code. Then you might as well just use wsvprintf(). I think, but I'm not sure, that the va_list is just a pointer to a block of memory which contains the values you are converting. For example:
Import "user32.lib"
wvsprintf_.l(lpOutput.l, lpFormat.s, arglist.l) As "_wvsprintfW"
EndImport
output.s = Space(1024) ; 1024 is the maximum size
value.l = 23
wvsprintf_(@output, "Hi I'm %ld years old", @value) ; we are only converting value
Debug output
But if you had multiple values to convert then you would point to a sequential block of memory into which all the values you were converting were copied. You could try using wsprintf_(), which is probably an ImportC, which does the same but your va_list is automatically pushed onto the stack instead of you having to allocate memory and copy values there.
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)