Re: How to Return the Exponent

2024-12-19 Thread Dick Kriesel via use-livecode
> On Dec 17, 2024, at 7:07 PM, Roger Guay via use-livecode > wrote: > > Oops. I take it back. It does not work. > > set the itemDel to “^" > put char 3 of word 2 of "((1234…)^1/x)” > > returns blank > > Bummer! Hi, Roger. word 2 of "((1234…)^1/x)" is empty because the word de

Re: How to check if a group contains a specific control ?

2024-08-24 Thread Dick Kriesel via use-livecode
yet another alternative: if the long id of ends with the long id of then … this catches controls whose ownership includes intervening grouping between your control and your group — Dick > On Aug 23, 2024, at 5:48 AM, Brian Milby via use-livecode > wrote: > > Another alternative. > > If t

Re: Slow stack problem

2024-07-02 Thread Dick Kriesel via use-livecode
t end repeat return char 1 to -2 of tLineNumbers end findLineNumbersInUnicode If you try the idea, please share your test results. — Dick Kriesel ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe,

Re: Variable Watcher disappeared

2023-08-08 Thread Dick Kriesel via use-livecode
Hi, Bob. The bottom pane reappears to show search results, so search for something. — Dick > On Aug 8, 2023, at 9:28 AM, Bob Sneidar via use-livecode > wrote: > > Hi all. > > Not sure how I did it but I can no longer see the variables while debugging. > The bottom pane has disappeared and n

Re: No progress updates on LC 10. Am i the only one who is concerned?

2023-07-25 Thread Dick Kriesel via use-livecode
> On Jul 25, 2023, at 7:49 PM, Geoff Canyon via use-livecode > wrote: > > So, not to be too much of an apologist, but the issue doesn't seem like a > showstopper to me. This is just a crashing bug to fix before RC1. Let the show go on! — Dick ___ u

Re: No progress updates on LC 10. Am i the only one who is concerned?

2023-07-25 Thread Dick Kriesel via use-livecode
> On Jul 25, 2023, at 11:37 AM, Geoff Canyon via use-livecode > wrote: > > Maybe a silly question, but that issue lists "turn on bracket completion" > as a step to reproduce. If bracket completion is off, is it safe? Hi, Geoff. I filed the report. With bracket completion off, I saw no such p

Re: What is your best practice for setting a script in a script?

2023-07-15 Thread Dick Kriesel via use-livecode
> On Jul 15, 2023, at 8:06 AM, Paul Dupuis via use-livecode > wrote: > > So in the instances where you have a script that creates an object and then > sets the script of that object (example below), what is you best practice for > having the script in a script and still be readable? Hi, Paul

Re: Confirm sort container order...

2022-04-04 Thread Dick Kriesel via use-livecode
> On Mar 30, 2022, at 2:16 PM, Paul Dupuis via use-livecode > wrote: > > sort lines of tText by word 1 of each & word 2 of each & word 3 of each Hi, Paul. The only feature missing is padding the first two words: sort tText by pad( word 1 of each ) & pad( word 2 of each ) & word 3 of each

Re: Counting Syllables

2022-03-23 Thread Dick Kriesel via use-livecode
> On Mar 22, 2022, at 7:25 AM, Rick Harrison via use-livecode > wrote: > > An existing database would make things a lot easier. You could scrape an online dictionary to obtain the syllabification for each given word. For example, if you investigate https://www.dictionary.com/browse/syllabi

Re: Speaking of Filter and Match...

2022-03-14 Thread Dick Kriesel via use-livecode
> On Mar 13, 2022, at 1:05 PM, J. Landman Gay via use-livecode > wrote: > > On 3/12/22 8:54 PM, Roger Guay via use-livecode wrote: >> I have a field with about a thousand lines with many duplicate lines, and I >> want to delete the duplicates. Seems like this should be simple but I am >> run

Re: can I filter lines with a list of alternative OR strings?

2022-03-06 Thread Dick Kriesel via use-livecode
> On Mar 3, 2022, at 2:30 AM, David V Glasgow via use-livecode > wrote: > > I can filter text using a single term plus a numerical range s eg: > *re 1[0-5]* > matching a text stem “re “ followed by any one of 10, 11, 12, 13, 14 or 15 > > But is there a form where the alternatives are also tex

Re: Speed up a slow loop

2022-03-06 Thread Dick Kriesel via use-livecode
> On Mar 2, 2022, at 1:57 PM, J. Landman Gay via use-livecode > wrote: > ... > repeat for each line l in pList -- pList is the user word list >if sDictFile[l] = true then put l & cr after tCheckedList >else put l & cr after tNonWords >wait 0 with messages -- prevent ANRs > end repe

