printf

Non-platform specific questions.

printf

Postby Just4Fun » Sat Jul 09, 2005 5:33 pm

Could someone steer me toward the proper Script Editor syntax for this statement:

printf ("Hello %s", "World");

Thank you...
I've learned that I still have a lot to learn.

** Makslane == Genious **
Just4Fun
 
Posts: 524
Joined: Tue Jul 01, 2003 5:19 am
Location: USA: Washington State; West Coast
Score: 6 Give a positive score

Postby makslane » Sun Jul 10, 2005 2:26 pm

There is no support for printf in Game Editor.
You can use sprintf to put the text in some actor text:

sprintf(youractor.text, "Hello %s", stringvar);

Use sprintf to mix fixed text (like "Hello...") with text in variables (like actor name, numbers, ...)

More info about sprintf:
http://www.cplusplus.com/ref/cstdio/sprintf.html
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Just4Fun » Tue Jul 12, 2005 6:20 am

Opps! Sorry.

I misread the variables/functions menu... :oops:

but, thank you for the sprintf example! :wink:
I've learned that I still have a lot to learn.

** Makslane == Genious **
Just4Fun
 
Posts: 524
Joined: Tue Jul 01, 2003 5:19 am
Location: USA: Washington State; West Coast
Score: 6 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron