Opening a Stack outside a standalone

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
maxs
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 421
Joined: Sat Jun 24, 2006 12:02 am
Contact:

Opening a Stack outside a standalone

Post by maxs » Mon Jul 04, 2016 7:16 pm

How can I get a standalone to open a stack outside of the standalone?

Max

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Opening a Stack outside a standalone

Post by richmond62 » Mon Jul 04, 2016 7:37 pm

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

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: Opening a Stack outside a standalone

Post by [-hh] » Mon Jul 04, 2016 7:47 pm

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.
Last edited by [-hh] on Mon Jul 04, 2016 8:45 pm, edited 2 times in total.
shiftLock happens

maxs
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 421
Joined: Sat Jun 24, 2006 12:02 am
Contact:

Re: Opening a Stack outside a standalone

Post by maxs » Mon Jul 04, 2016 7:48 pm

I just need a stack outside the engine so I can write into fields and not have it erase when the standalone closes.

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: Opening a Stack outside a standalone

Post by [-hh] » Mon Jul 04, 2016 8:11 pm

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
Last edited by [-hh] on Mon Jul 04, 2016 8:22 pm, edited 1 time in total.
shiftLock happens

maxs
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 421
Joined: Sat Jun 24, 2006 12:02 am
Contact:

Re: Opening a Stack outside a standalone

Post by maxs » Mon Jul 04, 2016 8:21 pm

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

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: Opening a Stack outside a standalone

Post by [-hh] » Mon Jul 04, 2016 8:38 pm

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
shiftLock happens

maxs
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 421
Joined: Sat Jun 24, 2006 12:02 am
Contact:

Re: Opening a Stack outside a standalone

Post by maxs » Tue Jul 05, 2016 1:26 am

Again thanks.

This is good advise. Max

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

Re: Opening a Stack outside a standalone

Post by Klaus » Tue Jul 05, 2016 5:59 pm

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

Post Reply