the "skp" variable is a pointer to a oapi::Sketchpad class.
Well, we're not working with sketchpad currently...
That was fast :lol:
anyways glad to see that it works. Getting the first thing working is always a bit of a task, after that you quickly get the hang of it.
As for your question, this is completely OAPI unrelated. I usually just use sprintf to print everything into a chararray, then pass that on to the print function. The print function doesn't have anythig to do with it, it just prints what it gets.
sprintf can be a bit confusing at first, but it's really quite simple. You have the target string, then the format string, then the variables.
for example,
Code:
sprintf(text, "hello %s, you weight %0.2f kg", name, weight);
will result in text looking something like "hello Dude, you weight 70.37 kg", if the string name was "Dude", and the float weight was 70.379482289875. In case you're wondering what the %0.2f exactly is, it just tells how many digits after the comma of a float should be printed into the string. Very useful.
You can extend this to use as many format identifiers as you like, important is just that every identifier will have a variable to go with it.
Oh, and make sure the string you print to a chararray isn't longer than the array. That leads to all kind of difficult to find bugs, as sprintf will just print beyond the string into memory that you maybe used for something else...
The most common identifiers used are %s (string), %d (integer) and %f (float).
EDIT: ah, I see Orb was a bit more correct in using the secured function that also takes the string name. Probably recommendable...
and I'll be keeping your son in my prayers
Thanks! He had a great surgery and has woken up this afternoon. I saw him yesterday, and he looked still somewhat bloated, but he got most of the water out of his system by now. Looks like he'll be as good as new.