Re: How to find the offset of the first character in a string that's not a tab?

2021-01-21 Thread Dick Kriesel via use-livecode
> On Jan 21, 2021, at 2:34 AM, Keith Clarke via use-livecode > wrote: > I was just keen to understand why offset wasn’t happy with the ‘not(tab)’ in > this instance. expression "not(tab)" evaluates to true, which doesn’t serve your purpose — Dick __

Re: How to find the offset of the first character in a string that's not a tab?

2021-01-21 Thread Dick Kriesel via use-livecode
> On Jan 21, 2021, at 2:25 AM, Dick Kriesel via use-livecode > wrote: > > Hi, Keith. You could test each character until you find a tab: > correction: until you find one that’s not a tab ___ use-livecode mailing li

Re: How to find the offset of the first character in a string that's not a tab?

2021-01-21 Thread Dick Kriesel via use-livecode
> On Jan 21, 2021, at 1:30 AM, Keith Clarke via use-livecode > mailto:use-livecode@lists.runrev.com>> wrote: > > Please can anyone advise on the correct syntax for trying to find the first > non-tab character offset in a string Hi, Keith. You could test each character until you find a tab: f

Re: directory tree -> array

2020-02-01 Thread Dick Kriesel via use-livecode
> On Jan 22, 2020, at 10:17 AM, Richard Gaskin via use-livecode > wrote: > > I stumbled across a code challenge for y'all, one that seems seductively > simple but I don't think it is: > > What is the simplest way to build an array that reflects the files and > folders within a given folder?

Re: valueDiff for arrays?

2018-08-07 Thread Dick Kriesel via use-livecode
> On Aug 7, 2018, at 9:29 PM, Jerry Jensen via use-livecode > wrote: > >> On Aug 7, 2018, at 8:35 PM, Mark Wieder via use-livecode >> wrote: >> >> On 08/07/2018 07:57 PM, Dick Kriesel via use-livecode wrote: >>> On Aug 7, 2018, at 5:47 PM,

Re: valueDiff for arrays?

2018-08-07 Thread Dick Kriesel via use-livecode
On Aug 7, 2018, at 5:47 PM, Alex Tweedly via use-livecode wrote: > > Is there an easy way to test whether an array is (currently) a sequence array > ? > > something easier than > put the extents of tArray into tmp > if item 1 of tmp = 1 AND item 2 of tmp = the number of elements in tAr

Re: Sender of send in time

2018-07-14 Thread Dick Kriesel via use-livecode
> On Jul 13, 2018, at 1:26 AM, hh via use-livecode > wrote: > >> Bob S. wrote: >> Something in my scripts is sending a selectionChanged message in >> time to a specific datagrid when it shouldn't. How do I determine >> the sender of a send in time message? > > Simply use a a parameter: > >

Re: Behaviors not honoring script local variables??

2018-06-26 Thread Dick Kriesel via use-livecode
> On Jun 26, 2018, at 1:13 PM, Bob Sneidar via use-livecode > wrote: > ... > do "put " & quote & aStackConstants [tConstant] & quote & " into " & > tConstant Hi, Bob. If you wanted simpler code, that could be just do "put aStackConstants[ tConstant ] into " & tConstant — Dick _

Re: Q on Accessing multi-dimension arrays.

2018-04-26 Thread Dick Kriesel via use-livecode
rom Mark W: > On Mar 12, 2012, at 10:19 AM, Pete wrote: > >> I'm wondering how you found about about this key values array feature? I >> can't find any mention of it in the dictionary or the reference manual and >> it sure seems like something that should be

Re: Can use assign multiple behaviors to a single object?

2016-08-11 Thread Dick Kriesel
> On Aug 11, 2016, at 2:34 PM, Sannyasin Brahmanathaswami > wrote: > > but looking for > > OBJECT A (with behaviors) > behavior 1 > behavior 2 > bevaiour 3 > > all with an "equal standing" I have a library called "libBehaviorList" you could use to give any object a list of

Re: The opposite of 'mod'

2016-05-01 Thread Dick Kriesel
> On May 1, 2016, at 2:59 AM, RM wrote: > > BUT, what is the non-mod bit? 13492571 div 16 ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://li

Re: Clearing local variables

2016-04-22 Thread Dick Kriesel
Craig’s code works. I should’ve tested. As a design alternative, you could use a single local variable for all those arrays. Then you could reinitialize without invoking "do;" code that applies to multiple arrays may be less verbose. — Dick ___ use-l

