Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.Opens in a new tab

For information on migrating to InterSystems IRISOpens in a new tab, see Why Migrate to InterSystems IRIS?

その他のリスト関数

リストの操作に使用できるその他の関数:

  • ListValid は、文字列がリストかどうか判断します。

  • ListFromString は、区切り文字列から生成されたリストを返します。

  • ListToString は、リストから生成された区切り文字列を返します。

  • ListSame は、2 つのリストの各項目を比較し、同一の場合は 1 を、それ以外の場合は 0 を返します。

  • ListNext は、1 つのリスト項目を次の項目に順次進めます。

Note:

ListNext 関数は、その 2 番目と 3 番目の引数値を変更します。

addr = "One Memorial Drive" : city = "Cambridge" : st = "MA" : zip = "02142"
Pmail = addr & "^" & city & "^" & st & "^" & zip
Lmail = listfromstring(Pmail, "^")
println "Lmail is a valid list: ", listvalid(Lmail)
println "Pmail is not a valid list: ", listvalid(Pmail)
println "City is in position #2: ", list(Lmail, 2)
println "There are 4 items in the list: ", listlength(Lmail)
println "MA is in position: ", listfind(Lmail, "MA")
Pmail = listtostring(Lmail,"*")
println Pmail
Lmail2 = listbuild("One Memorial Drive","Cambridge","MA","02141")
println "Lmail and Lmail2 are not the same list: ", listsame(Lmail, Lmail2)
p = 0 : while listnext(Lmail, p, value) : println value : wend
FeedbackOpens in a new tab