I'm stuck in an airport, so I thought I'd poke around a little bit on this. I added the following code and ended up with the dialog box in the screenshot.
put "/easyJSON.livecode" into myFile
if not (there is a file myFile) then
beep
answer error "Can't find file" & cr & myFile
end if
It's possible to prepend path info, like is done in the following snippet.
put revEnvironmentUserPluginsPath() & "/MyLib.livecode" into myFile
The following code is messy, but this works for me and loads the easyJSON library. I have no idea if it will work in Windows though. I'm guessing not with the forward slash in the string.
if "easyJSON" is not among the lines of the StacksInUse then
if the environment = "development" then
put the effective filename of this stack into myFile
set the itemDelimiter to slash
delete last item of myFile
put myFile & "/easyJSON.livecode" into myFile
if not (there is a file myFile) then
beep
answer error "Can't find file" & cr & myFile
end if
-- start using stack "../lib/easyJSON.livecode"
--start using stack "/easyJSON.livecode"
start using stack myFile
else
start using stack "easyJSON.livecode"
end if
end if
I'm stuck in an airport, so I thought I'd poke around a little bit on this. I added the following code and ended up with the dialog box in the screenshot.
It's possible to prepend path info, like is done in the following snippet.
The following code is messy, but this works for me and loads the easyJSON library. I have no idea if it will work in Windows though. I'm guessing not with the forward slash in the string.