On Tue, Dec 4, 2012 at 6:30 PM, Eduardo Lima (Etrunko) <[email protected]> wrote:
> On Tue, Dec 4, 2012 at 6:21 PM, Enlightenment SVN
> <[email protected]> wrote:
>> Log:
>> New embryo function: get_program_id
>>
>>   It is now you can run programs with names generated dinamically. Say that 
>> you
>>   have 10 programs indexed somehow. You can now call them using the 
>> following snippet:
>>
>>   script {
>>      new program_id[15], i;
>>      for (i = 0; i < 10; i++) {
>>         snprintf(program_id, 15, "my_program_%d", i+1);
>>         run_program(get_program_id(program_id));
>>      }
>>   }
>>
>
> By the way, I noticed a bug in Embryo's snprintf. I can specify
> something like "my_program_%02d" as format string and it will generate
> as result "my_program_01", "my_program_02", and so on. It will use '0'
> to the left of the number if it is less than 2 chars long. See test
> code attached.

sorry if that bite you, but it's a "known issue". If you look at some
e17 themes or even outside people doing clocks (hint: canola2) there
are snippets:

 if (x < 10)
    snprintf(buf, sizeof(buf), "0%d", x);
else
    snprintf(buf, sizeof(buf), "%d", x);

:-/




--
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: [email protected]
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to