Search found 3436 matches

by bn
Wed Feb 10, 2021 12:19 am
Forum: Getting Started with LiveCode - Complete Beginners
Topic: A question about call by reference
Replies: 23
Views: 1650

Re: A question about call by reference

That is a not-so-insignificant improvement. I wonder if that would be something to suggest to the team as an improvement? Brian, these are pretty extrem cases in the IDE but they show nicely what @ can do when used in the right place. Maybe when the team has more time to look at stuff like this I w...
by bn
Mon Feb 08, 2021 7:09 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Random numbers with no duplicates
Replies: 7
Views: 549

Re: Random numbers with no duplicates

Hi Mike, something like this... on mouseUp repeat until the number of lines in tData is 6 put random(10) into tTest if tTest is not among the lines of tData then put tTest & cr after tData end if end repeat delete char -1 of tData -- a return -- the list is not orderd -- order list -- sort tData asc...
by bn
Mon Feb 08, 2021 3:00 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: A question about call by reference
Replies: 23
Views: 1650

Re: A question about call by reference

To make it easier to test passing parameters by reference or without for variables that change in between passing here is a stack to test without fiddling with the IDE as in the example above. Though that is a real world example. In the stack below you have the option to load some IDE stacks of diff...
by bn
Mon Feb 08, 2021 2:30 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: A question about call by reference
Replies: 23
Views: 1650

Re: A question about call by reference

......... As stated earlier, if you are not changing the value then there is probably not a huge cost since the engine does a copy on write. (In a tight loop with many calls you could achieve some speed gains by explicitly doing a pass by reference since the engine wouldn't need to set up the addit...
by bn
Mon Jan 18, 2021 2:28 am
Forum: Talking LiveCode
Topic: Not a number is a number, problem
Replies: 28
Views: 1346

Re: Not a number is a number, problem

Another way to force a string compare note if item 1 of inLine begins with aCode and (length(item 1 of inline) = length(aCode)) then on mouseUp pMouseBtnNum put "NAN,HTH,$42.70" into inLine put "NAN" into aCode get ((aCode is strictly a string) and ((item 1 of inLine) is strictly a string)) answer "...
by bn
Sun Jan 17, 2021 1:30 am
Forum: Talking LiveCode
Topic: Not a number is a number, problem
Replies: 28
Views: 1346

Re: Not a number is a number, problem

OK, maybe I have to explain. Infinitiy > NAN And at the same time NAN > Infinity Both are mathematically evaluated and both comparisons return true which is what I was alluding to. But who is to argue with infinity... Furthermore "2e2" is a number in Livecode and is smaller than Infinity. I just wan...
by bn
Sat Jan 16, 2021 8:09 pm
Forum: Talking LiveCode
Topic: Not a number is a number, problem
Replies: 28
Views: 1346

Re: Not a number is a number, problem

For your pleasure: on mouseUp put "Infinity" into tInf put "NAN" into tNan put tInf > tNan into tResult1 if tResult1 then put tNan & " is larger than " & tInf into tResult1 end if put tNan > tInf into tResult2 if tResult2 then put tInf & " is larger than " & tNan into tResult2 end if put "2e2" < tIn...
by bn
Wed Jan 13, 2021 3:30 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Various ways of matching a line
Replies: 14
Views: 2783

Re: Various ways of matching a line

Michael, I try to break this down a bit more hoping to make it a bit more clear when you code put word 3 of theLine into myArray[word 1 of theLine][word 2 of theLine] you create an array with 2 keys and 1 value. The keys are myArray[index][fruit] , the value is quality: myArray[index][fruit]quality ...
by bn
Wed Jan 13, 2021 3:11 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Various ways of matching a line
Replies: 14
Views: 2783

Re: Various ways of matching a line

Thank you very much. I can see that it works, but I'm having a hard time wrapping my head around it. Before you posted, I went ahead and made the functions with lineOffset, so at least that works too. Michael, which ever way you solve the problem I would take some moments to get the logic of the ar...
by bn
Wed Jan 13, 2021 2:35 pm
Forum: Getting Started with LiveCode - Complete Beginners
Topic: Various ways of matching a line
Replies: 14
Views: 2783

Re: Various ways of matching a line

Hi Michael, The trick is, how do I get the quality (last column) from the ID? If I try to put that into the associative array with this extra line in the loop: put word 3 of theLine into myArray[word 1 of theLine][word 2 of theLine] ...then that kills the ability to get the name by using myArray[2],...
by bn
Sat Jan 02, 2021 10:41 am
Forum: Announcements
Topic: [ANN] bnGuides alignment tool on livecodeshare
Replies: 17
Views: 6504

Re: [ANN] bnGuides alignment tool on livecodeshare

Hi Stam, Thank you for your kind words. Have you tried the caps-lock key down? Then the distances to either the edges of the window or the next control are shown for the blue middle guide. (After clicking the the control you have to move the mouse 1 pixel to make the distances show up) If the caps-l...
by bn
Wed Dec 30, 2020 3:37 pm
Forum: LiveCode Builder
Topic: LCB: How to evaluate an expression
Replies: 1
Views: 571

Re: LCB: How to evaluate an expression

In LCB you would use public handler testEval() returns Number variable tExpression as String variable tList as List put "10 * 20" into tExpression split tExpression by "*" into tList return (element 1 of tList parsed as number) * (element 2 of tList parsed as number) end handler I just picked up you...
by bn
Sun Dec 27, 2020 11:54 am
Forum: Talking LiveCode
Topic: ClickItem challenge
Replies: 27
Views: 2769

Re: ClickItem challenge

This works with locked fields and list fields on mouseUp put the clickCharChunk into tTemp if tTemp is empty then put "nothing clicked" beep exit mouseUp end if put word 2 of tTemp into tTemp put the number of lines of char 1 to tTemp of me into tLineNo put the number of chars of line 1 to tLineNo -...
by bn
Tue Dec 22, 2020 4:47 pm
Forum: LiveCode Builder
Topic: Trying to make Array work in repeat
Replies: 5
Views: 1322

Re: Trying to make Array work in repeat

Hi Jun,

does

Code: Select all

put (pArray[tKey] parsed  as number) * 10 into tResult[tKey]
work? I could not test it at the moment.

Kind regards
Bernd
by bn
Sat Dec 19, 2020 8:18 pm
Forum: Multimedia
Topic: Steganography Coder
Replies: 7
Views: 3065

Re: Steganography Coder

For chars use numToNativeChar and nativeCharToNum. Well . . . I wouldn't: I'd use numToCodePoint and codePointTo Num. Well, I would not use numToCodePoint, nor codePointToNum. Image data is encoded as 0 through 255, numToNativeChar and nativeCharToNum give exactly what you need. Kind regards Bernd

Go to advanced search