Page 1 of 1

Opening a Stack outside a standalone

Posted: Mon Jul 04, 2016 7:16 pm
by maxs
How can I get a standalone to open a stack outside of the standalone?

Max

Re: Opening a Stack outside a standalone

Posted: Mon Jul 04, 2016 7:37 pm
by richmond62
I don't think you can as that would open a path for anyone to rip-off the Livecode Engine
and use it as re-engineered front-end for editing stacks.

Of course your standalone can contain substacks . . .

Re: Opening a Stack outside a standalone

Posted: Mon Jul 04, 2016 7:47 pm
by [-hh]
Exactly as in the IDE, that is:
This works as usual on all platforms that has also an IDE version,
Mac/Windows/Linux/RaspberryPi desktop.

Just save a stack with one button as standalone to test this,
for example:

Code: Select all

on mouseUp
  answer file "Choose stack to open"
  set itemdel to "."
  if last item of it is "livecode"
  then open stack it
end mouseUp
Edit. (Also removed typo.) Of course you can't edit scripts with the standalone.

Re: Opening a Stack outside a standalone

Posted: Mon Jul 04, 2016 7:48 pm
by maxs
I just need a stack outside the engine so I can write into fields and not have it erase when the standalone closes.

Re: Opening a Stack outside a standalone

Posted: Mon Jul 04, 2016 8:11 pm
by [-hh]
Why don't you try?
Close to everything works in LiveCode. Also creating and saving a stack by a standalone.
Example:

--button "SAVE"

Code: Select all

on mouseUp
  ask file "Save stack TEST as ..."
  if it is empty then exit mouseUp
  save stack "TEST" as it
end mouseUp
--button "CREATE"

Code: Select all

on mouseUp
  if there is no stack "TEST" then create stack "TEST"
  go stack "TEST"
  if there is no field "TEST" then create fld "TEST"
  put the internet date into fld "TEST"
end mouseUp
--button "OPEN"

Code: Select all

on mouseUp
  answer file "Open stack TEST"
  if it is empty then exit mouseUp
  set itemdel to "."
  if last item of it is "livecode"
  then open stack it
end mouseUp

Re: Opening a Stack outside a standalone

Posted: Mon Jul 04, 2016 8:21 pm
by maxs
Thank you HH

It really works. Thanks for the alternatives too.

I noticed that my data grids do not work in the stacks I opened with the standalone. I can no longer select lines, get data, or enter data into data grids.

Do you think this is a bug?

Max

Re: Opening a Stack outside a standalone

Posted: Mon Jul 04, 2016 8:38 pm
by [-hh]
Hi Max,

did you "INCLUDE" dataGrid in the standalone settings?

"Search for inclusions" sometimes doesn't find all needed inclusions. If it doesn't work if you include it by selecting in the settings, then please search the forums or use-list, there was a discussion recently about that (I can't remember where because I don't use dataGrid).

Hermann

p.s. You can't edit the script with a standalone but you can
set the script of created objects
and save it with the created stack, for example:

--button "SetSCRIPT"

Code: Select all

on mouseUp
  set script of stack "TEST" to \
        "on openstack; answer "&quote&"Hello. Here I am"&quote &"; end openstack"
end mouseUp

Re: Opening a Stack outside a standalone

Posted: Tue Jul 05, 2016 1:26 am
by maxs
Again thanks.

This is good advise. Max

Re: Opening a Stack outside a standalone

Posted: Tue Jul 05, 2016 5:59 pm
by Klaus
Hi Max,
maxs wrote:I just need a stack outside the engine so I can write into fields and not have it erase when the standalone closes.
please keep in mind that the average user is not allowed to WRITE (= save a stack) in the OS application folder!
I would copy that stack to the users "documents" folder and that's it!

Best

Klaus