Re: Clearing local variables

2016-04-22 Thread Dick Kriesel
> On Apr 22, 2016, at 12:48 PM, Sannyasin Brahmanathaswami > wrote: > > repeat for each item x in tLocalVars >put empty into x > end repeat repeat for each item x in tLocalVars set the text of x to empty end repeat ___ use-livecode mailing list

Re: Arrays for lists with multiple lines where item 1 is the same on N number of lines

2016-04-22 Thread Dick Kriesel
> On Apr 21, 2016, at 11:53 PM, Sannyasin Brahmanathaswami > wrote: > > But I can’t wrap my head around the core problem: how to split a list where > the first element may be repeated throughout with different values. How about this way? repeat for each line t in p put "true" into a[ it

Re: Search and Replace in Script Editor: Cannot invoke "Replace All"

2015-09-28 Thread Dick Kriesel
> > Expected behavior “Replace All” button should be enabled after the find runs > > What happened: it remains dimmed > Aloha, BR. "Change all" requires "Look in: Current Tab" or "Look in: All Tabs" for me. Do those options work for you? — Dick ___

Re: [ANN]SoCal LiveCode Meeting, Sept 3

2015-08-31 Thread Dick Kriesel
On Aug 31, 2015, at 7:36 PM, Richard Gaskin wrote: > > Dick Kreisel's contribution was the fastest. I stood on the shoulders of giants. You and Bernd provided the breakthroughs in speed. Thanks for your code and your constructive influence. Can I come to your SoCal meeting virtu

Re: Referencing a control name

2015-07-24 Thread Dick Kriesel
> On Jul 24, 2015, at 5:05 PM, Peter Bogdanoff wrote: > > I want to reference that data like this: > > set the width of to item 2 of > line 1 of field “MyField” > > How do I script the stuff inside the <> ? Sometimes that item will be a > field, graphic, etc. > Hi, Peter. You coul

Re: overriding a function

2015-06-24 Thread Dick Kriesel
> On Jun 23, 2015, at 10:39 PM, Monte Goulding > wrote: > > Howdy folks > > I’m doing a bit of IDE hacking for a new plugin and I want to override a > function in one of the libraries or rather add some lines to it’s results. > The only way I can override is via a front script but ideally I

Re: ABC of arrays

2015-04-20 Thread Dick Kriesel
> On Apr 20, 2015, at 1:38 PM, Bob Sneidar wrote: > > One other confusing thing is that if you check a variable containing an array > for empty it will return true. Lay that confusion to rest, Bob. Here’s a snip from release notes I found for 6.0.1: From 6.0 DP 3 onwards, expressions such

Re: matchText question

2015-02-27 Thread Dick Kriesel
On Feb 27, 2015, at 3:17 PM, Peter M. Brigham wrote: > > Is handlerList() a built-in LC function? Or a proprietary function? When I > try it in LC 5.5.1 it can't find the function, so if it's a native function > it's in a later version. I've built my own workaround, but using > revAvailableHan

Re: matchText question

2015-02-27 Thread Dick Kriesel
On Feb 27, 2015, at 8:03 AM, Peter M. Brigham wrote: > > The output I get from revAvailableHandlers looks like this: > > M mouseleave 14 17 button id 1026 of group id 1021 of card id 1082 of stack > "NCMHC notes" of stack "/Users/pmbrig/Documents/LiveCode/ NCMHC notes/ NCMHC > notes.rev" > M

Re: A code style question

2015-01-22 Thread Dick Kriesel
> On Jan 21, 2015, at 9:54 AM, Ken Ray wrote: > > I use a similar inline "switch": > >put stsSwitch(the platform,"MacOS=Finder","Win32=Explorer","*=Desktop") > into tReference One line can accomplish that even without invoking a custom function: put item itemOffset( the platform, "MacOS,

Re: Extended Log Format or custom?

2015-01-17 Thread Dick Kriesel
> On Jan 17, 2015, at 12:13 PM, Richard Gaskin > wrote: > > What would you do? I'd skim through the ELFF doc for something to try. How about using ELFF fields date and time? "Dates are recorded in the format -MM-DD where , MM and DD stand for the numeric year, month and day respecti

Re: hide / show oddities ?

2014-11-28 Thread Dick Kriesel
The subject is intriguing for some future release. "Hide oddities" would be great for giving demos; "show oddities" would great for debugging. Thanks for the suggestions, Alex. -- Dick ___ use-livecode mailing list use-livecode@lists.runrev.com Please

Re: problem with counting words

2014-10-16 Thread Dick Kriesel
On Oct 14, 2014, at 12:45 PM, Richard Gaskin wrote: > on mouseUp > put 1000 into n > put "aaa,bbb,ccc#ddd#eee#fff,ggg,hhh" into tSomeData > -- > put the millisecs into t > repeat n > get nDepth(tSomeData, 3, comma, 2, "#" ) > end repeat > put the millisecs - t into t1 > put

Re: How to create a List of My Functions and My Commands

2014-09-27 Thread Dick Kriesel
On Sep 27, 2014, at 8:34 PM, Kay C Lan wrote: > At this stage it looks like I have to step through each object, > extract each script and then parse out the handler names; which of > course is exactly what LC does extremely quickly and efficiently, but > not as quick as if there is a command/func

Re: Replacing Characters

2014-09-27 Thread Dick Kriesel
On Sep 27, 2014, at 12:23 AM, JB wrote: > But there might be a faster way. Hi, John. Here's a way that works in under a millisecond on my iMac, and a way to test its speed. command replace_maybe @rString repeat with i = 3 to length( rString ) step 3 if char i of rString is "D" the

Re: Sorting a multidimensional array

2014-09-26 Thread Dick Kriesel
On Sep 25, 2014, at 9:24 PM, Peter Bogdanoff wrote: > My first foray into arrays Hi, Peter. For this foray, you could use a one-dimensional array, containing the three lines of html text for each plain text key: command sortGroupsOfLines local tText, tLineNumber, tGroup, tKey, tArray, tK

Re: file size

2014-09-23 Thread Dick Kriesel
On Sep 23, 2014, at 1:13 AM, Thierry Douez wrote: > Here is a modified version of yours: > > matchText(the detailed files,("(?m)^" & urlEncode( tFile ) & ",(\d+)" ), > tSize) Hi, Thierry. When the file name contains a space, urlEncode encodes the space as +, which regex interprets, causing

Re: file size

2014-09-23 Thread Dick Kriesel
On Sep 22, 2014, at 4:33 PM, Richard Gaskin wrote: > But it really should be a one-liner OK, Richard. Here's one. -- given variable tFile, containing the name of a file in the default folder -- given variable tSize, which is where to put the size of the file get matchText( the detailed f

Re: Speed

2014-08-23 Thread Dick Kriesel
On Aug 23, 2014, at 1:31 AM, Dick Kriesel wrote: > putLine n & " things produce " & ( number of elements in > tCountForPermutation ) & " of " \ oops. please replace "putLine" with "put"

Re: Speed

2014-08-23 Thread Dick Kriesel
On Aug 22, 2014, at 1:17 PM, Beat Cornaz wrote: > So a good example would be how to make all possible permutations of say 10 > different elements (0-9). This gives 3628800 different permutations. > The resulting permutations will be in lines I guess, but what would be the > best way to do thi

Re: New chunks

2014-03-12 Thread Dick Kriesel
How about "revword" for the pre-7 behavior? + frees "word" to make learning easier post-6 + tribute to heritage + easily recognizable and sensible reference for current and future livecoders + no reference to encoding + no reference to versions + no unexpected "u" + precedent for similar changes i

Re: Apple Safari 6.1 issues warning

2013-09-08 Thread Dick Kriesel
; On Sep 8, 2013 12:37 AM, "Dick Kriesel" wrote: >> >> Mark -- I've noticed you belch out a pun now and then. >> >> I'll bet you feel better afterwards, too. >> >> On Sep 7, 2013, at 6:49 PM, Mark Wieder wrote: >> >>> Dick- &g

Re: Apple Safari 6.1 issues warning

2013-09-07 Thread Dick Kriesel
Stephen -- I'm glad you did; you made the thread more fun than if someone else had pointed it out. A belly laugh, even, Stephen. On Sep 7, 2013, at 10:55 PM, stephen barncard wrote: > geesh... . I shouldn't have pointed out my mistake. Tough crowd. > no slack! _

Re: Apple Safari 6.1 issues warning

2013-09-07 Thread Dick Kriesel
Mark -- I've noticed you belch out a pun now and then. I'll bet you feel better afterwards, too. On Sep 7, 2013, at 6:49 PM, Mark Wieder wrote: > Dick- > > Saturday, September 7, 2013, 5:52:22 PM, you wrote: > >> I knew in my gut what he meant. > > Sometimes I just can't stomach these puns.

Re: Apple Safari 6.1 issues warning

2013-09-07 Thread Dick Kriesel
I knew in my gut what he meant. On Sep 7, 2013, at 4:57 PM, "Marian Petrides, M.D." wrote: > I wondered about that :-) > > On Sep 7, 2013, at 4:48 PM, stephen barncard > wrote: > >> < abdominal ! > NO! >> >> abominable ! >> ___ use-livecod

Re: Random sort demonstration

2013-05-23 Thread Dick Kriesel
On May 23, 2013, at 12:41 AM, Jacques Hausser wrote: > and something like > > "scramble lines of myVar", instead of "sort lines of myVar random(xxx)". > Could be a command using the same function behind the scene, with the max > integer as parameter to avoid prevalence of "the first" in the c

Re: randomly order a list

2013-05-22 Thread Dick Kriesel
On May 22, 2013, at 5:04 PM, Dick Kriesel wrote: > combinations oops... permutations ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: h

Re: randomly order a list

2013-05-22 Thread Dick Kriesel
On May 22, 2013, at 10:59 AM, Chris Sheffield wrote: > sort lines of myVar by random(the number of lines of myVar) Hi, Chris. I suggest you try this: sort lines of myVar by _random( the number of lines in myVar, each ) with this: private function _random pUpperLimit -- note: ignore other p

Re: skip lists

2013-05-13 Thread Dick Kriesel
On May 12, 2013, at 6:18 PM, Peter Haworth wrote: > A few months back, there was a great post that revealed what I think is a > little known way to reference array keys - if I'm not mistaken it was from > Dick Kriesel. I have no idea how (in)efficient it might be compared

Re: Nested array comparisons

2013-03-24 Thread Dick Kriesel
On Mar 24, 2013, at 1:29 PM, Mark Schonewille wrote: > As you can conclude from > > "To compare two arrays, simply use the = operator directly on them rather > than encoding them first." > > the documenation, particularly with regard to arrays, is not always correct. Hi, Mark. Of course do

Re: Nested array comparisons

2013-03-24 Thread Dick Kriesel
On Mar 24, 2013, at 1:02 PM, Monte Goulding wrote: > I know the list of keys is not random but there's no guarantee on the order > as far as I know and I'd want to do a significant amount of testing before I > assume two arrays created under different circumstances might return the keys > in t

Re: inverse of intersect array with templateArray

2013-03-23 Thread Dick Kriesel
On Mar 23, 2013, at 4:53 AM, Dick Kriesel wrote: > It needs more testing before I share it. How soon do you need it, Monte? Detecting changes from one multidimensional array to another now passes my tests, as confirmed by applying the derived changes to the original data, and gett

Re: Nested array comparisons

2013-03-23 Thread Dick Kriesel
On Mar 23, 2013, at 12:43 PM, David Beck wrote: > > If one has two nested arrays, can you compare the two for equality by doing > > if deepArray_1 is deepArray_2 then > -- do whatever > end if > > It looks like this does not work. That is, you get false positives at times > when the two ar

Re: inverse of intersect array with templateArray

2013-03-23 Thread Dick Kriesel
On Mar 23, 2013, at 12:57 AM, Monte Goulding wrote: > This is for the VCS stuff I'm doing and I need to end up with the differences > between branch a and branch b. I have some lightly tested code for detecting changes from one multidimensional array to another. Then it copies the first arra

Re: inverse of intersect array with templateArray

2013-03-23 Thread Dick Kriesel
On Mar 23, 2013, at 12:13 AM, Monte Goulding wrote: > Hi Folks > > Just checking if there isn't an undocumented inverse of the intersect > command? What I need is a function that can take two multi-dimensional arrays > and return only keys and elements that both don't have in common.. I'm >

Re: Dockable Panes

2012-12-29 Thread Dick Kriesel
On Dec 29, 2012, at 9:32 PM, Mark Stuart wrote: > Likewise, pane #2 could be dropped onto pane #3 position. Then, what appears where pane #2 was? ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscr

Re: Dockable Panes

2012-12-29 Thread Dick Kriesel
On Dec 29, 2012, at 5:48 PM, wrote: > example: if the bottom left pane (#3) was dragged into the top left position > (#1), panes 1 and 3 take up the space of 1 and 3, and are "presented" as a > tab control. Panes 2 and 4 remain as they were. Hi, Mark. What happens when we drag an untabbed pa

Re: Algorithm time...

2012-12-11 Thread Dick Kriesel
On Dec 9, 2012, at 4:31 PM, Glen Bojsza wrote: > That's it!! > > 500,000 points in 419 milliseconds. > > This scales perfectly for what I need. > > thanks Dick. > You're welcome, Glen. So now I've tried optimizing for speed and legibility. Would you check the timing for your data, please,

Re: Capture the Trig Function from an Option Menu Button

2012-12-10 Thread Dick Kriesel
On Dec 10, 2012, at 10:40 AM, Roger Guay wrote: > Question: Is this essentially a "Do" statement in a clever disguise? Yes, although the "value" function can do more than it does in this example (see the dictionary for details). -- Dick ___ use-livec

Re: Capture the Trig Function from an Option Menu Button

2012-12-10 Thread Dick Kriesel
On Dec 10, 2012, at 8:59 AM, Jim Hurley wrote: > get "put the " & tTrigFunction & " of " & tAngle & " into y " > do it > Hi, Jim and Roger. If you like more concise code, you can code the above like this: put value( tTrigFunction & "(" & tAngle & ")" ) into y -- Dick ___

Re: Algorithm time...

2012-12-09 Thread Dick Kriesel
Hi, Glen. I've reread your replies. Here's a new version that returns the original values, as needed. Please test and report again. -- Dick function digest @pLines local tGroupSize, tLineNumber, tArray, tKeys, tMin, tMax, tResult put number of lines in pLines div 1000 into tGroupSize

Re: Algorithm time...

2012-12-09 Thread Dick Kriesel
On Dec 9, 2012, at 12:37 PM, Glen Bojsza wrote: > So there must be a better way to get the item 1 value and still stay in the > millisecond range...or not? Did you remove the line I mentioned, verify the results, and check the timing? -- Dick ___ use

Re: Algorithm time...

2012-12-09 Thread Dick Kriesel
On Dec 9, 2012, at 3:17 AM, Glen Bojsza wrote: > In other words the two values found in column 2 of the group data must then > get the corresponding column1 values from the original dataset. Hi, Glen. You'll get that if you remove the line "put 0 into tLineNumber" near the end of the repeat l

Re: Algorithm time...

2012-12-09 Thread Dick Kriesel
On Dec 9, 2012, at 12:33 AM, Glen Bojsza wrote: > I believe that this should be doable less than 1 second Hi, Glen. Here's a draft you could try. It works for the sample data you posted. If you have questions, please ask. If you try it, please report your timings. -- Dick function foo

Re: Script problem

2012-10-26 Thread Dick Kriesel
Charles, please let us know what the problem was. If the problem persists, I suggest you check the whether the suspect checkboxes may be affected by a getProp for "uMyLabel," or by a custom property set. -- Dick ___ use-livecode mailing list use-liveco

Re: Condtional parameters in handler calls

2012-07-17 Thread Dick Kriesel
Hi, Pete. You can wrap your "if" in a function, so any caller can have just one line. myCommand parm1,iff(,,),parm3 function iff pBoolean,pTrueValue,pFalseValue if pBoolean then return pTrueValue else return pFalseValue end if end iff -- Dick On Jul 17, 2012, at 4:18 PM,

Re: Stack Version Comparison Tool

2012-06-22 Thread Dick Kriesel
On Jun 22, 2012, at 6:43 PM, Peter Haworth wrote: > ... opening up a huge can of worms ... Hi, Peter. Significant differences between versions can happen at least a few more places: 1) multi-dimensional arrays stored in custom properties (for example, app settings) 2) the object hierarchy 3)

