Search found 789 matches
- Mon Apr 05, 2021 11:57 am
- Forum: Getting Started with LiveCode - Complete Beginners
- Topic: Find text between two different delimiters/tags using Regex
- Replies: 14
- Views: 8895
Re: Find text between two different delimiters/tags using Regex
Hi Thierry - and and thanks for jumping in ;) I forgot to add the non-greedy operator '?' code should be (?<=delim1)(.*?)(?=delim2) please don't give too much heavy food to my 'sick-hatred-anti-regex' friends :roll: this will work too with less typing: (1) delim1(.*?)delim2 he's an example using th...
- Sat Apr 03, 2021 4:09 pm
- Forum: Getting Started with LiveCode - Complete Beginners
- Topic: Find text between two different delimiters/tags using Regex
- Replies: 14
- Views: 8895
Re: Find text between two different delimiters/tags using Regex
(?<=delim1)(.*)(?=delim2) hope that helps.. Hello Stam, here is a little saturday night quiz... I've replaced delim1 and delim2 by _1 and _2 on mouseUP constant T = "_1qwerty_2 _1asdf_2" put "Text in: " &tab& T &cr& \ "regex:" &tab& "result:" &cr into fld 1 constant rexStam1 = "(?<=_1)(.*)(?=_2)" i...
- Tue Mar 23, 2021 2:25 pm
- Forum: Talking LiveCode
- Topic: save standalone from script?
- Replies: 9
- Views: 4579
Re: save standalone from script?
..... But, as good practice, your way is definitely more robust. Craig Thanks, and yes, I hate any kind of numbers in any scripts :) I just tried it, though, and the process starts but will not complete. Selecting the menuItem by hand works, but not by script. Well, I didn't try the next part.... W...
- Tue Mar 23, 2021 7:13 am
- Forum: Talking LiveCode
- Topic: save standalone from script?
- Replies: 9
- Views: 4579
Re: save standalone from script?
I was able to use "select menuitem 25 of menu "File",..... Quite hasardous to use fixed values for such cases. And in the menu "File", because of the "Open Recent Files...", nothing is fixed anyway. So, a much better way: constant SaSApp = "Save as Standalone Application..." get lineOffset( SaSApp,...
- Tue Mar 23, 2021 6:45 am
- Forum: Talking LiveCode
- Topic: Rehashing Switch
- Replies: 84
- Views: 45669
Re: Rehashing Switch
I find the biggest advantage to switch is when I need to do something like Thierry wrote, though I do it this way: function checkWithSwitch switch case testA case testB case testC return false default return true end switch end checkWithSwitch much better; thanks Jacque. I'm editing my previous pos...
- Mon Mar 22, 2021 9:09 am
- Forum: Talking LiveCode
- Topic: Rehashing Switch
- Replies: 84
- Views: 45669
Re: Rehashing Switch
Interesting thread. +1 Hi all, @Craig: - do you know that swift (Apple) promote the switch/case the way you want. - do you know that until recently, python had no switch/case statement and when someone asked for an alternative, the answer was the map() function, but not the if-then-else ! This func...
- Fri Mar 19, 2021 4:21 pm
- Forum: Internet
- Topic: Execute JavaScript from Livecode
- Replies: 23
- Views: 18607
Re: Execute JavaScript from Livecode
Here is a working solution in pure LIVECODE, using the POST command.I have an API from textbelt.com that allows you to send a text message
from your computer to a mobile phone.
they also have other languages but not LiveCode
Regards,
Thierry
- Fri Mar 12, 2021 9:46 am
- Forum: Talking LiveCode
- Topic: Need to make Grids with colors??
- Replies: 31
- Views: 10237
Re: Need to make Grids with colors??
Just so I understand, DataGrids are just fields that are one next to each other (and created by code for automation)? Hi Finn, look at this screenshot: screenshot 2021-03-12 à 09.41.27.jpg I've made a new stack, dropped a Datagrid object on the card, and selected the datagrid to show its PI. So, yo...
- Thu Mar 11, 2021 5:20 pm
- Forum: Talking LiveCode
- Topic: Hide custom plugins opening Script Editor
- Replies: 25
- Views: 9521
Re: Hide custom plugins opening Script Editor
Here is a plugin (actually, I did edit the revExample.rev plugin for this purpose) which will detect if the SE is opened or closed. See bottom-left label which is red or green according to the SE state. your plugin seems not able to intercept suspending or resuming of Script Editor. Sorry for the d...
- Tue Mar 09, 2021 9:14 am
- Forum: Getting Started with LiveCode - Complete Beginners
- Topic: Sort multidimensional array
- Replies: 87
- Views: 54948
Re: Sort multidimensional array
Thanks Brian, very helpful tip - finally made sense when examining the foldState array. +1 As I wasn't aware of this widget property, I did play a bit with it, and here is an interesting screenshot of a tree view widget on the left, and the details of foldState in the debugger... Be aware of extra ...
- Fri Mar 05, 2021 6:07 pm
- Forum: Getting Started with LiveCode - Complete Beginners
- Topic: Sort multidimensional array
- Replies: 87
- Views: 54948
Re: Sort multidimensional array
I suspect the sortIndex approach will be very helpful if dealing with a large array of BLOBs for example, but in most 'normal' use cases there isn't much of a difference True, absolutely true ! Here is a benchmark for an array of 4609 entries, full size of the json input data > 3 Mbytes. First numb...
- Fri Mar 05, 2021 4:55 pm
- Forum: Teaching with LiveCode
- Topic: is a numeric value ECMA-404
- Replies: 5
- Views: 5095
Re: is a numeric value ECMA-404
Hi, in fact, I didn't check the validity of your function; I did trust you :) just rewriting your code a tiny bit.... this time, I drop the last part "is false" and add not before ( function _isNumericValue pValue return pValue is a number \ and not ( char 1 of pValue is 0 \ and char 2 of pValue is ...
- Fri Mar 05, 2021 3:38 pm
- Forum: Teaching with LiveCode
- Topic: is a numeric value ECMA-404
- Replies: 5
- Views: 5095
Re: is a numeric value ECMA-404
.... So this is how the new version looks it is considerably smaller and faster. function _isNumericValue pValue if pValue is not a number then return false if char 1 of pValue is 0 and char 2 of pValue is not "." and the length of pValue is not 1 or char 1 of pValue is not in "-0123456789" then re...
- Thu Mar 04, 2021 1:41 pm
- Forum: Talking LiveCode
- Topic: Hide custom plugins opening Script Editor
- Replies: 25
- Views: 9521
Re: Hide custom plugins opening Script Editor
i just need to hide plugins when the script editor window comes to the foreground, so i need to identify the state changes of the window itself Hi Paul, Here is a plugin (actually, I did edit the revExample.rev plugin for this purpose) which will detect if the SE is open or closed. See bottom-left ...
- Wed Mar 03, 2021 11:43 am
- Forum: Getting Started with LiveCode - Complete Beginners
- Topic: Sort multidimensional array
- Replies: 87
- Views: 54948