Scripting Style - Backscript or start using

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Simon Knight
Posts: 854
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Scripting Style - Backscript or start using

Post by Simon Knight » Sat Mar 04, 2017 9:47 am

Hi,
I am in the process of refactoring one of my projects and wish to reduce the number of handlers in my main stack to aid clarity.

A number of handlers deal with a single aspect (report generation) so I have moved these to a new sub-stack. I have use a start using mysubstack command in the main stack to enable the use of the handlers in the sub-script and all is well.

However, I wonder if I should consider other methods such as putting the scripts into the backscript. What are the advantages/disadvantages of each method? What do you favour?

Skids
best wishes
Skids

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Scripting Style - Backscript or start using

Post by jmburnod » Sat Mar 04, 2017 10:30 am

Hi Simon,
I have experimented the inverse.
Mainstack contains handlers which uses by substacks or stacks.
I choose this way to allows adding stacks from a server.

Advantage
Modular approach and flexibility

Disadvantages
Prohibited for AppleStore (we can't dowload code and Apple consider stacks as code)

Best regards
Jean-Marc
https://alternatic.ch

Ledigimate
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 132
Joined: Mon Jan 14, 2013 3:37 pm

Re: Scripting Style - Backscript or start using

Post by Ledigimate » Sat Mar 04, 2017 10:49 am

Hmm... thanks J-M, I was planning to make my app update itself by downloading stacks from a server. You've just saved me a lot of future frustration. But it does make sense, though. Apple cannot approve apps which can add unapproved features to itself.
010100000110010101100001011000110110010100111101010011000110111101110110011001010010101101010100011100100111010101110100011010000010101101001010011101010111001101110100011010010110001101100101

Simon Knight
Posts: 854
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Re: Scripting Style - Backscript or start using

Post by Simon Knight » Sat Mar 04, 2017 4:06 pm

Also thanks J-M,

I had not thought of arranging code that way but I can see that it has its uses as long as the app is not going on the Apple App store.

Simon
best wishes
Skids

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 755
Joined: Fri Jun 27, 2008 9:00 pm

Re: Scripting Style - Backscript or start using

Post by Mikey » Sat Mar 04, 2017 5:48 pm

This is not completely true. There are plenty of apps that download updates remotely. The first one that comes to mind is one that I play all the time, plants vs. zombies.

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Scripting Style - Backscript or start using

Post by jmburnod » Sun Mar 05, 2017 2:29 am

Hi Mickey,
There are plenty of apps that download updates remotely
Yes, You're right for update app but not for import stacks
Jean-Marc
https://alternatic.ch

Post Reply

Return to “Talking LiveCode”