Re: Array Filtering

2012-06-16 Thread Dick Kriesel
On Jun 16, 2012, at 8:34 AM, Peter Haworth wrote: > Wondering why rarray is passed by reference? In the spirit of passing by reference, the answer is: Refer to the dictionary under "@" for a user contributed note from oli...@runrev.com. In the spirit of passing by value, the answer is: Passin

Re: Array Filtering

2012-06-15 Thread Dick Kriesel
On Jun 15, 2012, at 3:21 PM, Bob Sneidar wrote: > Hi all. > > I am wondering if anyone has developed an Array Filter procedure that would > give me all the rows of an array matching a certain criteria? For instance, > let's say I wanted all the rows whose key "name" contained "bob" and have it

Re: Passing parameters by reference

2012-03-12 Thread Dick Kriesel
On Mar 12, 2012, at 11:41 AM, Pete wrote: > I guess you might say Dick is array of sunshine in this dark world of LC we > live in? Oh, for Pete's sake! ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsu

Re: Passing parameters by reference

2012-03-12 Thread Dick Kriesel
On Mar 12, 2012, at 11:12 AM, Mark Wieder wrote: > Dick is well known as the master of arrays. I've learned to just > accept his advice without questioning. I didn't know that! But, I make so many misteaks that I have to recomend that you resume questoining. -- Dick ___

