Menu

#12 VDK printf function

VDK 2.0.0
closed
VDK (25)
2017-12-20
2017-08-23
Jason Ely
No

printf allows a programmer to format strings using printf syntax.

strPrintF = vdk.printf("Color %s, number1 %d, number2 %05d, hex %#x, float %5.2f, unsigned value %u.\n",
       "red", array(123456, 89, 255, 3.14159, 250))

The printf function will be added to the VDK root object or will be added to global function scope. Still undecided about this.

For more info on printf see wikipedia:

https://en.wikipedia.org/wiki/Printf_format_string

Discussion

  • Jason Ely

    Jason Ely - 2017-08-23
    • labels: --> VDK
     
  • Jason Ely

    Jason Ely - 2017-12-12
    • Milestone: VDK 2.0.0 --> Unassigned
     
  • Jason Ely

    Jason Ely - 2017-12-20
    • Milestone: Unassigned --> VDK 2.0.0
     
  • Jason Ely

    Jason Ely - 2017-12-20
    • status: open --> closed
     
  • Jason Ely

    Jason Ely - 2017-12-20

    Dev and testing done.

    Additionally, have only implemented conversion types %s and %d. Because VBScript is a type agnostic language, I'm still thinking about how to implement float, short, hex, ocatl, etc.

    If there is a need for such functionality in the future, I will implement it.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.