Search found 87 matches

by rkriesel
Tue Sep 15, 2020 1:59 am
Forum: Engine Contributors
Topic: the microseconds
Replies: 20
Views: 2821

Re: the microseconds

Hi, Mark. I share the motivation, but satisfy it with "the long milliseconds," which distinguishes nanoseconds. That maximizes precision, and, with enough test results and additional measures ( median, standard deviation, and many more), accuracy beyond milliseconds. (Disclaimer: I'm not a statistic...
by rkriesel
Fri Sep 11, 2020 12:50 am
Forum: Talking LiveCode
Topic: Separate the interface from running background routines (Solved)
Replies: 13
Views: 1394

Re: Separate the interface from running background routines (Solved)

dunbarx wrote:
Fri Sep 11, 2020 12:36 am
I have always wanted to be able to set the recursion limit.
Hi, Craig. Here's an example from the dictionary:

Code: Select all

set the recursionLimit to 20
-- Dick
by rkriesel
Fri Sep 04, 2020 3:54 am
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Whole numbers
Replies: 30
Views: 2282

Re: Whole numbers

EddieLee wrote:
Thu Sep 03, 2020 11:53 pm
Is there any livecode function or code that can detect if a variable is a whole number?

Code: Select all

if c is an integer
Hi, Eddie. See "integer" in the dictionary.
-- Dick
by rkriesel
Wed Aug 19, 2020 9:04 am
Forum: Getting Started with LiveCode - Experienced Developers
Topic: Equivalent of classes in LiveCode
Replies: 142
Views: 14726

Re: Equivalent of classes in LiveCode

Hi, Brian. I like your ".constructor" suggestion for ease of understanding the action. Why exclude "object.constructor" from the action? It could take some of the code from newObject. Or if "object.constructor" doesn't exist, the unhandled dispatch would be harmless. Thanks for sharing your insight....
by rkriesel
Mon Aug 17, 2020 7:42 am
Forum: Getting Started with LiveCode - Experienced Developers
Topic: Equivalent of classes in LiveCode
Replies: 142
Views: 14726

Re: Equivalent of classes in LiveCode

Here's the latest. Hi, mwieder. Thanks for investing in this effort, and for sharing progress and current challenges. Since constructors and destructors in general need to know what they're working on, and since the target and me don't suffice, handlers newObject and deleteObject can help by passin...
by rkriesel
Thu Aug 13, 2020 6:18 am
Forum: Getting Started with LiveCode - Experienced Developers
Topic: Equivalent of classes in LiveCode
Replies: 142
Views: 14726

Re: Equivalent of classes in LiveCode

Hi, Bernd. Thanks for the stack. I'm still considering it.

Meanwhile, how about, by convention, passing the object id to every constructor and destructor, instead of relying on "me" to identify the object?

-- Dick
by rkriesel
Wed Aug 12, 2020 3:04 am
Forum: Getting Started with LiveCode - Experienced Developers
Topic: Equivalent of classes in LiveCode
Replies: 142
Views: 14726

Re: Equivalent of classes in LiveCode

before birth pX, pY, pdX, pdY, pLifeSpan, pParticleSource, pGravity --dispatch "birth" to the behavior of me with px, py, pdX, pdY, pLifeSpan, pParticleSource -- blocked BN if pGravity is empty then set the gravity of me to 1 else set the gravity of me to pGravity end if end birth before animate se...
by rkriesel
Sat Aug 08, 2020 12:16 am
Forum: Getting Started with LiveCode - Experienced Developers
Topic: [SOLVED] Something is not right with my data
Replies: 45
Views: 4310

Re: [SOLVED] Something is not right with my data

put the monthNames into tMonthsArray replace CR with (TAB & CR) in tMonthsArray split tMonthsArray by CR and TAB repeat for each item aMonth in field "Month Data" add 1 to tMonthsArray[ aMonth] end repeat combine tMonthsArray using CR and TAB put tMonthsArray into field "Monthly Counts" Hi, Thierry...
by rkriesel
Wed Aug 05, 2020 7:06 pm
Forum: Getting Started with LiveCode - Experienced Developers
Topic: [SOLVED] Something is not right with my data
Replies: 45
Views: 4310

Re: [SOLVED] Something is not right with my data

get it & line i of the monthNames, tCounts[ i ] & cr @dick, should the "it" in that line be an "i"? Hi, Jacque. "it" works here, containing all the lines "it" contained before the statement, and the statement appends another line. The syntax is a compact equivalent of "put <line> & cr after <lines>...
by rkriesel
Wed Aug 05, 2020 6:42 am
Forum: Getting Started with LiveCode - Experienced Developers
Topic: [SOLVED] Something is not right with my data
Replies: 45
Views: 4310

Re: Something is not right with Livecode Strings

In a moment of clarity, I wrote the following code in a new project with nothing loaded: ... It works 100%. ... Hi, karmacomposer. Now that your code works, you might like to simplify it, as a way to learn simpler techniques, and accelerate future coding. Here's a suggestion: function testMonthsAnd...
by rkriesel
Mon Jul 27, 2020 11:16 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: looping through an array of JSON objects
Replies: 4
Views: 619

Re: looping through an array of JSON objects

... on mouseUp put field 1 into tData put JSONToArray(tData) into tArray repeat for each key aKey in tArray if tArray[aKey]["name"] = "max" then put "Max" & cr & tArray[aKey]["number"] into field 2 exit repeat -- just bail out because you have found what you were looking for end repeat end mouseUp ...
by rkriesel
Tue Jul 21, 2020 12:44 am
Forum: Getting Started with LiveCode - Experienced Developers
Topic: [SOLVED] Filtering an array...
Replies: 11
Views: 1515

Re: Filtering an array...

... repeat for each key tKey in tArray if tArray[tKey]["abc"] = "xyz" then put tArray[tKey] into tSelected[tKey] end repeat ... results in tSelected having non-contiguous numeric keys in the first dimension ... That can be shorter and faster without the repeat loop: filter elements of tArray where ...
by rkriesel
Thu Apr 09, 2020 10:15 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Combination of list of word
Replies: 3
Views: 715

Re: Combination of list of word

18 words per sequence
18! sequences
5 bits per word (minimum to distinguish 18 individuals)
a billion bytes per gigabyte
~= 70 million gigabytes in your one file

You can be very sure, as you say, "there will be problems to do it."
-- Dick
by rkriesel
Thu Apr 09, 2020 4:40 am
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Combination of list of word
Replies: 3
Views: 715

Re: Combination of list of word

Hi, Alessio. See "https://en.wikipedia.org/wiki/Permutation" section "k-permutations of n" Since the formula for the number of k-permutations is n factorial, generating the sequences can be very time-consuming. Here's a summary from my code, which follows. name count,sequence count,milliseconds 2,2,...
by rkriesel
Thu Jan 23, 2020 7:50 am
Forum: Talking LiveCode
Topic: How to split a folder structure into an array with sub arrays?
Replies: 11
Views: 2465

Re: How to split a folder structure into an array with sub arrays?

...a list of full paths to the files within the specified folder ... The list of paths has the content for the array, so you can build the array without code to read directories: function arrayFromPaths pPaths local tArray, tFile set the itemDelimiter to "/" repeat for each line tPath in pPaths put...

Go to advanced search