Problem with revMacFromUnixPath() at OpenStack

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 539
Joined: Sun Dec 18, 2011 7:23 pm
Contact:

Problem with revMacFromUnixPath() at OpenStack

Post by kaveh1000 » Thu Jul 17, 2014 9:22 am

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.
Kaveh

Klaus
Posts: 14213
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Problem with revMacFromUnixPath() at OpenStack

Post by Klaus » Thu Jul 17, 2014 11:39 am

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

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 539
Joined: Sun Dec 18, 2011 7:23 pm
Contact:

Re: Problem with revMacFromUnixPath() at OpenStack

Post by kaveh1000 » Thu Jul 17, 2014 7:25 pm

Excellent, Klaus. I think it worked. :-)
Kaveh

Post Reply