説明
The GetPathType Lua function returns a string with a name for the path type. This function can be useful when importing objects.
引数
- handle:
The handle should match the object type for which the path type is needed.
- integer (オプション):
The optional integer can be used to specify if the returned string should match the user path type or the system path type. See the example below.
The Enums.PathContentType can be used, or just use 0 for the system path and 1 for the user path.
戻り値
- string:
The returned string is the name of the path type.
例
This example prints the path type name for the first macro object - if it exists:
|
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 |