Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LJustify() and Left() problem.

Status
Not open for further replies.

GUJUm0deL

Programmer
Jan 16, 2001
3,676
0
0
US
Hi, I have a question about LJustify() and left().

I'm creating a file that has a fixed width of spaces. But for some reason when the "Address", and "city" fields are all together.
Code:
This is what I am doing:

[COLOR=red]
SETS THE "ADDRESS", and "CITY" FOR A SET NUMBER OF SPACES

<cfset Address = "                                        "> - (this is 40 chars long)
<cfset City = "                              "> - (this is 30 chars long)
[/color]

[COLOR=green]
And the following uses LJustify() and Left()

<cfset Address = LJustify(left(Address, 40), 40)>
<cfset city = LJustify(left(City, 30), 30)>
[/color]

But the results show up like this:

[COLOR=blue]123 SOME STREET[/color][COLOR=red]NYC[/color]
According to the first <cfset> shouldn't the "ADDRESS" have 40 chars of space and "CITY" have 30 chars?? So if ADDRESS is only 15 chars long, should the rest be filled with empty spaces??


I would love the help ASAP.


Thanks.

[sub]
____________________________________
Just Imagine.
[sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top