Re: Passing parameters by reference

2012-03-12 Thread Dick Kriesel
On Mar 12, 2012, at 10:19 AM, Pete wrote: > I'm wondering how you found about about this key values array feature? I > can't find any mention of it in the dictionary or the reference manual and > it sure seems like something that should be known! I found it while looking through bug reports for

Re: Passing parameters by reference

2012-03-10 Thread Dick Kriesel
On Mar 9, 2012, at 5:05 PM, Dar Scott wrote: > Maybe the array could be global (or passed as a parameter) and the subscript > passed. ... There might be problems I don't see right off, such as access to > the same array at two different levels at the same time. Hi, Dar. LC has a way to get a

Re: How to use an array to solve the following...

2012-02-20 Thread Dick Kriesel
On Feb 20, 2012, at 9:37 PM, Kay C Lan wrote: > Anyone want to test the speed of finding data in a 100 line variable > using char -1 of word -1 of item -1 of line -1? Hi, Kay. Sure. How do I get the script? I'd guess that almost all the time goes into the line -1, and within that line the

Re: "Redraws will be flushed" translation

2012-01-29 Thread Dick Kriesel
On Jan 29, 2012, at 9:23 PM, J. Landman Gay wrote: > Geek-speak in the 5.0.2 release notes say that "redraws will be flushed" at > various times. I assume this means "redraws will occur"? > Or, maybe, "Redraw has occurred, so any redraws in the pending messages can and will be flushed." -- Di

