STRUCTDELETE  
説明

構造体から要素を削除します。

 
戻り値

ブール値。indicatenotexisting パラメータの値によって異なります。

 
カテゴリ

構造体関数

 
関数のシンタックス
StructDelete(structure, key [, indicatenotexisting ])
 
関連項目

構造体関数、『ColdFusion MX 開発ガイド』の第35章の「XML および WDDX の使用」 の「ColdFusion XML オブジェクトの変更」

 
ヒストリ

ColdFusion MX: 動作の変更 : この関数は、XML オブジェクトに使用できます。

 
パラメータ

 
<h3>StructDelete 関数</h3>
<!--- このページを動作させるには、全体を囲むコメントを削除してください。
<p>この例では、StructInsert 関数と StructDelete 関数を使用します。 
<!--- パラメータの初期値を設定 --->
<cfparam name = "firstname" default = "Mary">
<cfparam name = "lastname" default = "Sante">
<cfparam name = "email" default = "msante@allaire.com">
<cfparam name = "phone" default = "777-777-7777">
<cfparam name = "department" default = "Documentation"> 

 <cfif IsDefined("FORM.Delete")>
     <cfoutput>
     削除するフィールド : #form.field#
    </cfoutput>
    <p>
    <CFScript>
       employee = StructNew();
       StructInsert(employee, "firstname", firstname);
       StructInsert(employee, "lastname", lastname);
       StructInsert(employee, "email", email);
       StructInsert(employee, "phone", phone);
       StructInsert(employee, "department", department); 
    </CFScript>
     削除前の employee 構造体の内容 : 
    <cfdump var="#employee#">
    <br>
    <cfset rc = StructDelete(employee, "#form.field#", "True")>
    <cfoutput>
       "#form.field#" フィールドを削除できたかどうかについて、コードは次の結果を返しました : #rc#<br>
        現在の employee 構造体の内容 : <br>
        <cfdump var="#employee#">
        <br>
   </cfoutput>
</cfif>
<br><br>
<form method="post" action = "#CGI.Script_Name#">
   <p>削除するフィールドを指定してください。&nbsp;
   <select name = "field">
   <option value = "firstname">first name
   <option value = "lastname">last name
   <option value = "email">email
   <option value = "phone">phone
   <option value = "department">department
   </select>
   <input type = "submit" name = "Delete" value = "削除">
</form>
このページを動作させるには、このコメントを削除してください。 --->
STRUCTURE  
構造体、または構造体を含んでいる変数です。この中の要素が削除されます。
KEY  
削除する要素です。
INDICATENOTEXISTING