Showing posts with label Cold Fusion. Show all posts
Showing posts with label Cold Fusion. Show all posts

Wednesday, May 12, 2010

Find in CF

Finds the first occurrence of a substring in a string, from a specified start position. The search is case-sensitive.
A number; the position of substring in string; or 0, if substring is not in string.
Syntax:
Find(substring, string [, start ])

Parameter Description
substring A string or a variable that
contains one. String for which to search.
string A string or a variable that contains one.
String in which to search.
start Start position of search.

Program :


#find("the",stringToSearch)#

#find("the",stringToSearch,35)#

#find("no such substring",stringToSearch)#



Source :
http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi80.htm#wp1104451

Friday, March 26, 2010

findnocase in CF

Finds the first occurrence of a substring in a string, from a specified start position. If substring is not in string, returns zero. The search is case-insensitive.
The position of substring in string; or 0, if substring is not in string.

Syntax:
FindNoCase(substring, string [, start ])

Parameter Description
substring A string or a variable that contains one. String for which to search.
string A string or a variable that contains one. String in which to search.
start Start position of search.

Program:

#findnocase("the",stringToSearch)#
#findnocase("the",stringToSearch,5)#
#findnocase("no such substring",stringToSearch)#


Source : http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi81.htm#wp1104504

Monday, March 22, 2010

findoneof in CF

Finds the first occurrence of any one of a set of characters in
a string, from a specified start position. The search is case-sensitive.
The position of the first member of set found in string; or 0, if no
member of set is found in string.

Syntax:
FindOneOf(set, string [, start ])

Parameter Description
set A string or a variable that contains one.
String that contains one or more characters to search for.
string A string or a variable that contains one. String in which to search.
start Start position of search.

Program:

#findoneof("aeiou",stringToSearch)#


#findoneof("aeiou",stringToSearch,4)#


#findoneof("@%^*()",stringToSearch)#



Source: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi82.htm#wp1104557

Wednesday, March 03, 2010

compare in ColdFusion

Performs a case-sensitive comparison of two strings.
  • -1, if string1 is less than string2
  • 0, if string1 is equal to string2
  • 1, if string1 is greater than string2

Syntax :
Compare(string1, string2)

Parameter Description

string1 A string or a variable that contains one

string2 A string or a variable that contains one

Compares the values of corresponding characters in string1 and string2.


Coding :


Source: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi37.htm#wp1101820

Monday, February 22, 2010

Replace in CF

Replaces occurrences of substring1 in a string with substring2, in a specified scope. The search is case-sensitive.

Syntax:
Replace(string, substring1, substring2 [, scope ])

Parameter Description
string String in which to search
substring1 String for which to search
substring2 String that replaces substring1
scope one: replace the first occurrence (default)
all: replace all occurrences


To remove a string, specify the empty string ("") as substring2.
You do not need to escape comma characters in strings.

Program:
#Replace(FORM.myString, FORM.MySubstring1, FORM.mySubString2)#

Source: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functa68.htm#wp1111342

Monday, February 08, 2010

cfsilent in CF

cfsilent:
Suppresses output produced by CFML within a tag's scope.
This tag requires an end tag.

Syntax:




Program:

cfsilent



Inside cfsilent block
b-a = #c#


b-a = #c#



Source : http://livedocs.adobe.com/coldfusion/6.1/htmldocs/tags-pc7.htm#wp1103549

Sunday, January 24, 2010

cfinclude in ColdFusion

cfinclude
Embeds references to ColdFusion pages in CFML.
You can embed cfinclude tags recursively.

Syntax :


ColdFusion searches for included files in the following sequence:
In the directory of the current page
In directories mapped in the ColdFusion Administrator for the included file
The included file must be a syntactically correct and complete CFML page.For example, to output data from within the included page, you must have a cfoutput tag, including the end tag, on the included page, not the referring page. Similarly, you cannot span a cfif tag across the referring page and the included page; it must be complete within the included page.

Program:


Source :
http://livedocs.adobe.com/coldfusion/6.1/htmldocs/tags-p63.htm#wp1100248

Saturday, January 16, 2010

cfhtmlhead in ColdFusion

Writes text to the head section of a generated HTML page. It is useful for embedding JavaScript code, or putting other HTML tags, such as meta, link, title, or base in an HTML page header.
Syntax:


Note:
If you use this tag after the cfflush tag on a page, an error is thrown.

Program:

">


Source: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/tags-p57.htm#wp1099843

Friday, December 25, 2009

cfobjectcache in CF

The main function is to clear the occupied memory
and free the memory space.Flushes the query cache.

Syntax:




Attribute Req/Opt Description

action Required clear:Clears queries from the cache in the Application scope

Source : http://livedocs.adobe.com/coldfusion/6.1/htmldocs/tags-b11.htm#wp2310692

Monday, December 07, 2009

cfupdate in CF

Updates records in a data source from data in a ColdFusion form or form Scope.

Syntax :


Attribute - description

dataSource- Name of the data source that contains the table. tableName- Name of table to update. tableOwner- For data sources that support table ownership tableQualifier- For data sources that support table qualifiers. username- Overrides username value specified in ODBC setup.password- Overrides password value specified in ODBC setup.formFields-Comma-delimited list of form fields to update.

Note :
If a form field is not matched by a column name in the database, ColdFusion throws an error.
The formFields lies must include the database table primary key field, which must be present in the form. It can be hidden.

Program :

SELECT Course_Number, Course_ID, DescriptFROM CoursesWHERE Course_ID = #Trim(url.Course_ID)#ORDER by Course_Number

Source : http://livedocs.adobe.com/coldfusion/6.1/htmldocs/tags-c19.htm#wp1104662

Tuesday, October 13, 2009

Months as string in Cf

MonthAsString
Determines the name of the month that corresponds to month_number.
A string; the name of a month.
Syntax :
MonthAsString(month_number)


Parameter Description
month_number An integer in the range 1 - 12.

MonthAsString Example



More information about your date:



Your date, #DateFormat(yourDate)#.

It is #DayofWeekAsString(DayOfWeek(yourDate))#, day #DayOfWeek(yourDate)# in the week.

This is day #Day(YourDate)
# in the month of #MonthAsString(Month(yourDate))#, which has
#DaysInMonth(yourDate)# days.

We are in week #Week(yourDate)
# of #Year(yourDate)# (day #DayofYear(yourDate)# of
#DaysinYear(yourDate)#).



This is a leap year
This is not a leap year




Source : http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functa46.htm#wp1109961

Sunday, October 11, 2009

DatePart CF function

DatePart
Extracts a part from a date value.
Part of a date, as an integer.

Syntax :
DatePart("datepart", "date")
Parameter Description datepart String:
yyyy: Year
q: Quarter
m: Month
y: Day of year
d: Day
w: Weekday
ww: Week
h: Hour
n: Minute
s: Second
l: Millisecond
When passing a date/time object as a string, you must enclose it in quotation
marks. Otherwise, it is interpreted as a numeric representation of a date/time object.



  • year: #DatePart("yyyy", todayDate)#
  • quarter: #DatePart("q", todayDate)#
  • month: #DatePart("m", todayDate)#
  • day of year: #DatePart("y", todayDate)#
  • day: #DatePart("d", todayDate)#
  • weekday: #DatePart("w", todayDate)#
  • week: #DatePart("ww", todayDate)#
  • hour: #DatePart("h", todayDate)#
  • minute: #DatePart("n", todayDate)#
  • second: #DatePart("s", todayDate)#



source : http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi60.htm#wp1103355
Computers Add to Technorati Favorites Programming Blogs - BlogCatalog Blog Directory