If I understand correctly, the @printf and @sprintf macros generate code 
based on the a string literal that is passed as the first argument. You 
cannot pass a variable who's value is a format string to those macros 
because the value would not be known when the macro is called and the code 
is generated.  

Sam

On Friday, June 20, 2014 2:20:44 PM UTC-7, Dustin Lee wrote:
>
> Also this is 0.3
>
> On Friday, June 20, 2014 3:15:22 PM UTC-6, Dustin Lee wrote:
>>
>>
>> If run the following two lines:
>>
>> format = "%d"
>> @sprintf format 33
>>
>> I get the message:
>>
>> ERROR: @sprintf: first argument must be a format string
>>
>> If I run what I would have thought of as equivalent
>>
>> @sprintf "%d" 33
>>
>> it works just fine.
>>
>> So is this a bug or am I confused?
>>
>

Reply via email to