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 nothing I can find can get it back. Any 
> ideas? 
> 
> Bob S
> 
> 
> ___
> 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: 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
___
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: 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 
problem.
— Dick
___
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 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. The best way to set the script may be not to; that is, instead set 
the new object’s behavior to a button that contains the readable script.
— Dick
___
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: 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


function pad tString
   put "" into item 1000 of tString
   replace comma with space in tString
   return char 1 to 1000 of tString


Does that work for you?

— Dick
___
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: 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/syllabification 
, you can find the query 
that yielded "syl·lab·i·fi·ca·tion."

You might find other dictionaries that make it easier.

— Dick
___
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: 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 
>> running around in circles. Can anyone help me with this?
> 
> Making the list into an array is the easiest way but as mentioned, it will 
> destroy the original order. If the order is important then you can restore it 
> with a custom sort function...
> 


Since order must be maintained, it’s probably faster not to split and sort, and 
faster not to scan the list repeatedly using lineOffset or contains.
You could do it like this:

command removeDuplicates pDelimitedList, pDelimiter
   local tArray, tList
   set the lineDelimiter to pDelimiter
   repeat for each line tLine in pDelimitedList
  if not tArray[tLine] then -- i.e., if this line hasn't appeared already, 
then ...
 put true into tArray[tLine]
 put tLine & pDelimiter after tList
  end if
   end repeat
   delete last char of tList
   return tList for value
end removeDuplicates

— Dick
___
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: 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 text?  eg something like:
> 
> *big [“dog”, “cat”, “fish”]*

Hi, David.

regex supports alternation, so if you put "big dog|big fish" into tTarget then 
you can

filter pText with regex tTarget


Does that work for you?

— Dick
___
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: 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 repeat
>  …

Hi, Jacque. If you use sets of words, as sDictFile already is, and as Ken 
suggested, then you can eliminate the repeat loop:


split pList by cr into tUserWords
intersect tUserWords with sDictFile into tChecked
difference tUserWords with sDictFile into tNonWords


Does that turn out to be fast enough for you?

— Dick


___
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: 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


___
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: 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 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: 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:

function offsetOfNotTab pString
 local i
 repeat for each char tChar in pString
add 1 to i
if tChar <> tab then return i
 end repeat
end offsetOfNotTab

— Dick
___
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: 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?
> 
> There's a discussion about this here:
> 
> https://forums.livecode.com/viewtopic.php?f=7=33565
> 
> 
> On Jan 22, 2020, at 10:26 AM, Richard Gaskin via use-livecode 
>  wrote:

> 
> We have many handlers that deliver directory trees as lists, but arrays are a 
> different beast.  Because the depth is both unknowable and varied, I can't 
> think of a way to do this without resorting to "do".



Since that thread vanished last week, and hasn’t returned, I'm offering help 
here instead.

The list of full paths contains enough information to build an array 
representation of the directory tree.


/**

Summary: Given a list of full paths, and given the partial path they share, 
build an array representing the directory structure

pPaths: a return-delimited list of full paths

pPath: the path that was used to generate the list of full paths

Returns (array): A array with a branch node for each folder and a leaf node for 
each file

Description: Eliminate pPath from every line of pPaths. Then insert each line 
into an array.

email subject "directory tree -> array"

forum topic "f=7=33565"

*/


function arrayFromPaths pPaths, pPath -- a list of full paths, and the path 
that was used to generate the list

local tPaths, tFile, tArray

set the itemDelimiter to "/"


put char 2 to -1 of replaceText( cr & pPaths, cr & pPath & slash, cr ) into 
tPaths -- eliminate pPath from every full path

repeat for each line tPath in tPaths -- insert each file name into the array

put the last item of tPath into tFile

delete the last item of tPath

if tPath is empty then -- the file is in folder pPath

put "true" into tArray[ tFile ]

else -- the file is in a folder in folder pPath

split tPath by slash

put "true" into tArray[ tPath ][ tFile ]

end if

end repeat


return tArray

end arrayFromPaths


on mouseUp

local tPaths = "a/b/c,a/b/d/e,a/b/d/f" -- folder a/b contains file c and folder 
d, which contains files e and f

local tPath = "a/b" -- the shared partial path

replace comma with cr in tPaths


get arrayFromPaths( tPaths, tPath )


breakpoint

end mouseUp




If the topic reappears soon, I’ll repost there because reading code is easier 
there.

By, the way, thanks to RG for the bug report on my earlier posting in the 
now-vanished thread.

— Dick



___
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: 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, 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 tArray 
>>>> then
>>> slightly easier, at least:
>>> function isSequence p
>>> return the extents of p is 1, number of elements in p
>>> end isSequence
>> 
>> If I'm understanding things right there's more to it:
>> The keys all have to be integers and (I think) only those integers from 1 to 
>> (the number of keys).
> 
> That was my understanding as well.
> .Jerry

"the extents" implements those rules, so "isSequence" doesn’t need to.

Or is there evidence "isSequence" fails?

— Dick
___
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: 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 tArray 
> then

slightly easier, at least:
function isSequence p

return the extents of p is 1, number of elements in p

end isSequence

— Dick
___
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: 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:
> 
> send "selectionChanged " to  in 
> 
> where  identifies the sender.
> 

Or, if you don’t want to create such parameters to identify your senders, you 
could use the executionContexts:

send "selectionChanged item 2 of line -1 of the executionContexts" to 
 in 

Or, if you want to reduce clutter in your many senders, you could just:

send "selectionChanged the executionContexts" to  in 

— Dick


___
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: Behaviors not honoring script local variables??

2018-06-27 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
___
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: Q on Accessing multi-dimension arrays.

2018-04-26 Thread Dick Kriesel via use-livecode

> On Apr 26, 2018, at 12:14 PM, Brian Milby via use-livecode 
> > wrote:
> 
> tPath can also be thought of as a (proper) list which makes a little more
> sense. Mark W would need to answer the why.

The following excerpts provide a quote from 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 known!
> 


> On Mar 12, 2012, at 1:18 PM, Dick Kriesel  > wrote:
> 
> I found it while looking through bug reports for arrays, in 
>  > dated 2008-11-28.  So, 
> thanks be to Mark Waddingham and David Bovill for that.
> 
> For convenience, here's Mark's reply to David:
> 
> Thanks for the suggestion.
> 
> This is on the list to include for the next version. In that version with:
>  put tValue into tArray[tKey]
> (indeed anywhere you can currently do tArray[tKey])
> 
> The meaning of 'tKey' will be extended:
>  1) If it is a string then it is as it is now
>  2) If it is a numerically keyed array starting at 1, then it will mean:
>   put tValue into tArray[tKey[1]][tKey[2]]...[tKey[n]]
> where  is the number of elements in tKey
>  3) Otherwise it is an error.
> 
> This will allow you to construct an array containing the path to the key you
> want to modify/fetch/delete dynamically.
> 
> I agree, the feature's worth adding into the dictionary and manual.
> 
> -- Dick



___
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