Page 1 of 1

Problem with revMacFromUnixPath() at OpenStack

Posted: Thu Jul 17, 2014 9:22 am
by kaveh1000
I have a stack that has been working fine but I have made some changes and now there is a problem. It is a stack running in LiveCode 6.5.0 on mac, and not a stand-alone.

On OpenStack I need to set some paths. I have the following script:

put revMacFromUnixPath(the_full_path) into mac_path

the variables the_full_path and mac_path are both defined. The error I get on opening the stack is:

Function: error in function handler
Object [...]
Line put revMacFromUnixPath(the_full_path) into mac_path
Hint revMacFromUnixPath

If I comment out the command, open the stack, then run the command in msg box, it works fine.

I note from google pages (not allowed to post links here) that there is an issue in standalones, namely that this function may not be available before start-up of App is completed. So this might be related. I have tried to put it as late as possible in OpenStack, but still not working.

Any hints appreciated.

Re: Problem with revMacFromUnixPath() at OpenStack

Posted: Thu Jul 17, 2014 11:39 am
by Klaus
Hi kaveh1000,

yep, the problem is the way Livecode loads externals and its own libraries!
The are NOT YET loaded on "pre-/openstack" so you need to give LC a bit time to load them like this:

Code: Select all

on openstack
  send "fill_mac_pathnames" to me in 100 millisecs
  ## ...
end openstack

command fill_mac_pathnames
   put revMacFromUnixPath(the_full_path) into mac_path
   ## etc...
end fill_mac_pathnames
Know what I mean?
This way the libs have time to load and all will work out fine!


Best

Klaus

Re: Problem with revMacFromUnixPath() at OpenStack

Posted: Thu Jul 17, 2014 7:25 pm
by kaveh1000
Excellent, Klaus. I think it worked. :-)