ドットシンタックス(dot syntax)

●プロパティへのアクセス
旧:the loc of sprite 5
新:sprite(5).loc
旧:the text of member "data"
新:member("data").text
旧:the fileName of window "nav"
新:window ("nav").fileName
旧:the spriteNum of me
新:me.spriteNum
旧:put getaProp(myList, #z)
新:put myList.z
旧:setaProp(myList, #z, 99)
新:myList.z = 99

●座標へのアクセス
旧:the locH of P
新:P.locH
旧:the locV of P
新:P.locV

点の水平座標
P = point(10,20)
put P.locH
-- 10

rectの座標にアクセスできます。
旧:the left of R
新:R.left
旧:the top of R
新:R.top
旧:the right of R
新:R.right
旧:the bottom of R
新:R.bottom

領域の右下の水平座標
R = rect(10, 20, 300, 400)
put R.right
-- 300

ベクターシェイプの頂点の2つハンドルの座標にアクセスできます。
ベクターシェイプの頂点1のハンドルの座標
put member("vShape").vertex[1].handle1
-- point(18.8687, -31.4479)
put member("vShape").vertex[1].handle2
-- point(-21.0000, 35.0000)

●データタイプの変換
数値を整数やストリングなどに変換する
foo = 123.45
put foo.integer
-- 123
put foo.float
-- 123.4500
put foo.string
-- "123.45"
put foo.string.symbol
-- "#123.45"
put foo.string.value
-- 123.4500
put foo.list
-- [123.45]

フィールドまたはテキストのデータを値に変換する
put (member "data").text.value

テキストをASCIIコードに変換する
bar = "a"
put bar.charToNum
-- 97
bar= 97
put bar.numToChar
-- "a"

テキストをURLコードに変換する
data = "あいう"
put data.urlEncode
-- "%82%a0%82%a2%82%a4"

●カウント
旧:the number of chars in textdata
新:textdata.chars.count
 :textdata.char.count
旧:the number of words in textdata
新:textdata.words.count
 :textdata.word.count
旧:the number of lines in textdata
新:textdata.lines.count
 :textdata.line.count
 :textdata.paragraph.count
旧:the number of items in textdata
新:textdata.items.count
 :textdata.item.count
旧:cout(myList)
新:mylist.count
新:member("vshape").vertex.count

注意:countプロパティ
プロパティリストでユーザーが#countプロパティを使用した場合、
list.countの書式では値の個数ではなく#countプロパティの値を返します。
値の個数を得たい場合には、list.count()またはcount(list)の書式を使う必要があります。

propList = [#model:603, #size:256]
put propList.count 
-- 2    ---> 値の個数
propList = [#model:603, #count:5]
put propList.count 
-- 5    ---> #countの値
put propList.count()
-- 2    ---> 値の個数
put count(propList)
-- 2    ---> 値の個数

●ハンドラへのアクセス
スプライト3にメッセージを送る
旧:sendSprite(3, #msg, 55)
新:sprite(3).msg(55)

インスタンスにメッセージを送る
旧:msg(me)
新:me.msg()
旧:msg(obj, 99)
新:obj.msg(99)

ウインドウオブジェクトにメッセージを送る
旧:open window "nav"
新:window("nav").open()
旧:forget window "kaiten"
新:window("kaiten").forget()

Text copyright 1999.5 Yoshiyuki Oshige.
yo@oshige.com