Changeset [7be6352531a94c7ac4f9a70ce94b597a27bfc19a] by Brian Donovan

October 21st, 2010 @ 06:54 AM

Add format parameter index support to sprintf.

This is primarily useful in cases when the format string can vary, but the argument order will not, as is often the case with format strings in Localized.strings files.

From http://perldoc.perl.org/functions/sprintf.html:

An explicit format parameter index, such as 2$. By default sprintf will format the next unused argument in the list, but this allows you to take the arguments out of order.

See also this Cocoa example: http://stackoverflow.com/questions/1063843/is-there-a-way-to-specif...
https://github.com/280north/cappuccino/commit/7be6352531a94c7ac4f9a...

Committed by Brian Donovan

  • M Objective-J/sprintf.js
  • M Tests/Objective-J/sprintfTest.j
New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Cappuccino Web Framework, including AppKit, Foundation, and Objective-J.

Shared Ticket Bins