Re: how to compare 2 very large textfiles

2011-10-06 Thread Dick Kriesel
On Oct 5, 2011, at 3:00 PM, Matthias Rebbe wrote: > Hi, > > i need to compare two very large text files with about 5000 - 7000 lines each > with a lines size of up to 256 chars. > > I need to find out if there are lines missing in either file a or file b. > > What is the best way to do this wi

Re: Tell me I'm not crazy

2011-09-19 Thread Dick Kriesel
On Sep 19, 2011, at 1:30 PM, Tereza Snyder wrote: > "(tTestA1 <> tTestA2)" is not the same as "not(tTestA1 = tTestA2)" when the > arrays are unequal. OK, Tereza, you're not crazy. The dictionary entry for "<>" says: "Use the <> (inequality) operator to compare two numbers or to compare two st

Re: repeat with i=

2011-07-13 Thread Dick Kriesel
On Jul 13, 2011, at 7:53 PM, Nonsanity wrote: > I like Pete's best - closest to what I was thinking - I like Jerry's best - it's better than I was thinking ... Jerry's is less code executed less often: one statement once versus two statements for each item. -- Dick _

Re: Using groups as custom dialogs: a solution for Mac, PC and iOS

2011-07-09 Thread Dick Kriesel
On Jul 9, 2011, at 7:57 AM, Chipp Walters wrote: > Hmmm. Not sure that works. Hi, Chipp. I was thinking your code fragment had come from a *command*. If it had, then I think my code fragment would've been equivalent to yours. In a *function*, you could do it like this: send "initMe" && ch

