Re: Church bell app?

2014-08-24 Thread stephen barncard
On Sat, Aug 23, 2014 at 8:14 PM, Kay C Lan wrote: > they tick. If it were me I'd crack the case open, remove the battery > and just have it plugged in permanently. The other fire problem you > there goes battery backup. You'll need a UPS then. *--* *Stephen Barncard - San Francisco Ca. USA - De

delete end chars

2014-08-24 Thread JB
If I have a certain amount of characters and I want to check the end of another line of characters to see if they are there and if so then delete them what is the fastest way to do delete the characters at the end of the specified line? ___ use-livecode

Re: delete end chars

2014-08-24 Thread dunbarx
Hi. Are you saying that if you have "ABCD" and somewhere else you have: "AXFRZC" that you want to delete the "C" from the first string? Whatever you want, the chunking and text control within LC is more than adequate to do the job, and will be fun do execute as well. But is this what you mea

Re: delete end chars

2014-08-24 Thread Richmond
On 24/08/14 17:12, JB wrote: If I have a certain amount of characters and I want to check the end of another line of characters to see if they are there and if so then delete them what is the fastest way to do delete the characters at the end of the specified line? delete last char of XYZ [wh

Re: delete end chars

2014-08-24 Thread JB
Hi, Thanks for the reply. I am saying if I have “ABC” in one string and the other string has “KCFAJFCABC” then I want to delete the “ABC” from the end of the second string leaving “KCFAJFC”. John Balgenorth On Aug 24, 2014, at 8:09 AM, dunb...@aol.com wrote: > Hi. > > > Are you saying that

Re: delete end chars

2014-08-24 Thread Colin Holgate
This seems to work (where you have field one with the letters to check, and field 2 is the letters that might end with those check letters): on mouseUp put fld 1 into f1 put fld 2 into f2 put offset(f1,f2) into offamount if offamount = the number of chars in f2 - the number of chars i

Re: delete end chars

2014-08-24 Thread JB
Hi Richmond, Wouldn’t that just delete the last char? I need to check for all characters in the first string to see if they all exist in the same order of the last chars of the second string. I know I could use a repeat to see if the characters all exist and then if they do I could use a repeat

Re: delete end chars

2014-08-24 Thread JB
That works good! thank you, John Balgenorth On Aug 24, 2014, at 8:21 AM, Colin Holgate wrote: > on mouseUp > put fld 1 into f1 > put fld 2 into f2 > put offset(f1,f2) into offamount > if offamount = the number of chars in f2 - the number of chars in f1 + 1 > then > put char 1 to

Re: delete end chars

2014-08-24 Thread Peter M. Brigham
function zapAtEndOfLine tStr, tContainer put cr after tContainer replace tStr & cr with cr in tContainer return char 1 to -2 of tContainer end zapAtEndOfLine -- Peter Peter M. Brigham pmb...@gmail.com http://home.comcast.net/~pmbrig On Aug 24, 2014, at 11:12 AM, JB wrote: > Hi, > > T

Re: delete end chars

2014-08-24 Thread Richmond
On 24/08/14 18:19, JB wrote: Hi Richmond, Wouldn’t that just delete the last char? I need to check for all characters in the first string to see if they all exist in the same order of the last chars of the second string. I know I could use a repeat to see if the characters all exist and then i

Re: delete end chars

2014-08-24 Thread Colin Holgate
What if the field happen to already end with a cr? On Aug 24, 2014, at 11:38 AM, Peter M. Brigham wrote: > function zapAtEndOfLine tStr, tContainer > put cr after tContainer > replace tStr & cr with cr in tContainer > return char 1 to -2 of tContainer > end zapAtEndOfLine ___

Re: delete end chars

2014-08-24 Thread JB
That works really good too! thank you, John Balgenorth On Aug 24, 2014, at 8:38 AM, Peter M. Brigham wrote: > function zapAtEndOfLine tStr, tContainer > put cr after tContainer > replace tStr & cr with cr in tContainer > return char 1 to -2 of tContainer > end zapAtEndOfLine > > -- Pete

Re: delete end chars

2014-08-24 Thread Richmond
On 24/08/14 18:48, Colin Holgate wrote: What if the field happen to already end with a cr? On Aug 24, 2014, at 11:38 AM, Peter M. Brigham wrote: function zapAtEndOfLine tStr, tContainer put cr after tContainer replace tStr & cr with cr in tContainer return char 1 to -2 of tContainer

Re: delete end chars

2014-08-24 Thread JB
Hi Richmond, That seems to leave me with the string I want to delete. Even so thank you for the code. John Balgenorth On Aug 24, 2014, at 8:46 AM, Richmond wrote: > on mouseUp > put fld "TEXXT" into TEXXT > put the number of chars in TEXXT into CHNMB > repeat CHNMB times > if the l

Re: delete end chars

2014-08-24 Thread Richmond
On 24/08/14 18:54, JB wrote: Hi Richmond, That seems to leave me with the string I want to delete. Even so thank you for the code. John Balgenorth On Aug 24, 2014, at 8:46 AM, Richmond wrote: on mouseUp put fld "TEXXT" into TEXXT put the number of chars in TEXXT into CHNMB repeat

Re: delete end chars

2014-08-24 Thread Colin Holgate
Another problem with this approach is that there may be other cases where the letters are in the string, and have a cr after them. All of the cases would be removed, not just the last one. On Aug 24, 2014, at 11:38 AM, Peter M. Brigham wrote: > function zapAtEndOfLine tStr, tContainer > put

Re: delete end chars

2014-08-24 Thread JB
Thank you very much! John Balgenorth On Aug 24, 2014, at 9:01 AM, Richmond wrote: > On 24/08/14 18:54, JB wrote: >> Hi Richmond, >> >> That seems to leave me with the string I want to delete. >> Even so thank you for the code. >> >> John Balgenorth >> >> >> On Aug 24, 2014, at 8:46 AM, Ric

Re : Speed

2014-08-24 Thread Beat Cornaz
All right, the permutations. Thanks for the responses. My findings so far : Mark wrote : -- In addition, you're losing much of the speed of the "repeat for each" loops by embedding a "repeat with" loop at the deepest level (and in addition you're making an unneccsary extra copy of tLine each time

Re: delete end chars

2014-08-24 Thread Peter Haworth
if tString1 ends with tString2 then delete char (the length of tString1 - the length of tString2 +1 ) to -1 of tString1 end if Pete lcSQL Software Home of lcStackBrowser and SQLiteAdmin O

Re: delete end chars

2014-08-24 Thread Scott Rossi
Pete beat me to the punch. if text of fld 1 ends with text of fld 2 then \ delete char -(length(fld 2)) to -1 of fld 1 Regards, Scott Rossi Creative Director Tactile Media, UX/UI Design On 8/24/14 9:28 AM, "Peter Haworth" wrote: >if tString1 ends with tString2 then > delete char (t

Re: OpenField mystery

2014-08-24 Thread Graham Samuel
I think the bug is still there: I just created a stack with one button and one field. I can edit the field and then immediately click the button, but the 'closeField' doesn't fire unless I make it do so explicitly, for example with a 'returnInField' handler, or if the whole stack loses focus and

Re: delete end chars

2014-08-24 Thread JB
Thank you for the reply and code. I can’t seem to get it to work right. The only thing I could make it do is if ABC is string1 and ABC us string2 it will delete string2 but if chars are before the ABC in string2 nothing is deleted. Even so it is good code and I might need to use it sometime. Joh

Re: delete end chars

2014-08-24 Thread JB
I got that one to work. Thank you. John Balgenorth On Aug 24, 2014, at 9:42 AM, Scott Rossi wrote: > Pete beat me to the punch. > > if text of fld 1 ends with text of fld 2 then \ > delete char -(length(fld 2)) to -1 of fld 1 > > > Regards, > > Scott Rossi > Creative Director > Tactil

Re: OpenField mystery

2014-08-24 Thread Graham Samuel
I concur. I would never have thought of it. It works very well for me. Thanks Peter Graham On 24 Aug 2014, at 00:24, J. Landman Gay wrote: > On 8/23/2014, 4:10 PM, Peter M. Brigham wrote: >> I have long been annoyed at the default placement of the insertion >> point in the first field when the

Re: delete end chars

2014-08-24 Thread Peter Haworth
Couple of other ways using regex. get matchText(tString1,"(.*)" & tString2 & "$",tString1) Or if matchChunk(tString1,"(.*)" & tString2 & "$",tString1,tStart,tEnd) then delete char tStart to tEnd of tString1 end if Pete lcSQL Software Home of lcStackBrowser

Re: delete end chars

2014-08-24 Thread JB
Thank you very much! I was able to get the first one to work but for some reason and it could be me I could not get the second one to work. thanks again John Balgenorth On Aug 24, 2014, at 10:19 AM, Peter Haworth wrote: > Couple of other ways using regex. > > get matchText(tString1,"(.*)" &

Android LiveCode stack player

2014-08-24 Thread Alejandro Tejada
Hi All, Android platform allows to open a stack from Livecode apps compiled for Android (unlike iOS). Does anyone have created an Android Stack Player, similar to Ken Ray's StackRunner? http://www.sonsothunder.com/devres/livecode/downloads.htm Thanks in advance! Al -- View this message in

Re: Speed

2014-08-24 Thread James Hurley
There are significant differences in speed between 5.5 and 6.6. Not so much in deriving the permutations as in displaying the results in a field. To see this run this in the message box: go url "https://dl.dropboxusercontent.com/u/47044230/PermutationSpeed3.rev” (Does this only work in LC 6

Re: Speed

2014-08-24 Thread James Hurley
Sorry about that last post. Forgot to delete all message above Geoff’s. Jim ___ 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/mai

Re: OpenField mystery

2014-08-24 Thread Peter Haworth
That's been an issue on Macs forever. If you're in a field and then click a button, the field doesn't lose focus so no closeField is sent. I believe the way to get round it is to "focus on nothing" in the mouseUp code of the button (or the mouseDown). Pete lcSQL Software H

Re: Android LiveCode stack player

2014-08-24 Thread Scott Rossi
If I understand what you're after (loading a remote stack?), maybe this will give you some ideas: This isn't limited to DropBox obviously -- you can set up your launcher to load stacks fro

Re: delete end chars

2014-08-24 Thread Peter Haworth
On Sun, Aug 24, 2014 at 10:35 AM, JB wrote: > (tString1,"(.*)" & tString2 & "$",tString1,tStart,tEnd) My apologies, should have tested it first! It should be: if matchChunk(tString1,".*(" & tString2 & ")$",tStart,tEnd) then delete char tStart to tEnd of tString1 end if Pete lcSQL Software

Re: delete end chars

2014-08-24 Thread JB
I still can’t get it to work for some reason. And the first regex one ends up leaving me the letters that I wanted to delete instead of leaving the other part. After getting the others to work in a new stack I tried them in the script I needed it for and the only one that would work is the one Co

Re: Android LiveCode stack player

2014-08-24 Thread Alejandro Tejada
Great! I want to open local stacks from Android Internal Storage, microSDHC card or (if LiveCode could read from usb devices on Android) a USB Pendrive (Fat32 or NTFS). I will test this as soon I reinstall android development kit... :( Al -- View this message in context: http://runtime-revolu

Re: delete end chars

2014-08-24 Thread Peter Haworth
On Sun, Aug 24, 2014 at 1:43 PM, JB wrote: > I still can’t get it to work for some reason. And the > first regex one ends up leaving me the letters that > I wanted to delete instead of leaving the other part. > Strange. They both work fine here. Maybe the variables are the wrong way round? t

[ANN] LiveCode meeting in the Netherlands

2014-08-24 Thread Mark Schonewille
Dear everyone, On 20th September 2014, there will be a LiveCode meeting in the Netherlands. The exact location will be announced shortly. Participants, please contact me as soon as possible. I need to know how many people will participate to determine where to host the meeting. Contact me by

Re: delete end chars

2014-08-24 Thread JB
You are right. Thank you! What happened is the variables were all listed right in my code for the searching and replacing and then I put the wrong variable into the field I wanted to change. thanks again. John Balgenorth On Aug 24, 2014, at 3:07 PM, Peter Haworth wrote: > On Sun, Aug 24, 20

Population puzzle

2014-08-24 Thread Michael Doub
I know that some of the folks on this list enjoy puzzles. A friend sent me this one this afternoon and I thought it would be interesting to see the different approaches folks come up with and how fast it can be solved. enjoy… The 2010 Census puts populations of 26 largest US metro areas at 1

Re: Population puzzle

2014-08-24 Thread Mark Wieder
Michael- Sunday, August 24, 2014, 4:52:43 PM, you wrote: > I know that some of the folks on this list enjoy puzzles. A > friend sent me this one this afternoon and I thought it would be > interesting to see the different approaches folks come up with and > how fast it can be solved. enjoy… >

Re: delete end chars

2014-08-24 Thread Kay C Lan
Not bringing much to the table other than to say that if you are looking into large amounts of data, and need to do this millions of time, and therefore speed is of interest, Peter's grep solution is ever so slightly faster than Colin's. There isn't much in it and both scale well. If you'd like to

Re: Population puzzle

2014-08-24 Thread Terry Judd
OK - I¹ll take the bait although elegant algorithms definitely aren¹t my forte. As a result this is probably a very half-baked and inefficient solution to the problem but it seems to work and doesn¹t have to resort to recursion (which I can never get my head around) to generate the starting combina

Re: delete end chars

2014-08-24 Thread Peter Haworth
On Sun, Aug 24, 2014 at 8:09 PM, Kay C Lan wrote: > Not bringing much to the table other than to say that if you are > looking into large amounts of data, and need to do this millions of > time, and therefore speed is of interest, Peter's grep solution is > ever so slightly faster than Colin's. T

Re: Population puzzle

2014-08-24 Thread Scott Rossi
If I understand the challenge, the goal is to find some combination of the numbers that adds up to 1. If this isn't right, ignore the following. If the above is true, then here's a brute force randomized solution that arrives at the answer by chance, has no mathematical logic, and will li

Re: Population puzzle

2014-08-24 Thread Kay C Lan
OK, well I think I can do a little better than that. I can consistently get an answer in a sec, which I guess you could beat if you happen to be lucky with your first selection of random cities. I do also appreciate that Terry's code is slowed a little by counting the iterations which mine doesn't.