How to tell if a file path is just the path or includes a file name

Paul Dupuis paul at
Wed Oct 10 11:29:52 EDT 2018

Lets say you have a bunch of file paths - some are just paths (all
folders) and some end in a file name (and the file may or may not exist).
How would you test to tell whether a given record is just a path of
folders or contains a file name? Is there any way other than looping
through the path and testing if each "folder" exists?
All, I can come up with is:
function isPath pSomePath
  local tJustAPath = true
  set itemDel to slash
  repeat with i=1 to the number of items in pSomePath
    if there is not a folder (item 1 to i of pSomePath) then
      put false into tJustAPath
      exit repeat
    end if
  end repeat
  return tJustAPath
end isPath

Is there some OS of LiveCode trick I am missing?

More information about the use-livecode mailing list