説明
The GetPathOverrideFor Lua function delivers a string with the path of a grandMA3 folder.
The function is relevant when the path should be on a removable drive connected to a console.
引数
- string:
A text string with the folder name.
- String:
The base path in a string format.
- boolean(optional with string):
If this boolean is true, then the folder at the path is created if it does not exist.
- OR -
- integer:
An integer identifying an index in the "Enum.PathType" table.
- String:
The base path in a string format.
- Boolean:
If this boolean is true, then the folder at the path is created if it does not exist.
戻り値
- string:
The returned string is the first found full path related to the provided argument.
例
This example prints the override path of the macro folder on the system monitor.
It should be run on a console with a removable drive connected.
|
return function () local myBasePath = nil for _, value in ipairs(Root().Temp.DriveCollect) do local driveType = value.drivetype if driveType == "Removeable" then myBasePath = value.path break end end if myBasePath == nil then ErrPrintf("No removeable drive could be found. Please insert one and try again") return end
local myPathType = Enums.PathType.UserMacros
local myOverridePath = GetPathOverrideFor(myPathType, myBasePath) Printf("The path is: " .. myOverridePath) end |