Invalid list index 2
は、index 2
が定義されていないことを意味しています。 index 2
がColdFusionで定義されているかどうかを確認するにはどうすればよいですか?無効なリストのインデックス2
<cfif
ListGetAt('/pages.cfm/about-us/' 1 , "/") eq 'news' AND
ListGetAt('/pages.cfm/about-us/', 2 , "/") eq 'press' AND
ListGetAt('/pages.cfm/about-us/', 3 , "/") eq '2016'AND
ListGetAt('/pages.cfm/about-us/', 4 , "/") neq ''>
<cfoutput>It Works!</cfoutput>
</cfif>
存在しない場合は空の文字列を返す 'getToken()'を使うことができます –