Further Unicode ...
And now for my next trick :( Suppose I have a fld called fCOOKED that contains 'numToChar(104)', and a second fld called fT and a button with this script: on mouseUp set the useUnicode to true put fld fCOOKED into COOKED set the unicodeText of fld fT to COOKED end mouseUp why doesn't fld 'fT end up with an 'h' in it instead of a large number of goobledegook numbers? Richmond. ___ 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: Further Unicode ...
Hi Richmond, The useUnicode property has nothing to to with transferring unicodeText from one field to another. The useUnicode property affects the charToNum and numToChar function *only* and as you have already noticed it doesn't do a very good job on higher-level unicode values. That's why I rarely use useUnicode and use binaryEncode/binaryDecode in a repeat loop most of the time. To transfer the unicodeText, you need to do this: on mouseUp put the unicodeText of fld fCOOKED into COOKED set the unicodeText of fld fT to COOKED end mouseUp This is pretty obvious, as the useUnicode property doesn't magically convert the value of COOKED from plain text to unicodeText. Changing data in a variable always takes at least another line, e.g. put uniEncode(COOKED) into COOKED, but that's taken care of by using the unicodeText property directly. -- Best regards, Mark Schonewille Economy-x-Talk Consulting and Software Engineering Homepage: http://economy-x-talk.com Twitter: http://twitter.com/xtalkprogrammer KvK: 50277553 Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other colour spaces. http://www.color-converter.com We have time for new software development projects. Contact me for a quote. On 30 dec 2012, at 11:51, Richmond wrote: And now for my next trick :( Suppose I have a fld called fCOOKED that contains 'numToChar(104)', and a second fld called fT and a button with this script: on mouseUp set the useUnicode to true put fld fCOOKED into COOKED set the unicodeText of fld fT to COOKED end mouseUp why doesn't fld 'fT end up with an 'h' in it instead of a large number of goobledegook numbers? Richmond. ___ 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: Further Unicode ...
On 12/30/2012 01:09 PM, Mark Schonewille wrote: Hi Richmond, The useUnicode property has nothing to to with transferring unicodeText from one field to another. The useUnicode property affects the charToNum and numToChar function *only* and as you have already noticed it doesn't do a very good job on higher-level unicode values. That's why I rarely use useUnicode and use binaryEncode/binaryDecode in a repeat loop most of the time. To transfer the unicodeText, you need to do this: on mouseUp put the unicodeText of fld fCOOKED into COOKED set the unicodeText of fld fT to COOKED end mouseUp This is pretty obvious, as the useUnicode property doesn't magically convert the value of COOKED from plain text to unicodeText. Changing data in a variable always takes at least another line, e.g. put uniEncode(COOKED) into COOKED, but that's taken care of by using the unicodeText property directly. -- Best regards, Mark Schonewille Yes, I know, and I have only one REAL problem: my gut reaction whenever I get stuck is to whack a message off to the Use-List BEFORE rather than AFTER going for a walk round the flat, having a cuddle with the cat, playing with toys on the kitchen table, or whatever is necessary to get my head round something. Richmond. ___ 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: Further Unicode ...
Try one of this: on mouseUp set unicodeText of fld fT to unicodeText of fld fCOOKED end mouseUp or on mouseUp put unicodeText of fld fCOOKED into COOKED put unicode COOKED into fld fT end mouseUp on mouseUp put unicodeText of fld fCOOKED into COOKED set unicodeText of fld fT to COOKED end mouseUp For me any of above is working with ACII single letters as well with Unicode strings. Marek ___ 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: Help with Regex (was Re: Switch, Case and wild-cards?)
Richmond wrote: Maybe I'm missing something (nothing particularly unusual there), but . . . I don't really get REGEX. And,frankly, why on earth would I, or anyone else for that matter, want to read through some awfully long, wordy and obscure load of b*mf about it? There's nothing regular about regular expressions, and like so many things in computing they seem to have come about through a series of evolutionary steps which may well be characterized as accidents. But it's the cryptic nature of regex that makes it so useful, providing a uniquely compact way of handling a vast range of text parsing in ways that would take many dozens of lines of code to do by any other means. So whether we like regex or not, it's here to stay, useful and ubiquitous enough to be worth the learning curve. That said, being a very generalized subsystem it's often not the fastest in execution speed in spite of being fast to type. In many cases, writing a pull-parser or other offset-based function for a specific need will yield a much faster result than using regex. The downside of not using regex, though, is the time required to write such functions every time you need 'em. For performance-critical operations it's often well worth it, but for less critical routines regex may be the more productive option. -- Richard Gaskin Fourth World LiveCode training and consulting: http://www.fourthworld.com Webzine for LiveCode developers: http://www.LiveCodeJournal.com Follow me on Twitter: http://twitter.com/FourthWorldSys ___ 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: What's On The Menu?
Peter Haworth wrote: The pulldown menu works fine, just wonder why the menuHistory part of it doesn't work the same as an option menu. This is probably related to their different purposes: with an option menu it's important to have the current selection centered over the control, so the menuHistory provides the means to accomplish that. Pull-down menus are fixed, with their items always appearing below the control, so menuHistory has no logical corollary in that context. -- Richard Gaskin Fourth World LiveCode training and consulting: http://www.fourthworld.com Webzine for LiveCode developers: http://www.LiveCodeJournal.com Follow me on Twitter: http://twitter.com/FourthWorldSys ___ 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
Help with Regex (was Re: Switch, Case and wild-cards?)
On Sunday, December 30, 2012, Richmond wrote: starts off by describing the blindingly obvious, and then tries to dress the whole thing up in a load of jargon so some fancy academic can draw a fat salary for understanding the blindingly obvious, and/or being capable of thinking in a straight line . . . but, hey, that seems to be a universal problem. if academics drew fat salaries, I would still be one. I'm practicing law again for the simple reason I need to make enough to send my own kids to school . . . but anyway . . . I have a line of text in some funny language that goes like this; 1aQngh1swnpQavh now there are the following considerations I have to deal with: 1. Every time I encounter a '1' it has to be shunted after the char it precedes. 2. Every time I encounter a 'Q' it has to be shunted before a char it comes after. 3. 1aQ (this is what is known as the squirrel in the wood-pile (and I'm sorry if I have offended any squirrels). Now a hierarchy of pattern recognition means I have to trap '1aQ' before I trap '1' and 'Q', because if I do things the other way round everything is going to be stewed squirrel to coin a phrase. s/1\(.\)Q/magic_string_2\1magic_sting_1/g s/1\(.\)/\11/g s/\(.\)Q/1Q/g s/magic_string_1/1/g s/magic_string_2/Q/g There's probably a syntax error or three in that (I don't need them very often any more), and I suspect it can do it in one line, but I don't remember conditionals. The magic strings are just any string that would never occur; I usually use ZZZ and GGG. -- Richard E. Hawkins, Esq. (702) 508-8462 ___ 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: Dockable Panes
Dockable panes are a deep subject. I have a need for them in an upgrade on the horizon for one of the projects I manage, and thus far my explorations have been challenging at best. One of those challenges is deciding how to handle the empty space left over from a removed pane. Should it be split equally among neighboring panes, or is one of those panes more important so that it should fill that space? In the app I'm working one there are some circumstances where each option may be best, but for usability I should probably pick one and use it consistently. Another challenge is providing feedback to the user during the drag. In some systems the panes update in real time during the drag, but with a good many complex groups this can be too intensive to do in LiveCode. So at the moment I'm exploring proxies, outlines to indicate how the panes will be resized as the drag happens. But even that is not without its challenges, since outlines alone don't always adequately communicate which pane is being indicated. Then there's the question of how a given pane should be split when another is dropped into it. Near the edges the decision is usually clear, but if you drop toward the center it's not always straightforward to decide whether to split horizontally or vertically. At the moment I'm considering abandoning truly dockable panes altogether in favor of a set of preset pane layouts the user can select from a gallery. This is MUCH easier to code, and simpler for the user to be able to anticipate how it works. I'll probably get back to experimenting with dockable panes later on, and the whole thing is interesting enough to me that I wouldn't mind if you want to continue this discussion via email or phone. Drop me a note if you do. Who knows, we may be able to come up with an affordable method for this which lends itself to a generalized framework that can be used in a wide range of apps. PS: If you haven't seen Pencil it's quite inspiring for dockable panes: http://www.pencil-animation.org/ That app has one advantage mine doesn't, though: it maintains one main pane in the center, so the docking decisions are limited to what happens at the edges. Still, it's one of the smoothest configurable pane implementations I've seen, very enjoyable to play with. -- Richard Gaskin Fourth World LiveCode training and consulting: http://www.fourthworld.com Webzine for LiveCode developers: http://www.LiveCodeJournal.com Follow me on Twitter: http://twitter.com/FourthWorldSys ___ 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: What's On The Menu?
Bob- Yes, I was trying to make other suggestions rather than get into this argument, but I agree completely. I think it's time for a new control paradigm in place of cascading menus, or maybe in place of menus altogether, but I'm having trouble visualizing what that might be. -- -Mark Wieder mwie...@ahsoftware.net ___ 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: Help with Regex (was Re: Switch, Case and wild-cards?)
Peter- Saturday, December 29, 2012, 11:25:09 PM, you wrote: In this book I'm going to subversively teach you parsing, but I'm going to be very practical and straight forward about it. No NFA to DFA conversion. Actually, I think NFA/DFA conversion is where regex gets really interesting, but it's seriously arcane and mind-bogglingly difficult to unravel. -- -Mark Wieder mwie...@ahsoftware.net ___ 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: Help with Regex (was Re: Switch, Case and wild-cards?)
I ran into a similar problem doing search and replace in word to clean up text from some data system destined for excel. My solution was often to replace a character or string I wanted to preserve with a placeholder, replace or remove what remains, then restore my placeholders with the original values. In situations like this, work with bigger strings first, and sometimes you need to work it end to beginning, especially if you are using a word or character counter to keep track of where you are. Bob Sneidar IT Manager Calvary Chapel CM Sent from iPhone On Dec 30, 2012, at 2:23, Richmond richmondmathew...@gmail.com wrote: Those of you who don't want to feel faintly queasy had better tune out now. Theoretical / Pedagogical rant follows. Maybe I'm missing something (nothing particularly unusual there), but . . . I don't really get REGEX. And,frankly, why on earth would I, or anyone else for that matter, want to read through some awfully long, wordy and obscure load of b*mf about it? -- And the Wikipedia article: http://en.wikipedia.org/wiki/Regex starts off by describing the blindingly obvious, and then tries to dress the whole thing up in a load of jargon so some fancy academic can draw a fat salary for understanding the blindingly obvious, and/or being capable of thinking in a straight line . . . but, hey, that seems to be a universal problem. -- What I do understand is that one needs a script(s) that looks for patterns in a string and replaces them with other patterns, and that there needs to be a hierarchy of patterns. Consider my problem (apart from all the other ones, that is): I have a line of text in some funny language that goes like this; 1aQngh1swnpQavh now there are the following considerations I have to deal with: 1. Every time I encounter a '1' it has to be shunted after the char it precedes. 2. Every time I encounter a 'Q' it has to be shunted before a char it comes after. 3. 1aQ (this is what is known as the squirrel in the wood-pile (and I'm sorry if I have offended any squirrels). Now a hierarchy of pattern recognition means I have to trap '1aQ' before I trap '1' and 'Q', because if I do things the other way round everything is going to be stewed squirrel to coin a phrase. Obviously there is the possibility that one might have to trap for '1*Q', where '*' may be anything, and that adds a certain frisson to the whole thing. Now, where I come from, that is not called REGEX, that is called either 'logic' or 'getting things done in the right order'. -- So, I sat down at my kitchen table with a pile of chess pieces (I have about 5 identical sets lying around) and lined them up in an order rather like '1aQngh1swnpQavh' and then, with some more as 'my second text field' tried switching the things around - and after about 10 minutes everything made reasonably good sense. And, as most programming seems to consist of getting things in the right order (or, as a friend of mine once remarked getting things in the right ordure) that is about all there is to things. -- Now you might be quite accurate in describing me as: 1. Child-like. 2. Not very good at abstract thought. But when one considers that about 95% of people are pretty much like that, then maybe chess pieces on the kitchen table, and/or plastic cups with beans, are not a bad way to go. Richmond. ___ 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: Help with Regex (was Re: Switch, Case and wild-cards?)
On 12/30/2012 10:08 PM, Robert Sneidar wrote: I ran into a similar problem doing search and replace in word to clean up text from some data system destined for excel. My solution was often to replace a character or string I wanted to preserve with a placeholder, replace or remove what remains, then restore my placeholders with the original values. In situations like this, work with bigger strings first, and sometimes you need to work it end to beginning, especially if you are using a word or character counter to keep track of where you are. Bob Sneidar IT Manager Calvary Chapel CM Sent from iPhone Well, I am doing perfectly alright with the pattern searching routine I worked out with Unicode; as long as one works out which pattern to search for first, second and so forth everything is comparatively straightforward. This does not involve placeholders, nor anything else as bizarre. Here's a text: | abcdGfEhijGkElmnopGqrstuEvwxfyz | and I know that I have to move 'E' forwards to before the letter that precedes it, I know that I have to move 'G' to after the letter it follows, and, I know that I have to replace 'f' with ''. Now as 'G' and 'E' sometimes occur as 'doublets', vis 'GkE' I know that they have to swap before worrying about single instances of either 'G' or 'E', and that, as 'f' sometimes occurs in relation to either 'G' or 'E', or both of them, I have to replace 'f' with '' after the other operations, otherwise they won't work. So: 1. swap 'G' and 'E' when they surround one character. 2. move 'E' forwards by 1 when it occurs in isolation, and make sure that precludes those 'E' chars that have already been swapped by rule #1. 3. Ditto for 'G'. 4. replace every instance of 'a' by ''. One of the ways of avoiding falling over the results of rule #1 while implementing #2 and #3 is to encode 'G' and 'E' in rule #1 as different symbols, say '%' and '@' after processing so that rules #2 and #3 don't pick them up (one can always have some rules #5 and #6 to replace '%' and '@' with 'G' and 'E' after running through rules #2, #3 and #4). Now the fun of the whole thing is that I have to do that sort of thing with texts that contain about 20 patterns of the swap X with Y type. Having worked out a way to do this in 2010 (and then being fairly stupid and forgetting the whole thing) with Unicode putting the whole thing into practise has nothing at all to do with the strengths or short-comings of Livecode, but the limitations of the human mind to get itself wrapped around the underlying logic needed to work out the correct sequence of transformations. Richmond. ___ 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: Dockable Panes
Dick, Take a look at Codejocks ActiveX control: http://www.codejock.com/products/dockingpane/tour_3.asp?platform=com http://www.codejock.com/products/dockingpane/tour_3.asp?platform=com This web page shows an animation of the panes being moved and relocated into another position. This is what I'm talking about when a pane is moved. Notice the handle icons that are made visible when dragging begins. It's a placement icon to show where the pane can be dropped, and it previews the place of the pane with a transparent pane when the mouse moves over it. Dick - answering your question, pane #4 would occupy pane #2 and #4 area. Again, you can see this in the Codejock web page referenced above. Richard - I read your reply and looked at the pencil-animation web site (cool software). Each pane can be represented as a toolbox or contain information such as record detail, for example. Each pane has a header, which contains a title and buttons. Buttons can be to close/remove the pane, or have a drop-down menu for actions. The header is the dragging object. I will continue to prototype in LC until I have something to show. If I'm successful at uploading to RevOnline, I'll place it there for y'll to take a look at. - Regards, Mark Stuart -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Dockable-Panes-tp4658476p4658505.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: Help with Regex (was Re: Switch, Case and wild-cards?)
That is what I meant by placeholders. So long as you are 99.998% sure your placeholders cannot naturally occur in the source string, you're good. Bob Sneidar IT Manager Calvary Chapel CM Sent from iPhone On Dec 30, 2012, at 12:31, Richmond richmondmathew...@gmail.com wrote: One of the ways of avoiding falling over the results of rule #1 while implementing #2 and #3 is to encode 'G' and 'E' in rule #1 as different symbols, say '%' and '@' after processing so that rules #2 and #3 don't pick them up (one can always have some rules #5 and #6 to replace '%' and '@' with 'G' and 'E' after running through rules #2, #3 and #4). ___ 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: Help with Regex (was Re: Switch, Case and wild-cards?)
On 12/30/2012 10:44 PM, Robert Sneidar wrote: That is what I meant by placeholders. Aha; well we of little brain need a more explicit explanation :) So long as you are 99.998% sure your placeholders cannot naturally occur in the source string, you're good. Bob Sneidar IT Manager Calvary Chapel CM Sent from iPhone On Dec 30, 2012, at 12:31, Richmond richmondmathew...@gmail.com wrote: One of the ways of avoiding falling over the results of rule #1 while implementing #2 and #3 is to encode 'G' and 'E' in rule #1 as different symbols, say '%' and '@' after processing so that rules #2 and #3 don't pick them up (one can always have some rules #5 and #6 to replace '%' and '@' with 'G' and 'E' after running through rules #2, #3 and #4). ___ 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: Help with Regex (was Re: Switch, Case and wild-cards?)
On Sun, Dec 30, 2012 at 12:08 PM, Robert Sneidar slylab...@me.com wrote: I ran into a similar problem doing search and replace in word to clean up text from some data system destined for excel. Also, when you need to do this, open in OpenOffice, which has most of regexp search/replace. -- Richard E. Hawkins, Esq. (702) 508-8462 ___ 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: Dockable Panes
There is a start at revOnline: http://revonline2.runrev.com/stack/595/Resizing-Pane-Example Simon -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Dockable-Panes-tp4658476p4658510.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
File Properties
Hello, I am looking for a way to get the modification time stamp of a file on disk. I see how I could get this info from the defaultFolder using the detailed files but I only have the path to the file. Seems like this should be easy. So I figure I am missing something. What could it be? Thanks Happy New Year! Todd ___ 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: File Properties
Hi Todd, set the itemDel to slash set the defaultFolder to item 1 to -2 of myFilePath put the detailed files into myFiles -- etc -- Best regards, Mark Schonewille Economy-x-Talk Consulting and Software Engineering Homepage: http://economy-x-talk.com Twitter: http://twitter.com/xtalkprogrammer KvK: 50277553 Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other colour spaces. http://www.color-converter.com We have time for new software development projects. Contact me for a quote. On 31 dec 2012, at 01:42, Todd Geist wrote: Hello, I am looking for a way to get the modification time stamp of a file on disk. I see how I could get this info from the defaultFolder using the detailed files but I only have the path to the file. Seems like this should be easy. So I figure I am missing something. What could it be? Thanks Happy New Year! Todd ___ 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: Dockable Panes
Hi As_Simon, I took a look at the web page of the link you gave. It shows how to resize controls with the concept of a splitter. What I'm talking about is docking panes. Have a look at the link I supplied to Codejock. A whole different matter. But thanks for that. Those who read this topic will then see the difference. - Regards, Mark Stuart -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/Dockable-Panes-tp4658476p4658513.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