Getting the stack name

J. Landman Gay jacque at hyperactivesw.com
Fri May 12 15:21:07 EDT 2006


Devin Asay wrote:
 >
 > On May 12, 2006, at 12:49 PM, J. Landman Gay wrote:
 >
 >> Devin Asay wrote:
 >>> We know that stackfile names (the .rev file name) and stack names are
 >>> not always the same. Given the stackfile name, and after opening the
 >>> stackfile with a go stack command, is there a reliable way to get the
 >>> short name of the main stack? Is the name of a newly opened stack
 >>> ALWAYS on the first line of the result of the openstacks function?
 >>
 >> Yes, I think so. But I haven't ever done a specific test for it.
 >>
 >>> What I really want is 'get the short name of the mainstack of
 >>> stackfile "/my/stack/path/stack.rev"'.
 >>> Is there something obvious I'm overlooking?
 >>
 >> You can refer to a stack by either its name or its filename, so it is
 >> legal to say:
 >>
 >>  get the short name of stack "/my/stack/path/stack.rev"
 >
 > Ah, but the trick is I am trying to get the short name of a stack on a
 > remote server, and this doesn't work:
 >
 >   get the short name of stack "http:/myserver.com/path/stack.rev"
 >
 > I've been looking at the revLoadedStacks(application) function. It looks
 > like it may do what I need. This form excludes IDE stacks, and as far as
 > I can tell, each newly opened stack gets added to the end of the list of
 > results. Anyone know if this is always consistent?

I've never used it, so can't say. But it occurs to me that if you have 
just done a "go stack x" command, then stack x is always going to be 
"this stack", right? So:

   go stack <remote file path>
   get the short name of this stack

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list