Search found 113 matches
- Fri Nov 03, 2023 7:49 pm
- Forum: Getting Started with LiveCode - Experienced Developers
- Topic: Array referencing
- Replies: 22
- Views: 44697
Re: Array referencing
@mwieder: Array literalts [] and {} syntax is new in LC10, dynamic paths have been around a while (I'm tempted to say since before 6.0 but I'm not 100% sure). @LCMark: Comments for bug id 7166 indicate dynamic paths appeared first in release 3.5. Dynamic paths are a great feature, but there's still...
- Wed Jun 21, 2023 12:08 am
- Forum: Getting Started with LiveCode - Complete Beginners
- Topic: Debugger/stepping back thru handler/variable calls/values per run
- Replies: 15
- Views: 11755
Re: Debugger/stepping back thru handler/variable calls/values per run
In LC as long as you're in active debug mode you can examine the variables at any point in the current context by set the debugContext to <index into the executionContexts> debugDo "get the variables" The variables will be comma-delimited, with one type per line. Then you can query for an individua...
- Tue Jun 20, 2023 3:51 am
- Forum: Getting Started with LiveCode - Complete Beginners
- Topic: Debugger/stepping back thru handler/variable calls/values per run
- Replies: 15
- Views: 11755
Re: Debugger/stepping back thru handler/variable calls/values per run
I think there's a control in the built-in debugger to do that as well, but someone else will have to chime in with a definitive answer. When debugging, directly below the title bar of the script editor window, the seventh control from the left is the execution context menu. The script field and the...
- Sun May 07, 2023 10:29 pm
- Forum: Getting Started with LiveCode - Experienced Developers
- Topic: Duplicate Remover
- Replies: 19
- Views: 17424
Re: Duplicate Remover
The split command seems to ignore the caseSensitive property for the keys but instead apply it to the values. The following test shows the wrong results in variable t. command foo local t put "A,B" & cr & "a,b" into t set caseSensitive to false split t by cr and "" breakpoint end foo I tested using ...
- Wed May 03, 2023 3:02 am
- Forum: Getting Started with LiveCode - Experienced Developers
- Topic: Duplicate Remover
- Replies: 19
- Views: 17424
Re: Duplicate Remover
I need to limit the list to the search and removing duplicates (done), but also removing lines where the "_" delimited items are just inverted. Hi, Trevix. Here's a technique that prevents duplicates and reversals in data like yours. And it avoids repeatedly invoking lineOffset. on test local t, k,...
- Wed Mar 22, 2023 11:25 pm
- Forum: Getting Started with LiveCode - Experienced Developers
- Topic: filter array
- Replies: 10
- Views: 5219
Re: filter array
For me that is a very important point: it explains why my mis-coded filter statement took twice as long as Bernd's repeat loop. Now the two techniques' times appear very similar.
Thanks, Stam.
--Dick
- Tue Mar 21, 2023 7:45 pm
- Forum: Getting Started with LiveCode - Experienced Developers
- Topic: filter array
- Replies: 10
- Views: 5219
Re: filter array
Hi, James. Here's a technique that's less work for you and for LC. on foo local ctext put "foo" into ctext[1]["ref"] put "bar" into ctext[2]["text"] put "baz" into ctext[3]["text"] filter the keys of ctext where ctext[each]["text"] contains "ba" breakpoint end foo Does that work for you? -- Dick
- Sun Mar 12, 2023 9:56 pm
- Forum: Talking LiveCode
- Topic: Find out where a command is triggered from
- Replies: 9
- Views: 5650
Re: Find out where a command is triggered from
... I would like to find out from where the command in which this statement is housed is called from so I can use this for refering to the correct card and stack. Is this possible? Is there a statement I can use to find out where the command was called from? ... Hi, Paul. Yes: see "executionContext...
- Wed Dec 07, 2022 3:38 am
- Forum: Getting Started with LiveCode - Complete Beginners
- Topic: [SOLVED] Getting Index of Characters
- Replies: 17
- Views: 10794
Re: [SOLVED] Getting Index of Characters
Thanks all, great learning experience for working with text! There's more learning nearby: reconsider the algorithm. It scans the whole text for each given letter. For a thousand input lines of 100 characters each, and for 26 letters, it reads at least 2.5 million characters. An alternative approac...
- Mon Sep 12, 2022 4:29 am
- Forum: Getting Started with LiveCode - Complete Beginners
- Topic: Need for Speed
- Replies: 22
- Views: 5802
Re: Need for Speed
agreed, in general, but here split can be adequate without combine:
Code: Select all
function dedupeViaSplit pLines -- not sustaining the sequence
split pLines by cr as set
return the keys of pLines
end dedupeViaSplit
- Tue Aug 23, 2022 11:28 pm
- Forum: Getting Started with LiveCode - Complete Beginners
- Topic: Searching for all instances of a string
- Replies: 15
- Views: 9615
Re: Searching for all instances of a string
... I guess I tend to assume there are easier ways to do things most of the time but in this case, the method for this particular manipulation wasn't quite as straight-forward as I assumed it would be. --- Since this old thread is current again, let's give its subject some fresh consideration. Here...
- Tue Apr 05, 2022 9:23 am
- Forum: Talking LiveCode
- Topic: Sort question
- Replies: 30
- Views: 8382
Re: Sort question
This script produces the same result with four less lines of code ... Since you're interested in less code, how about this: 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 c...
- Fri Jan 28, 2022 4:57 am
- Forum: Getting Started with LiveCode - Complete Beginners
- Topic: Who is "me" in this line?
- Replies: 7
- Views: 2888
Re: Who is "me" in this line?
- Sat Jan 22, 2022 3:30 am
- Forum: Talking LiveCode
- Topic: Filtering question
- Replies: 19
- Views: 9294
- Fri Jan 21, 2022 7:41 am
- Forum: Talking LiveCode
- Topic: Filtering question
- Replies: 19
- Views: 9294
Re: Filtering question
I join in the praising - that was an awesome solution, Dick! I'll remember that method for future cases. I think a Wordle solver would be a great case study as a LiveCode project. The above is already a start, and then increasingly complex "singling out" algorithms can be implemented, based on corr...