Re: Using groups as custom dialogs: a solution for Mac, PC and iOS

2011-07-09 Thread Dick Kriesel
On Jul 9, 2011, at 1:20 AM, Chipp Walters wrote: > Here's one for you, Dick.. > In the above mentioned stack there's this part of a script, which is used to > pass the function params onto a handler: > > *if* the paramcount = 0 *then* > > *send* "initMe" to tObj > > *else* > >

Re: Using groups as custom dialogs: a solution for Mac, PC and iOS

2011-07-09 Thread Dick Kriesel
quot;test" to value("altAnswerColor(" & quote & "green" & quote & )",long id of stack "altAnswerColor") end color1 Does that answer your question, Chipp? -- Dick On Jul 8, 2011, at 10:57 PM, Chipp Walters wrote: > Cool, Dick! How would one

Re: Using groups as custom dialogs: a solution for Mac, PC and iOS

2011-07-08 Thread Dick Kriesel
On Jul 8, 2011, at 4:17 PM, Chipp Walters wrote: > on mouseUp > start using stack "altAnswerColor" > get altAnswerColor() > set the backcolor of grc "test" to it > stop using stack "altAnswerColor" > end mouseUp > > Sure, two extra lines, Want to use fewer lines, Chipp? How about this?

Re: object beneath mouseLoc?

