> From: Scott Klement
>
> Really.  In C I'd probably do something like this:
>
>   sprintf(b+1, "%05d", a);
>
>   or maybe:
>
>   sprintf(temp, "%05d", a);
>   memcpy(b+1, temp, 5);


Hmmm.  Let's play the old Sesame Street game: one of these things is not
like the other.

A. %subst(b : 2 : 2) = %editc(a : 'X');
B. sprintf(temp, "%02d", a);
   memcpy(b, temp, 2);
C. MOVE A B

The music starts... "One of these things is not like the other, one of these
things just doesn't belong.  Can you guess which thing is not like the
other, by the time I finish my song?"

Which do you think someone would select?

<smile>

Joe

P.S. Check it out with temporary variables:

A. temp = %editc(a : 'X');
   %subst(b : 2 : 2) = temp;

B. sprintf(temp, "%02d", a);
   memcpy(b, temp, 2);

C. MOVE A TEMP
   MOVE TEMP B


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.