gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > VBA with prtintf?

#29369 - gauauu - Fri Nov 19, 2004 3:38 am

Hey, I've heard tell that you can use printf's in VBA. Is there a doc somewhere with info on how to do this?

thanks!

#29373 - sajiimori - Fri Nov 19, 2004 5:27 am

Yup, the VBA faq on forgotten's site.

#29379 - tepples - Fri Nov 19, 2004 6:03 am

It's not really Forgotten's site anymore, as Forgotten has handed the project over to kxu, who hasn't seemed to make any releases in nearly 6 months, in effect handing the project over to fork maintainers such as Denopqrihg, but I digress.

There are at least three ways to print a string in VBA:
  • VBA style puts() (which crashes on real hardware),
  • Mappy VM style puts() (which expands to a fancy nop on real hardware), and
  • writing the string to a map or to a line of sprites (which should show up on real hardware as it does on VBA).
To format a string to display, use either siprintf() (a version of sprintf() that doesn't do floating-point) or Dan Posluns' optimized posprintf().
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#29382 - gauauu - Fri Nov 19, 2004 6:41 am

cool, thanks!