> I have the code below doing this where 01011 is a zip code. 
> So I would like the output to be 01018 as the appended value 
> in the array but right now I am getting 1018 (leading 0 
> getting cut off) I tried listappend and it does the same 
> thing. Val() and tostring() didn't seem to do much either. Any ideas?
> 
> ArrayAppend(myArrayList2,01011+7);

CF doesn't keep leading zeros for numeric values. You're treating the zip
code as a numeric value, by using it as an operand in numeric addition. So,
naturally, you're losing the leading zero. Offhand, I'm not sure how I'd go
about doing this - you don't typically use zip codes in numeric operations -
but you could write a function that performs the numeric addition, then
checks the length of the value to see if it's four or five digits. If it's
four, you can reasonably assume that the first character was a zero before
the addition. You could then plop it back on the front of the value.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232534
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to