Re: Plain text library stacks - BOM needed
I’ve found that when LiveCode saves the stack script file, it adds a Byte Order Mark (BOM) to denote the file is UTF-8 encoded. If the BOM is not present when you start using such a library stack, the engine will treat it as being natively encoding. I have found that to be true with both the IDE and Server engines. So if you want to create script only stacks in an external editor make sure that the editor adds a BOM when you save the file. I do wonder, with hindsight, whether this was a mistake and the engine should just assume UTF-8 encoding (unless it encounters a UTF-16 BOM) of script-only text files. Given this is the default of most text editors these days, and the encoding the engine uses when saving script-only's itself it might simplify things slightly. If you write scripts to run with LiveCode Server that start with a shebang line, be aware that they do not work if there is a BOM present. Yes - the shell's processing of #! on Linux (and other platforms) requires #! to be the first two chars of the file. This is why we added the ability to specify the encoding of server script files by adding a comment on the second line of the form: # encoding=utf-8 -- Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/ LiveCode: Everyone can create apps ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Plain text library stacks
Hi bouncing on my present subject which is how to implement a a simple semaphore system to be used by server stacks : could that simple forma t(and I suppose fast to load) be used to store some data along scripts, e.i for a semaphore? -- when loaded in memory, is it parsed and checked? are there errors launched if non script info is found? --I suppose a script can include a set up handler that will instantiate a global variable, or a property? -- and that data in that handler can be edited by an external handler? i found interesting the prospect of having a kind of small independent object that can have some behaviors I mean scripts and some datas, one of the use being for a simple file access semaphore. But there can be other uses i'm sure. -- could a handler in the script have something like write that data into line X of me (i mean of the script file) and save me? Robert -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Fwd-Plain-text-library-stacks-tp4691383p4691608.html Sent from the Revolution - User mailing list archive at Nabble.com. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Plain text library stacks
On 2015-04-23 20:41, Michael Doub wrote: Mark, It appears that when you programmatically create a script only stack and save it. The engine auto inserts the first line: script stackname.I see that when I look at the file with a text editor. When I edit the script of the stack in livecode the script stackname line is missing. Yes - that is correct. The best way to think about script only stacks is that there are an alternative file format which can be used if you only want to keep the stack script. It just so happens that (being text) the file format works quite well for use in things such as git :) Will there be any problems if there are two script stackname statements in the text file. This could occur if the user adds it when in the livecode editor. Yes - you shouldn't do that :) Script only stacks should be used and edited just as you would any other stack - the only difference is that you can use them with VCS very easily (of course, you *can* create and edit them with a text editor if that is your want, but that isn't really what they are designed for). What is the recommended method for determining if a stack is a script only stack? There is no direct way to detect whether a stack is script-only currently beyond seeing if the first word of the on-disk file is script. Mark. -- Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/ LiveCode: Everyone can create apps ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Plain text library stacks
Ah, I see. Thanks. And may I say, your presence on this list, even if only occasional, is much appreciated. -- Peter Peter M. Brigham pmb...@gmail.com http://home.comcast.net/~pmbrig On Apr 24, 2015, at 2:11 PM, Mark Waddingham wrote: 1. No - substacks are part of the parent stackfile when on disk so they only make sense as normally saved (binary) stacks. 2. Yes - script only stacks are stacks. The script only part only pertains to the on disk format which is a text file. Sent from my iPhone On 24 Apr 2015, at 19:06, Peter M. Brigham pmb...@gmail.com wrote: Questions about these script-only stacks: 1. can they be made substacks of another stack? 2. can you do start using stack… with them? -- Peter Peter M. Brigham pmb...@gmail.com http://home.comcast.net/~pmbrig On Apr 24, 2015, at 12:41 PM, Michael Doub wrote: I just updated the MasterLibrary to allow you to create a Script Only Stack and insert functions and commands with just a few clicks. https://www.dropbox.com/s/3wpwn3hfbmpl7sk/MasterLibrary.livecode?dl=0 -= Mike On 4/23/15 2:58 PM, Thierry Douez wrote: Absolutely, that's what Peter was showing in his sample code. Regards, Thierry Thierry Douez - http://sunny-tdz.com Maker of sunnYperl - sunnYmidi - sunnYmage 2015-04-23 20:56 GMT+02:00 Devin Asay devin_a...@byu.edu: I’m curious—can these plain text stacks be used by LC Server just like a regular stack as a library? Devin Devin Asay Office of Digital Humanities Brigham Young University ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Plain text library stacks
1. No - substacks are part of the parent stackfile when on disk so they only make sense as normally saved (binary) stacks. 2. Yes - script only stacks are stacks. The script only part only pertains to the on disk format which is a text file. Sent from my iPhone On 24 Apr 2015, at 19:06, Peter M. Brigham pmb...@gmail.com wrote: Questions about these script-only stacks: 1. can they be made substacks of another stack? 2. can you do start using stack… with them? -- Peter Peter M. Brigham pmb...@gmail.com http://home.comcast.net/~pmbrig On Apr 24, 2015, at 12:41 PM, Michael Doub wrote: I just updated the MasterLibrary to allow you to create a Script Only Stack and insert functions and commands with just a few clicks. https://www.dropbox.com/s/3wpwn3hfbmpl7sk/MasterLibrary.livecode?dl=0 -= Mike On 4/23/15 2:58 PM, Thierry Douez wrote: Absolutely, that's what Peter was showing in his sample code. Regards, Thierry Thierry Douez - http://sunny-tdz.com Maker of sunnYperl - sunnYmidi - sunnYmage 2015-04-23 20:56 GMT+02:00 Devin Asay devin_a...@byu.edu: I’m curious—can these plain text stacks be used by LC Server just like a regular stack as a library? Devin Devin Asay Office of Digital Humanities Brigham Young University ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Plain text library stacks
I just updated the MasterLibrary to allow you to create a Script Only Stack and insert functions and commands with just a few clicks. https://www.dropbox.com/s/3wpwn3hfbmpl7sk/MasterLibrary.livecode?dl=0 -= Mike On 4/23/15 2:58 PM, Thierry Douez wrote: Absolutely, that's what Peter was showing in his sample code. Regards, Thierry Thierry Douez - http://sunny-tdz.com Maker of sunnYperl - sunnYmidi - sunnYmage 2015-04-23 20:56 GMT+02:00 Devin Asay devin_a...@byu.edu: I’m curious—can these plain text stacks be used by LC Server just like a regular stack as a library? Devin Devin Asay Office of Digital Humanities Brigham Young University ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Plain text library stacks
Questions about these script-only stacks: 1. can they be made substacks of another stack? 2. can you do start using stack… with them? -- Peter Peter M. Brigham pmb...@gmail.com http://home.comcast.net/~pmbrig On Apr 24, 2015, at 12:41 PM, Michael Doub wrote: I just updated the MasterLibrary to allow you to create a Script Only Stack and insert functions and commands with just a few clicks. https://www.dropbox.com/s/3wpwn3hfbmpl7sk/MasterLibrary.livecode?dl=0 -= Mike On 4/23/15 2:58 PM, Thierry Douez wrote: Absolutely, that's what Peter was showing in his sample code. Regards, Thierry Thierry Douez - http://sunny-tdz.com Maker of sunnYperl - sunnYmidi - sunnYmage 2015-04-23 20:56 GMT+02:00 Devin Asay devin_a...@byu.edu: I’m curious—can these plain text stacks be used by LC Server just like a regular stack as a library? Devin Devin Asay Office of Digital Humanities Brigham Young University ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Plain text library stacks
So, script stackname must be at the 1st line of the textfile. Ah yes - that is indeed the case - it is quite picky, for two reasons. The first was that the main use-case I had in mind when implementing it was to replace IDE stacks which were only scripts and thus they would be edited in the IDE. The second is that the *only* part of the file which the engine retains when it is loaded is the 'name' on the first line and everything on the second line onwards. If text before the 'script' line were allowed then it is not clear how you might access that when the stack is loaded into memory - it would essentially be invisible information in the internal stack structure that would only appear when the stack is saved again. Mark. -- Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/ LiveCode: Everyone can create apps ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Plain text library stacks
Doesnt' work here with LC 6.7.4 or LC 7.0.4. What exactly isn't working? The feature has actually been in the engine (albeit in nascent form) since around 6.6.4 / 6.6.5 IIRC. I originally hacked it together because of the issues we'd had keeping the core standalone builder stacks for iOS and Android in sync across 6.6 / 6.7 / 7.0 branches. Then Ali and Ben started using it to move IDE critical scripts into text files, and it got refined further (well, various bugs got fixed more than 'refined'). Mark. -- Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/ LiveCode: Everyone can create apps ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Plain text library stacks
Hmm, had a blank 1st line and script stackname as the second one. So, script stackname must be at the 1st line of the textfile. And now it works beautifully :) Regards, Thierry 2015-04-23 16:50 GMT+02:00 Mark Waddingham m...@livecode.com: Doesnt' work here with LC 6.7.4 or LC 7.0.4. What exactly isn't working? Thierry Douez - http://sunny-tdz.com Maker of sunnYperl - sunnYmidi - sunnYmage ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Plain text library stacks
Hi Peter, Which version of LC are you using ? Doesnt' work here with LC 6.7.4 or LC 7.0.4. Thanks, Thierry Thierry Douez - http://sunny-tdz.com Maker of sunnYperl - sunnYmidi - sunnYmage 2015-04-23 15:34 GMT+02:00 Peter W A Wood peterwaw...@gmail.com: Here is a very simple server script and a very simple “text” library script that show just what I was hoping. The Library Script: script TextLib function TL.compare pFirst, pSecond return pFirst = pSecond end TL.compare The Server Script: #!path to livecode #coding:utf-8 set the outputLineEndings to lf” set the outputTextEncoding to “utf8 put the Version return start using stack “path to /TextLib.livecode” dispatch function TL.compare to stack TextLib with a, b” put the result return dispatch function TL.compare to stack TextLib with LiveCode, “LiveCode put the result return I created both scripts in a text editor (using UTF-8 encoding) rather than the IDE. I think it’s great that LiveCode has given us this alternative way of working with script only stacks. Peter On 23 Apr 2015, at 20:47, David Bovill david@viral.academy wrote: Great. I can now refactor all those libraries. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Plain text library stacks
That is something to be aware of. The purpose of a script only stack is to be text on disk... Password protection requires binary output, so in that case you might as well just use a normal stack. Mark Sent from my iPhone On 23 Apr 2015, at 17:49, Peter Haworth p...@lcsql.com wrote: Not sure if this is a problem or not but it appears that any password I set on the stack isn't retained. If I remove the stack from memory and re-open it, the password isn't retained. I guess just something to be aware of rather than a problem. Pete lcSQL Software http://www.lcsql.com Home of lcStackBrowser http://www.lcsql.com/lcstackbrowser.html and SQLiteAdmin http://www.lcsql.com/sqliteadmin.html On Thu, Apr 23, 2015 at 9:26 AM, Mark Waddingham m...@livecode.com wrote: So, script stackname must be at the 1st line of the textfile. Ah yes - that is indeed the case - it is quite picky, for two reasons. The first was that the main use-case I had in mind when implementing it was to replace IDE stacks which were only scripts and thus they would be edited in the IDE. The second is that the *only* part of the file which the engine retains when it is loaded is the 'name' on the first line and everything on the second line onwards. If text before the 'script' line were allowed then it is not clear how you might access that when the stack is loaded into memory - it would essentially be invisible information in the internal stack structure that would only appear when the stack is saved again. Mark. -- Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/ LiveCode: Everyone can create apps ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Plain text library stacks
Mark, It appears that when you programmatically create a script only stack and save it. The engine auto inserts the first line: script stackname.I see that when I look at the file with a text editor. When I edit the script of the stack in livecode the script stackname line is missing. Will there be any problems if there are two script stackname statements in the text file. This could occur if the user adds it when in the livecode editor. What is the recommended method for determining if a stack is a script only stack? Thanks Mike On 4/23/15 1:08 PM, Mark Waddingham wrote: That is something to be aware of. The purpose of a script only stack is to be text on disk... Password protection requires binary output, so in that case you might as well just use a normal stack. Mark Sent from my iPhone On 23 Apr 2015, at 17:49, Peter Haworth p...@lcsql.com wrote: Not sure if this is a problem or not but it appears that any password I set on the stack isn't retained. If I remove the stack from memory and re-open it, the password isn't retained. I guess just something to be aware of rather than a problem. Pete lcSQL Software http://www.lcsql.com Home of lcStackBrowser http://www.lcsql.com/lcstackbrowser.html and SQLiteAdmin http://www.lcsql.com/sqliteadmin.html On Thu, Apr 23, 2015 at 9:26 AM, Mark Waddingham m...@livecode.com wrote: So, script stackname must be at the 1st line of the textfile. Ah yes - that is indeed the case - it is quite picky, for two reasons. The first was that the main use-case I had in mind when implementing it was to replace IDE stacks which were only scripts and thus they would be edited in the IDE. The second is that the *only* part of the file which the engine retains when it is loaded is the 'name' on the first line and everything on the second line onwards. If text before the 'script' line were allowed then it is not clear how you might access that when the stack is loaded into memory - it would essentially be invisible information in the internal stack structure that would only appear when the stack is saved again. Mark. -- Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/ LiveCode: Everyone can create apps ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Plain text library stacks
I’m curious—can these plain text stacks be used by LC Server just like a regular stack as a library? Devin Devin Asay Office of Digital Humanities Brigham Young University ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Plain text library stacks
Absolutely, that's what Peter was showing in his sample code. Regards, Thierry Thierry Douez - http://sunny-tdz.com Maker of sunnYperl - sunnYmidi - sunnYmage 2015-04-23 20:56 GMT+02:00 Devin Asay devin_a...@byu.edu: I’m curious—can these plain text stacks be used by LC Server just like a regular stack as a library? Devin Devin Asay Office of Digital Humanities Brigham Young University ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Plain text library stacks
2015-04-23 18:26 GMT+02:00 Mark Waddingham m...@livecode.com: So, script stackname must be at the 1st line of the textfile. Ah yes - that is indeed the case Thanks Mark for your explanations. In fact, I started by putting some comments in the first lines then dropped them but leaving one blank line more by accident :) I'm really happy to have discovered this feature; I'm already implementing it in some of my workflows including source versioning... Kind regards, Thierry ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Plain text library stacks
Not sure if this is a problem or not but it appears that any password I set on the stack isn't retained. If I remove the stack from memory and re-open it, the password isn't retained. I guess just something to be aware of rather than a problem. Pete lcSQL Software http://www.lcsql.com Home of lcStackBrowser http://www.lcsql.com/lcstackbrowser.html and SQLiteAdmin http://www.lcsql.com/sqliteadmin.html On Thu, Apr 23, 2015 at 9:26 AM, Mark Waddingham m...@livecode.com wrote: So, script stackname must be at the 1st line of the textfile. Ah yes - that is indeed the case - it is quite picky, for two reasons. The first was that the main use-case I had in mind when implementing it was to replace IDE stacks which were only scripts and thus they would be edited in the IDE. The second is that the *only* part of the file which the engine retains when it is loaded is the 'name' on the first line and everything on the second line onwards. If text before the 'script' line were allowed then it is not clear how you might access that when the stack is loaded into memory - it would essentially be invisible information in the internal stack structure that would only appear when the stack is saved again. Mark. -- Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/ LiveCode: Everyone can create apps ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Plain text library stacks
Many thanks, Mark. On 23 Apr 2015, at 15:59, Mark Waddingham m...@livecode.com wrote: On 2015-04-23 07:37, Peter W A Wood wrote: Is it possible to load a Library stack in plan text format from another stack? Yes - although we've not explicitly published details on the feature yet :) However, if you want to play around with it then from the message box try: create script only stack MyLibraryStack Then edit script of stack MyLibraryStack You can save the stack in the normal way but the only thing it will save will be the stack script - the file on disk is just a UTF-8 text file. We've been using this to great effect in the IDE where a good number of libraries and non-UI stacks are now script-only - the motivation being that they work in version control just like a lower-level language source file. In addition with 6.7.5-rc-1 and 7.0.5-rc-1 we've added the ability for the behavior property to reference stacks - this has a nice synergy with script only stacks. (Before anyone asks - there are no plans to extend behaviors to any other object type at the moment, stack references were addable without a file format change hence why its occurred). I should point out that the script-only-stacks are 'caveat scriptor' in the sense that the engine will only ever save the stack script when you save one, it will not warn you if you've put anything else beyond a stack script on the stack (whether it be custom properties or other objects), nor will it stop you from making it have anything beyond a stack script. Warmest Regards, Mark. -- Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/ LiveCode: Everyone can create apps ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Plain text library stacks
Great. I can now refactor all those libraries. On Thu, 23 Apr 2015 at 11:44, Peter W A Wood peterwaw...@gmail.com wrote: Many thanks, Mark. On 23 Apr 2015, at 15:59, Mark Waddingham m...@livecode.com wrote: On 2015-04-23 07:37, Peter W A Wood wrote: Is it possible to load a Library stack in plan text format from another stack? Yes - although we've not explicitly published details on the feature yet :) However, if you want to play around with it then from the message box try: create script only stack MyLibraryStack Then edit script of stack MyLibraryStack You can save the stack in the normal way but the only thing it will save will be the stack script - the file on disk is just a UTF-8 text file. We've been using this to great effect in the IDE where a good number of libraries and non-UI stacks are now script-only - the motivation being that they work in version control just like a lower-level language source file. In addition with 6.7.5-rc-1 and 7.0.5-rc-1 we've added the ability for the behavior property to reference stacks - this has a nice synergy with script only stacks. (Before anyone asks - there are no plans to extend behaviors to any other object type at the moment, stack references were addable without a file format change hence why its occurred). I should point out that the script-only-stacks are 'caveat scriptor' in the sense that the engine will only ever save the stack script when you save one, it will not warn you if you've put anything else beyond a stack script on the stack (whether it be custom properties or other objects), nor will it stop you from making it have anything beyond a stack script. Warmest Regards, Mark. -- Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/ LiveCode: Everyone can create apps ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Plain text library stacks
Here is a very simple server script and a very simple “text” library script that show just what I was hoping. The Library Script: script TextLib function TL.compare pFirst, pSecond return pFirst = pSecond end TL.compare The Server Script: #!path to livecode #coding:utf-8 set the outputLineEndings to lf” set the outputTextEncoding to “utf8 put the Version return start using stack “path to /TextLib.livecode” dispatch function TL.compare to stack TextLib with a, b” put the result return dispatch function TL.compare to stack TextLib with LiveCode, “LiveCode put the result return I created both scripts in a text editor (using UTF-8 encoding) rather than the IDE. I think it’s great that LiveCode has given us this alternative way of working with script only stacks. Peter On 23 Apr 2015, at 20:47, David Bovill david@viral.academy wrote: Great. I can now refactor all those libraries. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Plain text library stacks
Hi Peter, Are you thinking of this: http://forums.livecode.com/viewtopic.php?f=77t=18748p=106514hilit=monte+save+stack#p106514 HTH, Thierry I remember reading a message to the effect that one of the recent releases to the LiveCode engine included an enhancement to load “plain text” library stacks. I searched the forum and clicked relevant threads without being able to find the post that I remember. Is it possible to load a Library stack in plan text format from another stack? Peter ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Plain text library stacks
Hi Thierry Thanks for the suggestion. Actually, I wasn’t thinking of Monte’s lcVCS. As I remember, the post that I saw suggested you could create a library stack in a text editor and then load it into LiveCode. Kind regards Peter On 23 Apr 2015, at 13:45, Thierry Douez th.do...@gmail.com wrote: Hi Peter, Are you thinking of this: http://forums.livecode.com/viewtopic.php?f=77t=18748p=106514hilit=monte+save+stack#p106514 HTH, Thierry I remember reading a message to the effect that one of the recent releases to the LiveCode engine included an enhancement to load “plain text” library stacks. I searched the forum and clicked relevant threads without being able to find the post that I remember. Is it possible to load a Library stack in plan text format from another stack? Peter ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode