If you're looking to pad with spaces, LJustify(), RJustify() and CJustify() should give you what you need.
If you need to pad with other characters, something similar to this should suffice: <cfset stringLength=9> <cfset padChar="0"> <cfset myVariable=Variables.myVariable & RepeatString(Variables.padChar, Variables.stringLength - Len(Variables.myVariable))> > -----Original Message----- > From: Kris Pilles [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, October 15, 2002 9:09 AM > To: CF-Talk > Subject: Setting variablelength > > > I need to know how to set variable length on some query results I am > amending to a text file. For example the query returns a 7 digit > student number but I need studentnumber to take up spaces... > Is there an > easy way where I can add 2 spaces to the end of this query result... > > Ideally I would like to set variable x = a length of 9 y = 12 etc... > This way if student number is returned as a 6 digit string I > don't need > to do anythign else... > > Please advise.. > > KP > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm

