View comments | RSS feed

LJustify

Description

Left justifies characters in a string of a specified length.

Returns

A copy of a string, left-justified.

Category

Display and formatting functions, String functions

Function syntax

LJustify(string, length)

See also

CJustify, RJustify

Parameters

Parameter Description

string

A string or a variable that contains one

length

Length of field in which to justify string

Example

<!--- This example shows how to use LJustify --->
<cfparam name = "jstring" default = "">

<cfif IsDefined("FORM.justifyString")>
   <cfset jstring = LJustify(FORM.justifyString, 35)>
</cfif>
<html>
<head>
   <title>LJustify Example</title>
</head>
<body>

<h3>LJustify Function</h3>
<p>Enter a string, and it will be left justified within the sample field

<form action = "ljustify.cfm">
<p><input type = "Text" value = "<cfoutput>#jString#</cfoutput>" 
 size = 35 name = "justifyString">

<p><input type = "Submit" name = ""> <input type = "RESET">
</form>

ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | KnowledgeBase | Bug Reporting

Version 7

Comments


dlakein said on May 29, 2006 at 3:42 PM :
code bug with this and similar pages; form doesn't specify the mode, which will be Get by default, and put the form fields in the URL. However, the action code uses the Form scope, so the IsDefined will never be true, and function examples will not be used.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/7/htmldocs/00000567.htm