/*
* Determines the the location of the module containing the ospace object.
*/
function Assoc GetLocationOfThisOSpace( Dynamic osObj = Undefined )
Assoc retVal
retVal.ok = false
retVal.ErrMsg = Undefined
retVal.Path = Undefined
retVal.File = Undefined
String osName
String ollPath
String ospaceDir
String moduleDir
File moduleFile
if (IsUndefined(osObj))
retVal.ErrMsg = "Undefined OSpace object passed to GetLocationOfModule"
else
ollPath = OS.FileSpec( osObj )
ospaceDir = File.GetPath( ollPath )
moduleDir = File.GetPath( ospaceDir )
moduleFile = File.StringToFile(moduleDir)
retVal.Path = moduleDir
retVal.File = moduleFile
retVal.ok = true
end
if (!retVal.ok)
if (IsUndefined(retVal.ErrMsg))
retVal.ErrMsg = Str.Format("Unable to determine path to the specified OSpace object. %s", osObj)
end
end
return retVal
end
Comments