STRUCTNEW | |
説明
構造体を作成します。 |
|
戻り値
構造体 |
|
カテゴリ
構造体関数 |
|
関数のシンタックスStructNew() |
|
関連項目
構造体関数、『ColdFusion MX 開発ガイド』の第5章の「配列と構造体の使用」 の「構造体関数」 |
|
パラメータ
なし |
|
例<!--- この例は、StructNew の使用方法を示しています。"addemployee.cfm" ファイルを使用する CF_ADDEMPLOYEE を呼び出して、従業員のレコードをデータベースに追加します。 ---> <h1>新しい従業員の追加</h1> <cfparam name = "FORM.firstname" default = ""> <cfparam name = "FORM.lastname" default = ""> <cfparam name = "FORM.email" default = ""> <cfparam name = "FORM.phone" default = ""> <cfparam name = "FORM.department" default = ""> <cfif FORM.firstname EQ ""> <p>フォームの各項目を入力してください。 <cfelse> <cfoutput> <cfscript> employee = StructNew(); StructInsert(employee, "firstname", FORM.firstname); StructInsert(employee, "lastname", FORM.lastname); StructInsert(employee, "email", FORM.email); StructInsert(employee, "phone", FORM.phone); StructInsert(employee, "department", FORM.department); </cfscript> <p>名前 : #StructFind(employee, "firstname")# <p>姓 : #StructFind(employee, "lastname")# <p>電子メール : #StructFind(employee, "email")# <p>電話番号 : #StructFind(employee, "phone")# <p>部門 : #StructFind(employee, "department")# </cfoutput> <!--- 従業員を追加するカスタムタグを呼び出します。 ---> <CF_ADDEMPLOYEE EMPINFO = "#employee#"> </cfif> |