Scripting Style - Backscript or start using
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 854
- Joined: Wed Nov 04, 2009 11:41 am
- Location: Gunthorpe, North Lincs, UK
Scripting Style - Backscript or start using
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
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
Skids
-
- 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
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
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
-
- Livecode Opensource Backer
- Posts: 132
- Joined: Mon Jan 14, 2013 3:37 pm
Re: Scripting Style - Backscript or start using
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
-
- Posts: 854
- Joined: Wed Nov 04, 2009 11:41 am
- Location: Gunthorpe, North Lincs, UK
Re: Scripting Style - Backscript or start using
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
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
Skids
Re: Scripting Style - Backscript or start using
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.
-
- 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
Hi Mickey,
Jean-Marc
Yes, You're right for update app but not for import stacksThere are plenty of apps that download updates remotely
Jean-Marc
https://alternatic.ch