Hi, Can anyone here describe how I can program this algorithm in FP to output numbers? This comes from my customer (I have redacted some of the source code for confidentiality): ---------------------------------------------------------------- The base of the promo sequence numbers is a regular consecutive list of numbers generated by increments of one. Given a range, a starting and ending number, the numbers are generated within this range.
3.1 The pseudo code For every number between start_value and end_value 1. Right justify string in an 8 digits format. 1. Padding with 0 digits must be done on the left 2. There should be no spaces in the 8 digit field. 2. Insert a 0 (zero) character in third position, creating a 9 digit number. 3. Calculate check digit according to algorithm in 3.2 section 4. Replace 0 in third position with the obtained digit from the previous step. 3.2 Digit check algorithm The check algorithm follows logic similar to Committee on Uniform Security Identification Procedures. (CUSIP). See http://en.wikipedia.org/wiki/CUSIP?wwparam=1220817172. Note that our algorithm does not reproduce the CUSIP algorithm exactly. 3.3 Source code **SNIP** static char check_digit( const char *s, int len ) { static int aw[] = {2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1}; int offset; } return (char)('0' + (10-d%10)%10 ); } **SNIP** ------------------------------------------------------------------ Can you help? Thanks, Jeff Lazerus Spectrographics +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- FusionPro 5.0 Now Available! Variable text on a curve and soft drop-shadows for variable text LIMITED TIME upgrade offer of $299 per license for current customers: http://fusionpro.printable.com/store/upgrade New licenses available for $599 each at: http://fusionpro.printable.com/store/ All FusionPro 5.0 customers to receive FusionPro 5.1 with Adobe Acrobat 8 and InDesign CS3 support when released for FREE. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- -- Users of FusionPro Desktop have unlimited free email support. Contact Printable Support at [EMAIL PROTECTED] -- View FusionPro Knowledge Base, FusionPro Samples at www.printable.com/vdp/desktop.htm -- You are currently subscribed to fusionpro as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] -- -- Note: All e-mail sent to or from this address will be received or otherwise recorded by the e-mail recipients of this forum. It is subject to archival, monitoring or review by, and/or disclosure to someone other than the recipient. Our privacy policy is posted on www.printplanet.com --
