Program Executable Location

Richard Gaskin ambassador at fourthworld.com
Thu Feb 6 13:06:01 EST 2003


Ken Ray wrote:

> Actually, it's even easier guys... in a standalone, "the directory" points
> to the folder where the standalone is automatically. When you're developing
> in Rev, though, "the directory" points to the location of the Revolution
> application.

This requires that you keep all of your non-standalone files in your Rev
folder, but I prefer to keep each app in its own work folder separate from
the application and other work files.

The handler below returns the path to the stackfile calling it, and accounts
for yet another screwy weirdness of OS X (in this case, the Mach-0 bundle
structure unique to OS X):


function AppPath
  put the filename of this stack into tPath
  set the itemdel to "/"
  If (IsOSX()) then
    get offset(".app/Contents/MacOS/", tPath)
    if it > 0 then -- 2.4.3 or later
      delete char it to len(tPath) of tPath
    end if
  end if
  delete last item of tPath
  return tPath &"/"
end AppPath

function IsOSX
  if the platform is not "MacOS" then return false
  get the systemversion
  set the itemdel to "."
  if item 1 of it >= 10 then return true
  return false
end IsOSX



-- 
 Richard Gaskin 
 Fourth World Media Corporation
 Developer of WebMerge 2.2: Publish any database on any site
 ___________________________________________________________
 Ambassador at FourthWorld.com       http://www.FourthWorld.com
 Tel: 323-225-3717                       AIM: FourthWorldInc




More information about the use-livecode mailing list