| grandMA3 ユーザマニュアル » プラグイン » Lua 関数 - Object-Free API » IsObjectValid(handle) | Version 2.2 |
IsObjectValid 関数は、指定された引数が有効なオブジェクトかどうかに応じて、ブール値の true または nil を返します。
"Root()" が有効なオブジェクトかどうかを調べて、その結果を出力します。
Lua |
return function() --Create a variable with the possible object local myObject = Root() --Check if it is an object local myReturn = IsObjectValid(myObject) --Print the result if myReturn == nil then ErrPrintf("It is not a valid object") else Printf("It is an object") end end |