2011-07-05 Thread Dick Kriesel
On Jul 4, 2011, at 5:55 PM, Nicolas Cueto wrote: >> Didn't work well, though. The target object's id got returned, but the >> mouseMove wouldn't exit. Nicolas, The mouseMove in that old example was just to demonstrate how to invoke the core code, and to show that the result of executing it ch

Re: object beneath mouseLoc?

2011-07-04 Thread Dick Kriesel
Hi, Nicolas. Your problem sounded familiar, so I found a relevant previous post. Does it work for you? On 3/19/07 3:38 AM, "Dick Kriesel" wrote: > Here's another technique for identifying the object at the mouseLoc. This > technique is different because it works wi

Re: Upper/Lower case issue

2011-07-02 Thread Dick Kriesel
On Jul 2, 2011, at 9:42 AM, J. Landman Gay wrote: > The entire engine is case insensitive, not just object names. Hi, Jacque. I guess that's why union and intersect can produce wrong results for mixed-case strings. Is that right? -- Dick ___ use-

Re: why does lock screen doesn't locks the screen?

2011-07-01 Thread Dick Kriesel
Hi, Tiemo. Does it happen in a standalone? from the dictionary: Note: When using script debug mode, the screen cannot be locked and the lock screen command has no effect. -- Dick On Jul 1, 2011, at 1:14 AM, Tiemo Hollmann TB wrote: > Hello, > > In a function I set the screenMouseLoc to fou

bugs in union and intersect?

2011-06-28 Thread Dick Kriesel
They both fail with caseSensitive true. on mouseUp local a,b,c,d set the caseSensitive to "true" put 1 into a["a"] put 2 into b["b"] put 3 into b["B"] union a with b -- missing a["b"] put 1 into c["c"] put 2 into c["C"] put 3 into d["c"] intersect c with d -

Re: filter?

2011-06-23 Thread Dick Kriesel
On Jun 22, 2011, at 10:58 PM, Pete wrote: > I may be wrong, but I don't think intersect solves the problem. If I > understand the dictionary correctly, this will remove all the t1 keys that > do NOT match t2 keys so it does the opposite of what is needed. Thanks, Pete. I misunderstood the OP.

Re: filter?

2011-06-22 Thread Dick Kriesel
On Jun 22, 2011, at 7:30 PM, J. Landman Gay wrote: > On 6/22/11 9:19 PM, Michael Kann wrote: >> If you want to use a SORT you can try something like the following: >> >> on mouseUp >> put "1,2,3,4" into v >> put "1,2,3,4,5"& cr before v >> replace comma with cr in v >> sort v >> repeat for each

Re: Has anyone experimented with memo functions in LC?

2011-06-16 Thread Dick Kriesel
e to do something like this in LC I'd > want to implement something similarly robust and simple to use. > > As to why I want to: no particular reason, other than memo seems vaguely > possible in LC, and a useful thing to have. I like pushing the language > forward. > &g

Re: Has anyone experimented with memo functions in LC?

2011-06-14 Thread Dick Kriesel
Hi, Geoff. Here's a way to memoize without parsing the functions' arguments, so commas won't be a pain. local sMemo function memoize pFunctionName, pParam1, pParam2 local tDigest put md5( the params ) into tDigest if tDigest is among the keys of sMemo then get sMemo[ tDigest ]

Re: Logical Expressions

2011-06-06 Thread Dick Kriesel
Now that you've made your code work, you can consider making it shorter and faster. LiveCode supports the syntax: put into For example, put gUSL <= pos_vrange and gUSL >= neg_vrange into Tester[x]["rng_check"] -- Dick On Jun 6, 2011, at 12:37 AM, Van Brollini wrote: > stupid mistake. was

Re: How to sync multiple functions / routines in parallel

2011-04-23 Thread Dick Kriesel
On 4/23/11 2:11 PM, "Glen Bojsza" wrote: > Good thoughts on approaches... I am starting down the rabbit hole! > > thanks Once down in the hole, you can run a second database, feed it the transaction stream ten seconds delayed, pause the stream while you execute queries with time-consistent resu

Re: Efficient code for accessing the items (or lines) in a variable.

2011-02-20 Thread Dick Kriesel
On 2/19/11 4:44 PM, "Alex Tweedly" wrote: >> put 1 into tCurrentItemCharOffset >> repeat with i = 1 to the number of items in tData >> ... item 1 of (char tCurrentItemCharOffset to -1 of tData) ... >> add the number of chars in item 1 of (char tCurrentItemCharOffset >> to -1 of tData) +