説明
GetPathType 関数は、パスタイプの名前を含む文字列を返します。この関数は、オブジェクトをインポートするときに役立ちます。
引数
- handle:
ハンドルは、パスタイプが必要なオブジェクト・タイプと一致する必要があります。
- integer (オプション):
オプションの整数を用いて、返される文字列が User または System パスタイプと一致するかを指定できます(以下の例を参照)。
Enums.PathContentType を用いるか、System パスの場合は 0、User パスの場合は 1 を用います。
戻り値
例
この例では、最初のマクロ・オブジェクトのパスタイプ名(存在する場合)を出力します。
|
return function () local myMacro = DataPool().Macros[1] if myMacro == nil then ErrPrintf("An error occurred, possibly because the first macro does not exist.") ErrPrintf("Please create one and try again.") return end local myPathTypeNameUser = GetPathType(myMacro, Enums.PathContentType.User) if myPathTypeNameUser ~= nil then Printf("The user name of the path type is: " .. myPathTypeNameUser) else ErrPrintf("There was an error getting the path type.") end
local myPathTypeNameSystem = GetPathType(myMacro, Enums.PathContentType.System) if myPathTypeNameSystem ~= nil then Printf("The system name of the path type is: " .. myPathTypeNameSystem) else ErrPrintf("There was an error getting the path type.") end end |