matthewmaier / platyvue

easily create and share open source hardware documentation
2 stars 1 forks source link

easyJSON Library Won't Load #9

Closed jmwright closed 9 years ago

jmwright commented 9 years ago

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

livecode_plugin_error_2

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
jmwright commented 9 years ago

This seems to be fixed in Linux and Windows with the latest commit.