Re: Missing function selectedWords/selectedTrueWords

2018-08-31 Thread Mark Waddingham via use-livecode

On 2018-08-31 19:47, Tore Nilsen via use-livecode wrote:

This information is useful if you want to implement changes to the
styles of the selected text, where textStyles report mixed. In a
selection with mixed styles, setting the textStyle has to be done on a
word by word basis (or char by char basis if different styles are used
within a word).


You can actually manipulate individual textStyles for just this 
purposes:


  set the textStyle["bold"] of  to true -- or false

All styled text editors I know of work on the complete selected range 
(including whitespace), rather than just on the words...


Warmest Regards,

Mark.

P.S. I'm not saying that 'the wordIndex of ' might not be useful, 
but I do wonder if the above actually solves your problem in an easier / 
more consistent with the rest-of-the-world way ;)


--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
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: Missing function selectedWords/selectedTrueWords

2018-08-31 Thread hh via use-livecode
You could try:

on mouseUp
  put the selectedChunk into sc
  put word 2 of sc into strt
  put word 4 of sc into stp
  put fld word 7 of sc into txt
  put selectedWords(strt,stp,txt) into fld "out"
end mouseUp

function selectedWords strt,stp,txt
  put the num of words in char 1 to strt of txt into w1
  put the num of words in char 1 to stp of txt into w2
  return w1,w2 -- start and stop
end selectedWords

Of course you have an uncertainty if your selection
starts or stops within words.

Similar for truewords ...

___
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: Missing function selectedWords/selectedTrueWords

2018-08-31 Thread Tore Nilsen via use-livecode
Microsoft Word seems to behave the way you suggest, in the sense that if any 
given text style is present among the words in the selection then it is 
removed. Pages behaves differently. If a given text style is true for some of 
the words in the selection, Pages will initially keep this style for these 
words and add it to the styles of the rest of the chunk. If a given text style 
is true/false for all words in the selection, Pages will set the text style to 
false/true accordingly. To mimic these behaviours it would be useful to be able 
to do so on a word by word basis. 

An alternative way to handle this could be that the textStyles function 
returned an numeric array with the number of the words as key and the text 
styles for the words as value.

Best Regards,
Tore
> 31. aug. 2018 kl. 21:22 skrev Mark Waddingham via use-livecode 
> :
> 
> You can actually manipulate individual textStyles for just this purposes:
> 
>  set the textStyle["bold"] of  to true -- or false
> 
> All styled text editors I know of work on the complete selected range 
> (including whitespace), rather than just on the words...
> 
> Warmest Regards,
> 
> Mark.


___
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


Missing function selectedWords/selectedTrueWords

2018-08-31 Thread Tore Nilsen via use-livecode
I am struggling with a problem related to the selection of parts of a text in a 
field. I would like to know which words are selected, that is, I would like to 
know the range of words selected. None of the functions available in LiveCode 
will do this. If I use selectedChunkI will get the range of characters in the 
selection. If I use selectedText or just the selection I will get the words 
that are selected, but not where in the range of words of the text the selected 
words are placed. 

I find this strange, as it is possible to manipulate any given word (or 
trueWord) by referring to its placement in the text by number. I can delete, 
put into, put before or after, alter style, size or font of any given word by 
referring to its position in the text by number. I would think that it would be 
possible to implement a function called selectedWords or selectedTrueWords as a 
way of getting this information.

This information is useful if you want to implement changes to the styles of 
the selected text, where textStyles report mixed. In a selection with mixed 
styles, setting the textStyle has to be done on a word by word basis (or char 
by char basis if different styles are used within a word).

Now I probably will have to use the selectedChunk, and loop through the text, 
character by character, keeping track of word delimiters to decide the range of 
words selected. I can do that, but I cannot possibly expect my students to 
really understand what they are doing, two weeks into their course. If said 
functions had been available, it would have been much easier to teach my 
students about all the powerful text handling features in LiveCode by making a 
small and powerful text editor.

Am I the only person who would like to see these functions implemented?

Best regards
Tore Nilsen
___
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: On Performance of Array Access

2018-08-31 Thread Curry Kenworthy via use-livecode



Mark W:

> 6.7.11: 1117ms
> 9.0.1:  4020ms
> PR6671: 1017ms

Now THAT'S the kind of news that makes a Friday special! Honestly I was 
quite disappointed lately in 9's array speed, but this gives me a lot of 
hope, and it also helps in the practical details of code planning for 
projects. Thank you Mark.


Arrays are not the only issue, but it's a great start and one of the 
areas I was going to advocate. Even repeats with math calculations are 
also a problem in 9, for example. But I have full confidence, as I said 
on this list recently, that 9+ should be able to beat 6 in most areas 
when optimized. I will test your build and post my test stack and 
results here as soon as I get a chance.


Best wishes,

Curry Kenworthy

Custom Software Development
LiveCode Training and Consulting
http://livecodeconsulting.com/


___
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: Missing function selectedWords/selectedTrueWords

2018-08-31 Thread Tore Nilsen via use-livecode
I got a bit confused there. Pages behaves as you say, Microsoft Word would turn 
off bold on the initial push of the button, then adding bold to the styles the 
next time.

This is why I thought I needed to find the style of each word in a group of 
words when the the textStyles is mixed. And I still think that is what I need 
in order to mimic the behaviour of either Word or Pages.

Best Regards
Tore



> 31. aug. 2018 kl. 21:39 skrev Mark Waddingham via use-livecode 
> :
> 
> I'm not sure I follow... In pages if I have
> 
> Hello World Foo Bar
> 
> If I select the whole lot - then 'textStyle["bold"]' (in LC speak) will be 
> 'mixed' - this is indicated by the 'Bold' button in pages not being 
> highlighted. If I click the 'Bold' button then it does the equivalent of 'set 
> the textStyle["bold"] of the selectedChunk to true', if I click again it does 
> the same as setting the same property to false. In both cases 'Bar' remains 
> italic.
> 
> The key thing here is that using the array form of textStyle treats each 
> individual text style completely separately.
> 
> Perhaps I misunderstand what you meant?
> 
> Warmest Regards,
> 
> Mark.

___
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: Deleting a char inside a textField via code

2018-08-31 Thread Richmond Mathewson via use-livecode

Thanks

On 31/8/2018 9:30 pm, Paul Dupuis via use-livecode wrote:

If you want to delete the last characters by script, why not something like:

delete last char of fld X


This works, of course, if it is the last char in the field.


Or a more complex version might be

put the selectedChunk into tWhere
put word 2 of tWhere into tStart -- staring char position of the cursor
put word 4 of tWhere into tEnd -- ending char position of the cursor
if tStart > tEnd then -- just an insertion point
   delete char tEnd of field X -- delete the character just before the
insertion point
else -- some field content is selected, so
   delete char tStart to tEnd of fld X -- delete the selected field content
end if


While this sort of thing works it mucks up the font settings of the 
field (and I'm using fields with multiple font settings).


I did this from memory, so check the dictionary for the exact
expressions returned by the selectedChunk function.,


Richmond.


On 8/31/2018 1:57 PM, Richmond Mathewson via use-livecode wrote:

Digging further . . .

I found out that the problem appearas:

1. NOT to be with LiveCode.

2. NOT to be with MacOS.

Because using a font other than my one works well.

So?

What hidden aspects of my Devawriter.ttf font are gumming up the works?

Richmond.

On 31/8/2018 6:44 pm, Richmond Mathewson wrote:

Normally, if one were typing into a textField and made a mistake one
would hit the back delete key
and the mistake would vanish.

How does one do this "programmatically"?

Here's the (admittedly odd scenario):

Unicode behaves inconsistently in various marginal cases with
Devanagari script,
and what happens is that the first time one sends this:

put numToCodePoint(7418) after the selectedText

one ends up with a useless square.

But if one does this:

put numToCodePoint(7418) after the selectedText
put numToCodePoint(7418) after the selectedText

one ends up with the useless square PRECEDED by the target glyph.

So, the 'clever' work around might be to do this:

put numToCodePoint(7418) after the selectedText
put numToCodePoint(7418) after the selectedText

followed by deleting the useless square

However doing this:

put numToCodePoint(65288) after the selectedText

results in another useless square.

Richmond.

___
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


___
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: Missing function selectedWords/selectedTrueWords

2018-08-31 Thread Tore Nilsen via use-livecode
Beats "looping around» all the text any day! I think I can use this with my 
students in a couple of months time. For now, I think I have to stick to the 
more basic tasks of just altering fonts, text size, text color and text styles 
for single word selections.


Best Regards
Tore Nilsen







> 31. aug. 2018 kl. 21:31 skrev hh via use-livecode 
> :
> 
> You could try:
> 
> on mouseUp
>  put the selectedChunk into sc
>  put word 2 of sc into strt
>  put word 4 of sc into stp
>  put fld word 7 of sc into txt
>  put selectedWords(strt,stp,txt) into fld "out"
> end mouseUp
> 
> function selectedWords strt,stp,txt
>  put the num of words in char 1 to strt of txt into w1
>  put the num of words in char 1 to stp of txt into w2
>  return w1,w2 -- start and stop
> end selectedWords
> 
> Of course you have an uncertainty if your selection
> starts or stops within words.
> 
> Similar for truewords ...
> 
> ___
> 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: Missing function selectedWords/selectedTrueWords

2018-08-31 Thread Tore Nilsen via use-livecode


We certainly are. I can already think of several sarcastic phrases to use, 
should the situation call for it! :) And since my students all know me well 
enough from earlier years, they will expect as much.

Tore




> 31. aug. 2018 kl. 22:13 skrev Mark Waddingham via use-livecode 
> :
> 
> P.S. Of course, at least one 'smart-ass' will ask 'why do those have brackety 
> things when the others don't' - but aren't teachers well versed in dealing 
> with such inquisitive minds? ;)

___
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: Android Audio Recorder Woes

2018-08-31 Thread Dan Friedman via use-livecode
Panos.

Thank you for the reply!  I am using LC  9.0.1 (rc 2).


Thank you!

Dan Friedman
CEO, ClearVision Technologies, LLC
Voice: 909/484-2052
http://www.clearvisiontech.com


From: panagiotis merakos 
Date: Friday, August 31, 2018 at 1:27 PM
To: How to use LiveCode 
Cc: Dan Friedman 
Subject: Re: Android Audio Recorder Woes

Hello Dan,
Which LC version are you using?

Best,
Panos

On Fri, Aug 31, 2018, 18:51 Dan Friedman via use-livecode 
mailto:use-livecode@lists.runrev.com>> wrote:
Hello!   I am trying to implement the Android Audio Recorder options in my 
project, but it’s not working.  I have checked the “Android Audio Recorder” in 
the Standalone Application Settings, and the called this:

androidRecorderSetRecordFormat "MPEG-4"
put (specialFolderPath("documents") & "/ test.mp4") into fPath
androidRecorderStartRecording fPath

The androidRecorderSetRecordFormat seems to be ok as it’s failing on the 
androidRecorderStartRecording call.   Is there something else I need to do or 
set to get this working?

Thanks in advance
-Dan
___
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: Missing function selectedWords/selectedTrueWords

2018-08-31 Thread Mark Waddingham via use-livecode

On 2018-08-31 20:57, Tore Nilsen via use-livecode wrote:

The array form may well be what I need. I do think I still will have
to wait some time before I introduce it to my students.


Perhaps - certainly 'textFont' and 'textSize' have less syntactic 
baggage. However, the actual underlying form/pattern/functionality is 
identical:


  the  of the selectedChunk

Returns "mixed" if  is not the same across all chars, otherwise 
the value of  (or empty if unset across all of them - i.e. 
inherited).


You could introduce the text style ones as 'prepackaged' units though:

  the textStyle["bold"] of the selectedChunk
  the textStyle["italic"] of the selectedChunk

This isn't really a 'lie' either - as these aren't really array 
properties in the same way as when you use that syntactic form as a 
custom property. In an ideal world they would have been done as 'the 
bold of' etc. We didn't do that for the simple reason that the number of 
times I have seen 'bold', 'italic' and other textStyle keywords as 
variable names and custom property names might be most surprising - i.e. 
had we, an unknown number of stacks would have broken, quite severely! 
[Although with hindsight perhaps we should have considered textBold / 
textItalic ... ].


Warmest Regards,

Mark.

P.S. Of course, at least one 'smart-ass' will ask 'why do those have 
brackety things when the others don't' - but aren't teachers well versed 
in dealing with such inquisitive minds? ;)


--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
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: Android Audio Recorder Woes

2018-08-31 Thread panagiotis merakos via use-livecode
Hello Dan,

Ok, so since 9.0.1 uses the new android permissions model, you might have
to ask for permission to record audio first. See the command
androidRequestPermission in the dictionary.

Best,
Panos

On Fri, Aug 31, 2018, 23:30 Dan Friedman  wrote:

> Panos.
>
>
>
> Thank you for the reply!  I am using LC  9.0.1 (rc 2).
>
>
>
>
>
> Thank you!
>
>
>
> Dan Friedman
>
> CEO, ClearVision Technologies, LLC
>
> Voice: 909/484-2052
>
> http://www.clearvisiontech.com
>
>
>
>
>
> *From: *panagiotis merakos 
> *Date: *Friday, August 31, 2018 at 1:27 PM
> *To: *How to use LiveCode 
> *Cc: *Dan Friedman 
> *Subject: *Re: Android Audio Recorder Woes
>
>
>
> Hello Dan,
>
> Which LC version are you using?
>
>
>
> Best,
>
> Panos
>
>
>
> On Fri, Aug 31, 2018, 18:51 Dan Friedman via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
> Hello!   I am trying to implement the Android Audio Recorder options in my
> project, but it’s not working.  I have checked the “Android Audio Recorder”
> in the Standalone Application Settings, and the called this:
>
> androidRecorderSetRecordFormat "MPEG-4"
> put (specialFolderPath("documents") & "/ test.mp4") into fPath
> androidRecorderStartRecording fPath
>
> The androidRecorderSetRecordFormat seems to be ok as it’s failing on the
> androidRecorderStartRecording call.   Is there something else I need to do
> or set to get this working?
>
> Thanks in advance
> -Dan
> ___
> 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: On Performance of Array Access

2018-08-31 Thread jbv via use-livecode
Mark,

Thank you so much for following up on this thread.

Once something "suitable for including in a 9.0.x maintenance release"
is available, could you please include it to LC server, and especially
the version of LC9 server installed on on-rev sage server ?
I'm in the process of improving for a client the speed a server-side
script that makes heavy use of arrays, and was originally written with
LC 4.- and then improved with LC 6.- .
Thanks in advance.

jbv





___
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: Deleting a char inside a textField via code

2018-08-31 Thread Paul Dupuis via use-livecode
If you want to delete the last characters by script, why not something like:

delete last char of fld X

Or a more complex version might be

put the selectedChunk into tWhere
put word 2 of tWhere into tStart -- staring char position of the cursor
put word 4 of tWhere into tEnd -- ending char position of the cursor
if tStart > tEnd then -- just an insertion point
  delete char tEnd of field X -- delete the character just before the
insertion point
else -- some field content is selected, so
  delete char tStart to tEnd of fld X -- delete the selected field content
end if

I did this from memory, so check the dictionary for the exact
expressions returned by the selectedChunk function.,

On 8/31/2018 1:57 PM, Richmond Mathewson via use-livecode wrote:
> Digging further . . .
>
> I found out that the problem appearas:
>
> 1. NOT to be with LiveCode.
>
> 2. NOT to be with MacOS.
>
> Because using a font other than my one works well.
>
> So?
>
> What hidden aspects of my Devawriter.ttf font are gumming up the works?
>
> Richmond.
>
> On 31/8/2018 6:44 pm, Richmond Mathewson wrote:
>> Normally, if one were typing into a textField and made a mistake one
>> would hit the back delete key
>> and the mistake would vanish.
>>
>> How does one do this "programmatically"?
>>
>> Here's the (admittedly odd scenario):
>>
>> Unicode behaves inconsistently in various marginal cases with
>> Devanagari script,
>> and what happens is that the first time one sends this:
>>
>> put numToCodePoint(7418) after the selectedText
>>
>> one ends up with a useless square.
>>
>> But if one does this:
>>
>> put numToCodePoint(7418) after the selectedText
>> put numToCodePoint(7418) after the selectedText
>>
>> one ends up with the useless square PRECEDED by the target glyph.
>>
>> So, the 'clever' work around might be to do this:
>>
>> put numToCodePoint(7418) after the selectedText
>> put numToCodePoint(7418) after the selectedText
>>
>> followed by deleting the useless square
>>
>> However doing this:
>>
>> put numToCodePoint(65288) after the selectedText
>>
>> results in another useless square.
>>
>> Richmond.
>
> ___
> 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: Missing function selectedWords/selectedTrueWords

2018-08-31 Thread Mark Waddingham via use-livecode

On 2018-08-31 20:33, Tore Nilsen via use-livecode wrote:

Microsoft Word seems to behave the way you suggest, in the sense that
if any given text style is present among the words in the selection
then it is removed. Pages behaves differently. If a given text style
is true for some of the words in the selection, Pages will initially
keep this style for these words and add it to the styles of the rest
of the chunk. If a given text style is true/false for all words in the
selection, Pages will set the text style to false/true accordingly. To
mimic these behaviours it would be useful to be able to do so on a
word by word basis.


I'm not sure I follow... In pages if I have

Hello World Foo Bar

If I select the whole lot - then 'textStyle["bold"]' (in LC speak) will 
be 'mixed' - this is indicated by the 'Bold' button in pages not being 
highlighted. If I click the 'Bold' button then it does the equivalent of 
'set the textStyle["bold"] of the selectedChunk to true', if I click 
again it does the same as setting the same property to false. In both 
cases 'Bar' remains italic.


The key thing here is that using the array form of textStyle treats each 
individual text style completely separately.


Perhaps I misunderstand what you meant?

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
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: Android Audio Recorder Woes

2018-08-31 Thread panagiotis merakos via use-livecode
Hello Dan,
Which LC version are you using?

Best,
Panos

On Fri, Aug 31, 2018, 18:51 Dan Friedman via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hello!   I am trying to implement the Android Audio Recorder options in my
> project, but it’s not working.  I have checked the “Android Audio Recorder”
> in the Standalone Application Settings, and the called this:
>
> androidRecorderSetRecordFormat "MPEG-4"
> put (specialFolderPath("documents") & "/ test.mp4") into fPath
> androidRecorderStartRecording fPath
>
> The androidRecorderSetRecordFormat seems to be ok as it’s failing on the
> androidRecorderStartRecording call.   Is there something else I need to do
> or set to get this working?
>
> Thanks in advance
> -Dan
> ___
> 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: On Performance of Array Access

2018-08-31 Thread Mark Talluto via use-livecode
I have only one complaint…You should have told me to put a diaper on before 
reading this. Aside from my inability to control myself with all this wonderful 
news…Thank you!

Best regards,

Mark Talluto
livecloud.io 
nursenotes.net 
canelasoftware.com 


> On Aug 31, 2018, at 6:58 AM, Mark Waddingham via use-livecode 
>  wrote:
> 
> Generally, I don't tend to like to 'jump the gun' on anything related to 
> optimization lest it is not what it seems when running in the real world 
> but...

___
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: Missing function selectedWords/selectedTrueWords

2018-08-31 Thread Tore Nilsen via use-livecode
It worked as advertised, provided I also check for the instance of the given 
textStyle to be false, this works a charm. The code I need to show to my 
students is easy enough for them to understand, without the need to actually 
understand arrays. Thank you!

Best regards,
Tore

> 31. aug. 2018 kl. 22:00 skrev Mark Waddingham via use-livecode 
> :
> 
> On 2018-08-31 20:51, Tore Nilsen via use-livecode wrote:
>> I got a bit confused there. Pages behaves as you say, Microsoft Word
>> would turn off bold on the initial push of the button, then adding
>> bold to the styles the next time.
>> This is why I thought I needed to find the style of each word in a
>> group of words when the the textStyles is mixed. And I still think
>> that is what I need in order to mimic the behaviour of either Word or
>> Pages.
> 
> Okay - so - create a stack, create a field, type some text in it and then see 
> if you find that the Text > Bold/Italic/... items work as you find in 
> Pages/Word (you should, they seem to for me)...
> 
> If you find they work the same then:
> 
>  set the textStyle["bold"] of the selectedChunk to true -- "bold" can be 
> "italic" or any of the others, setting to false does the inverse
> 
> Is definitely what you need.
> 
> If the textStyle["bold"] of the selectedChunk is "mixed" it means some chars 
> are bold, some aren't - so you can make the appropriate decision as to what 
> to do based on your preference for either the Pages or Word behavior :)
> 
> Warmest Regards,
> 
> Mark.
> 
> P.S. The above feature was implemented a few versions ago precisely to allow 
> the functionality you describe to be implemented very easily... Prior to it, 
> the IDE menu items still did the right thing - but the code was, well, 
> nowhere near a single line...
> 
> -- 
> Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
> LiveCode: Everyone can create apps
> 
> ___
> 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: Mobile Rotation Redux

2018-08-31 Thread J. Landman Gay via use-livecode

On 8/30/18 8:46 PM, Brian Milby via use-livecode wrote:

I'll post the stack file if anyone wants to see it.  On the one Android
device I have available it works correctly.  Resizestack handlers fire
correctly.  So I guess I need to find something with a later OS to test
against to see the problems others are seeing on the Android side.


Sure, post the stack and I'll take a look on a couple of different 
Android devices.


For the record, I haven't had any problems on Android with resizeStack 
or the various rects either. I don't remember exactly, but I seem to 
recall the reported problems were with a stack that uses fullscreenMode, 
where resizeStack isn't sent (unless 
mobileSetFullScreenRectForOrientations is used.)


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
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: Missing function selectedWords/selectedTrueWords

2018-08-31 Thread Tore Nilsen via use-livecode
The array form may well be what I need. I do think I still will have to wait 
some time before I introduce it to my students. 

Best regards
Tore

> 31. aug. 2018 kl. 21:39 skrev Mark Waddingham via use-livecode 
> :
> 
> The key thing here is that using the array form of textStyle treats each 
> individual text style completely separately.

___
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: Missing function selectedWords/selectedTrueWords

2018-08-31 Thread Mark Waddingham via use-livecode

On 2018-08-31 20:51, Tore Nilsen via use-livecode wrote:

I got a bit confused there. Pages behaves as you say, Microsoft Word
would turn off bold on the initial push of the button, then adding
bold to the styles the next time.

This is why I thought I needed to find the style of each word in a
group of words when the the textStyles is mixed. And I still think
that is what I need in order to mimic the behaviour of either Word or
Pages.


Okay - so - create a stack, create a field, type some text in it and 
then see if you find that the Text > Bold/Italic/... items work as you 
find in Pages/Word (you should, they seem to for me)...


If you find they work the same then:

  set the textStyle["bold"] of the selectedChunk to true -- "bold" can 
be "italic" or any of the others, setting to false does the inverse


Is definitely what you need.

If the textStyle["bold"] of the selectedChunk is "mixed" it means some 
chars are bold, some aren't - so you can make the appropriate decision 
as to what to do based on your preference for either the Pages or Word 
behavior :)


Warmest Regards,

Mark.

P.S. The above feature was implemented a few versions ago precisely to 
allow the functionality you describe to be implemented very easily... 
Prior to it, the IDE menu items still did the right thing - but the code 
was, well, nowhere near a single line...


--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
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 get word offset all instances of a string in a chunk of text?

2018-08-31 Thread Mike Kerner via use-livecode
Since the topic of processes came up a few weeks ago I've been thinking
about what it would take to build a process/threading framework.  I wonder
if a text processing subprocessor, written and copiled in 6 would be worth
everyone's time.  The main app would hand off the data and the command to
the subprocessor and be handed the results back.  I wonder how large the
dataset would have to be to make the overhead worth while.

On Fri, Aug 31, 2018 at 10:43 AM Keith Clarke via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Thanks Alex, HH & Jim for all the help & ideas.
>
> Just to close out the thread with a solution for future reference, the
> code below now extracts from a text source a list of unique words, cleaned
> up against a noise-word list, with word frequency, word & and a
> comma-delimited string of the word number within the original source.
>
>
> # Build unique words array
> repeat for each trueWord W in tSource
>
> add 1 to tWordNum
>
> if tANoise[W] then next repeat
>
> put comma & tWordNum after tAWords[W]
>
> end repeat
>
>
> # Convert unique words array to list
>
> repeat for each key K in tAWords
>
> put K && tAWords[K] & CR after tTemp
>
> end repeat
>
>
> repeat for each line tLine in tTemp
>
> put the number of items in tLine & comma & tLine & cr after tWords
>
> end repeat
>
>
> sort lines of tWords descending numeric by item 1 of each
>
> put tWords into field "Words"
>
>
> Thanks & regards,
> Keith
>
>
>
>
>
> ___
> 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
>


-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
___
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: Android Audio Recorder Woes

2018-08-31 Thread Dan Friedman via use-livecode
Panos,

Ug!  Yes, that was it.  I feel especially stupid because I already did it for 
Location Access.   Must be Friday!?!

Thank you!

-Dan


From: panagiotis merakos 
Date: Friday, August 31, 2018 at 1:34 PM
To: Dan Friedman 
Cc: How to use LiveCode 
Subject: Re: Android Audio Recorder Woes

Hello Dan,

Ok, so since 9.0.1 uses the new android permissions model, you might have to 
ask for permission to record audio first. See the command 
androidRequestPermission in the dictionary.

Best,
Panos

On Fri, Aug 31, 2018, 23:30 Dan Friedman 
mailto:d...@clearvisiontech.com>> wrote:
Panos.

Thank you for the reply!  I am using LC  9.0.1 (rc 2).


Thank you!

Dan Friedman
CEO, ClearVision Technologies, LLC
Voice: 909/484-2052
http://www.clearvisiontech.com


From: panagiotis merakos mailto:merak...@gmail.com>>
Date: Friday, August 31, 2018 at 1:27 PM
To: How to use LiveCode 
mailto:use-livecode@lists.runrev.com>>
Cc: Dan Friedman mailto:d...@clearvisiontech.com>>
Subject: Re: Android Audio Recorder Woes

Hello Dan,
Which LC version are you using?

Best,
Panos

On Fri, Aug 31, 2018, 18:51 Dan Friedman via use-livecode 
mailto:use-livecode@lists.runrev.com>> wrote:
Hello!   I am trying to implement the Android Audio Recorder options in my 
project, but it’s not working.  I have checked the “Android Audio Recorder” in 
the Standalone Application Settings, and the called this:

androidRecorderSetRecordFormat "MPEG-4"
put (specialFolderPath("documents") & "/ test.mp4") into fPath
androidRecorderStartRecording fPath

The androidRecorderSetRecordFormat seems to be ok as it’s failing on the 
androidRecorderStartRecording call.   Is there something else I need to do or 
set to get this working?

Thanks in advance
-Dan
___
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: What do we know about LC 10?

2018-08-31 Thread Bob Sneidar via use-livecode
It's been talked about. But I'm with that other guy over there who thinks a bit 
more refinement needs doing before going down the New Feature path. 

Bob S


> On Aug 30, 2018, at 22:26 , Geoff Canyon via use-livecode 
>  wrote:
> 
> Maybe? I haven't explored LCB at all. I'm much more interested in extending
> Livecode Script, if that ever becomes possible.


___
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: On Performance of Array Access

2018-08-31 Thread Tom Glod via use-livecode
Great work Mark! ...great news!

On Fri, Aug 31, 2018 at 5:41 PM Mark Talluto via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I have only one complaint…You should have told me to put a diaper on
> before reading this. Aside from my inability to control myself with all
> this wonderful news…Thank you!
>
> Best regards,
>
> Mark Talluto
> livecloud.io 
> nursenotes.net 
> canelasoftware.com 
>
>
> > On Aug 31, 2018, at 6:58 AM, Mark Waddingham via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Generally, I don't tend to like to 'jump the gun' on anything related to
> optimization lest it is not what it seems when running in the real world
> but...
>
> ___
> 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

Trouble with iOS Logos/No Appearing on Home Screen

2018-08-31 Thread Sannyasin Brahmanathaswami via use-livecode
I have tried everything, the logos in the standalone maker are as they
are supposed to be, according to SA. And so are my splash screen images.

So I went to developer.apple.com

And the HIG  for app icons (and splash screens) give a different set of
sizes.

So I downloaded "Icon Set  Creator" (free)  and it produced these. Which
do in fact correspond to the current guide at developer.apple.com

Note as an example,  SivaSiva logo...@2x.png corresponds with iPhone
icon. That would be 58px , but the standalone maker wants a 57 size icon.

SivaSiva Logo-1024.png
SivaSiva Logo-20.png
SivaSiva logo...@2x.png
SivaSiva logo...@3x.png
SivaSiva Logo-29.png
SivaSiva logo...@2x.png
SivaSiva logo...@3x.png
SivaSiva Logo-40.png
SivaSiva logo...@2x.png
SivaSiva logo...@3x.png
SivaSiva logo...@2x.png
SivaSiva logo...@3x.png
SivaSiva Logo-76.png
SivaSiva logo...@2x.png
SivaSiva logo-8...@2x.png

1.2.2 is ready for the app store, only this one problem!

also, why would you check (uncheck) Prerendered choice?

??


___
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: fullscreenmode and rect of a substack on mobile device ?

2018-08-31 Thread Sannyasin Brahmanathaswami via use-livecode
@Brian

That was interesting an experiment.

I reduced all geometry to this

*on*openCard

*put*mobileRectGet() intotStackRect

#mobileRectSet get the screenrect on app init

 *if* isMobile() *then*

  *if* theplatformisandroid *then*

*set*therectofwidget"body"to0,0,486,765

*else*

*set*rectrectofwidget"body"to0,0,414,680

*end* *if*

*put*thelocofthiscardintotCardLoc

*answer*tCardLoc with"OK"

*set*thelocofwidget"body"to( item1oftCardLoc, (item2of   
tCharLoc)-50)

*end* *if*

*end*openCard


I get the card loc alright in the answe; but the browser widget "does
not obey"

You said: "What I'm not clear about is whether you can set the rect of
the stack to the known screen rect and have it display correctly."

Answer is "no" but it may be just the (browser on android) OR (it may be that 
the attempt to place *any* object on opencard, doesn't *really* know to coords 
of the stack/card, even if you get them) until resizestack is triggered.

And, additional caveat (on Android, every works on iOS)  if you start playing a 
youTube in portrait mode and, while it is playing, rotate to phone... the 
browse "disappears" , you can still hear the audio... so I suspect the browser 
it "off in space", but it you *do not* starting play, are rotate the phone, you 
get the "web page" as expected and then you can play the video, rotate the 
phone (portrait) still playing... rotate again and YouTube disappears. this 
does happen in a "regular web page" 

all working fine on iOS,

I have roll back a few commits, and then next I'll try Ralphs Hack... we use 
the same method "SivaSiva.livecode" is a stack that is always open, does the 
same job/app init as Ralph "stub-stack" 

BR




On 8/30/18 8:36 AM, Brian Milby via use-livecode wrote:
>  If setting the
> rect manually doesn't work, then there is an issue that is deeper than just
> knowing what the rect needs to be.
>
> From earlier in the thread it appears that on Android, the first
> "resizestack" is not getting sent.  You don't get one until you rotate the
> device.  What I'm not clear about is whether you can set the rect of the
> stack to the known screen rect and have it display correctl

-- 
Svasti Astu, Be Well!
Brahmanathaswami
 
Get the SivaSiva app, it's free:
https://www.himalayanacademy.com/apps/sivasiva


___
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: On Performance of Array Access

2018-08-31 Thread Richard Gaskin via use-livecode

jbv wrote:

> Once something "suitable for including in a 9.0.x maintenance release"
> is available, could you please include it to LC server, and especially
> the version of LC9 server installed on on-rev sage server ?

Here's a potentially quick CPU and RAM reduction opportunity for LC Server:
https://quality.livecode.com/show_bug.cgi?id=14115

With a CGI like LiveCode, it's launched with each request.

Depending on the system, up to 3/4 of the boot sequence is loading and 
initializing fonts.


I appreciate that LC Server now has the ability to generate custom 
graphics, some of which may need to specify fonts.  But I'd wager than 
less than 0.1% of scripts written for LC Server do that.


Comment #5 there suggests maybe adding a -f flag in the command line 
call we add to our .htaccess files to bypass the font init almost no one 
is using.


If we could get approval for that, we could probably find someone in the 
community to add the parsing of that flag from the input options and the 
IF statement before the font init.


By itself it won't make the scripts themselves faster.  But it'll make 
the engine init faster, and much leaner since it won't have the font 
info in memory.


On Dreamhost, for example, running LC Server is unpredictable because of 
its memory requirements and the full suite of fonts they have on their 
systems.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
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


Searching for a word when it's more than one word

2018-08-31 Thread Stephen MacLean via use-livecode
Hi All,

First, followed Keith Clarke’s thread and got a lot out of it, thank you all. 
That’s gone into my code snippets!

Now I know, the title is not technically true, if it’s 2 words, they are 
distinct and different. Maybe it’s because I’ve been banging my head against 
this and some other things too long and need to step back, but I’m having 
issues getting this all to work reliably.

I’m searching for town names in various text from a list of towns . Most names 
are one word, easy to find and count. Some names are 2 or 3 words, like East 
Hartford or West Palm Beach. Those go against distinct towns like Hartford and 
Palm Beach. Others have their names inside of other town names like Colchester 
and Chester.

"is among the words of” or "is among the trueWords of” works great to find 
single words, but only works on single words and doesn’t consider “Chester’s” 
to be ”Chester”, it isn't.

“is in” works great for finding multiple words like “East Hartford” and "West 
Palm Beach", finds “Chester” in “Chester’s” but also finds “chester” in 
“Colchester”.

At this point, I’ve been using different methods for single word towns vs 
multi-word towns and while generally effective, trying to accommodate for these 
and other oddities has made it a complete mess of code.

If someone has done something similar, or can point me in the right direction, 
it would be greatly appreciated.

TIA,

Steve MacLean





___
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 get word offset all instances of a string in a chunk of text?

2018-08-31 Thread Richard Gaskin via use-livecode

Mike Kerner wrote:

> Since the topic of processes came up a few weeks ago I've been
> thinking about what it would take to build a process/threading
> framework.  I wonder if a text processing subprocessor, written
> and copiled...

I haven't yet come across good use cases for the desktop, but will have 
a need for multiprocessing on Linux servers later this year.



> ... in 6 would be worth everyone's time.

That would be a non-starter for me.  I use LSON data a lot and the 
format changed with v7, a lot of things with text have changed, and 
given the hundreds of bug fixes between then and now I prefer to work 
with the current version.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
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


On Performance of Array Access

2018-08-31 Thread Mark Waddingham via use-livecode
Generally, I don't tend to like to 'jump the gun' on anything related to 
optimization lest it is not what it seems when running in the real world 
but...


I'm becoming increasingly confident that a recent foray of mine into yet 
another attempt to improve the speed of array access in LC9 might have 
actually born some quite tasty fruit. Pleasingly the code changes 
required are small, highly localized and quite possibly more than 
suitable for including in a 9.0.x maintenance release.


The current WIP PR can be found here:

  https://github.com/livecode/livecode/pull/6671

Amusingly this didn't even start as an attempt at optimization, but an 
attempt to see if I could do anything about heap fragmentation!


The patch itself does three things:

  1) Minimizes the in-memory size of the core types - all 'book-keeping' 
records are now <=32 bytes on 64-bit systems


  2) Makes use of tArray[x]...[z] type expressions much more efficient 
when both evaluating and mutating


  3) Makes use of integer indicies in arrays much more efficient

I've been running it on a number of benchmarks, the two most notable 
follow.


LARGE ARRAY CONSTRUCTION

The following simple code example was supplied in Bug 17434 by Richard 
as it appears to show a memory leak (its actually heap fragmentation, 
but that's another story):


put 100 into tMax
repeat with i = 1 to tMax
repeat with j = 1 to tMax
repeat with k = 1 to tMax
put any item of "bob,carol,ted,alice" into 
sA[i][j][k]
end repeat
end repeat
end repeat

The code constructs an 100x100x100 matrix (rendered as a nested array, 
rather than a flat one).


Timings in various versions (on my 2018 MBP laptop) are:

  6.7.11: 1117ms
  9.0.1:  4020ms
  PR6671: 1017ms

This would seem to be a not too uncommon a pattern of code - judging by 
JBV's recent post on here (which was essentially doing the same thing).


We can modify the above slightly to make it more focussed on array 
performance (i.e. taking out the need to construct / copy a random 
portion of a string):


put 100 into tMax
repeat with i = 1 to tMax
repeat with j = 1 to tMax
repeat with k = 1 to tMax
put "bob,carol,ted,alice" into sA[i][j][k]
end repeat
end repeat
end repeat

Timings for this are:

  6.7.11: 1055ms
  9.0.1:  3281ms
  PR6671: 497ms

ARRAY RECORD FILTERING

The following code example was derived by me for my recent LCG talk 
based on a real-world code supplied by Mark Talluto. It iterates over a 
sequence of arrays, creating a new one where each record only has a 
subset of the keys. The keys to keep are taken from a stringlist:


private function _BenchmarkArrayFilterRecords pRecords, pColumnNames
   local tFilteredRecords, tFilteredRecord
   repeat for each element tRecord in pRecords
  repeat for each item tColumnName in pColumnNames
 put tRecord[tColumnName] into tFilteredRecord[tColumnName]
  end repeat
  put tFilteredRecord into \
tFilteredRecords[the number of elements in tFilteredRecords 
+ 1]

   end repeat
   return tFilteredRecords
end _BenchmarkArrayFilterRecords

Timings for 10 iterations of the above are:

  6.7.11: 16872ms
  9.0.1:  8305ms
  PR6671: 4315ms

The following is the same as the above, except the keys to keep are 
taken from the keys of an array:


private function _BenchmarkArrayFilterRecordsSet pRecords, 
pColumnNameSet

   local tFilteredRecords, tFilteredRecord
   repeat for each element tRecord in pRecords
  repeat for each key tColumnName in pColumnNameSet
 put tRecord[tColumnName] into tFilteredRecord[tColumnName]
  end repeat
  put tFilteredRecord into \
tFilteredRecords[the number of elements in tFilteredRecords 
+ 1]

   end repeat
   return tFilteredRecords
end _BenchmarkArrayFilterRecordsSet

Timings for 10 iterations of the above are:

  6.7.11: 16508ms
  9.0.1:  6397ms
  PR6671: 3001ms

REAL WORLD CASE

Now, I'm always a little skeptical about using synthetic benchmarks for 
performance. However, both of the above are actually real-world 
examples. Furthermore, when running a rather large LCS project on an 
engine with PR6671, I got a 2x speed up - one particular input took 
3mins to process, rather than 6mins (one phase of processing actually 
saw a 5x speed up!).


Anyway, thought this might make some potentially pleasing Friday 
afternoon news :)


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
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


am I regexing by mistake?

2018-08-31 Thread David V Glasgow via use-livecode
Hello, folks.

I am undertaking keyword searches of chat logs.  The keywords are stored as 
themed lists in fields.

One of the things I am interested in is finding lines where one contributor 
asks another about where they live, shop, go to school etc etc.  So, (among 
other phrases) I filter for lines in the text containing the acronym “ asl ” 
(nowhere are quotes actually included in fields or variables, they’re just in 
this mail).  I pad with spaces so as not to find “asleep”.  I also want to find 
“asl?”  

So I repeat through lines of the keyword field “location"

Filter lines of tsource with tpattern

…  which works for everything except fails to match “asl?”.  It occurred to me 
that perhaps the question mark is being interpreted as a regex symbol, so I 
tried changing the line in the field to read “ asl/?”, but that doesn’t find 
the “asl?” that I can see in the third line of the text to be searched….


shadownave (09/16/14 1:44:58 AM): hey care to chat
shadownave (09/16/14 1:45:09 AM): hey care to chat
what_sez_moo (09/16/14 1:45:18 AM): sure asl?
what_sez_moo (09/16/14 1:45:52 AM): 13 / F / Ashton here
shadownave (09/16/14 1:51:00 AM): 25/m/Derby
shadownave (09/16/14 1:51:03 AM): how r u tonight
what_sez_moo (09/16/14 1:51:16 AM): bored.


What am I doing wrong?  Is this something to do with regex?

Oh yes, and I thought there might be invisible characters messing things up, so 
I exported source text as plain text from BBedit, with no improvement.

best wishes

David Glasgow
___
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 do we know about LC 10?

2018-08-31 Thread Mark Waddingham via use-livecode

On 2018-08-30 21:42, Mike Kerner via use-livecode wrote:
Mark tends to complain about the engine, but they also inherited the 
engine

when they bought it from MetaCard.  He has said that it is difficult to
work on.


Heh - any complaints are more 'frustration' over the effort/time to make 
significant changes rather than anything else.


Stability/robustnss wise it is actually pretty good - sure there are 
edge cases it is not that great at but the majority of what most people 
use all the time is rock solid. Interestingly, some of the edge cases 
are being hit more than they ever used to - but I consider that a good 
thing as it means people are pushing it much harder than it ever has 
been in its history.


In terms of difficulty working on it:

  - it comprises C/C++/Obj-C/Obj-C++/Java

  - it grew very organically in the early days (less so since I've been 
working on it)


  - it has a great deal of hand-coded/replicated *almost* consistent but 
not quite code patterns


  - it has a language system meaning that changes must work for all 
reasonably determinable use-cases


  - it has a language system in which 10,000,000s of lines of code are 
written, meaning that changes must not break existing code (and if they 
do there has to be an exceptionally good reason to!)


  - it has a GUI framework which must largely work the same in multiple 
different windowing systems


  - it has a large library of utility functions/commands

  - it runs on 6 quite different operating systems

  - it runs on 4 different processor architectures

So, yes, it is difficult to work on [ some might say exceptionally 
difficult ;o) ].


The difficulty is not just because of the size/scale/structure of the 
source but because the whole of what the engine is and must do puts a 
huge number of constraints on what can be done (and what should be 
done!) in any reasonable time frame.


Actually, I think I have now been the chief engineer on the engine for 
longer than it was ever MetaCard (or even existed at all!). In that time 
the source base has grown from around 150,000 code lines (+ 5,000 
comment lines) to 475,000+ code lines (+ 50,000 comment lines). [ This 
would be comparing v2.0 to v7.1 - I've not done a loc analysis on recent 
versions - and doesn't include the LCS / LCB which we consider to be 
engine source code ]. Upshot - I am ultimately responsible for the 
greater part of what the engine is now regardless of what it was as 
MetaCard.


Aside from any complaints I might make, I do still love working on it; 
even though, as I get older, my enjoyment from writing 
C/C++/Obj-C/Obj-C++/Java declines year-on-year.


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
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


Android text-to-Speech?

2018-08-31 Thread Peter Reid via use-livecode
Does anyone have a way of converting text to speech for Android, i.e. the 
equivalent to revSpeak for Android (& iOS)?

I came across a suggestion that involved Google's translation service but this 
doesn't seem to work now and I'd prefer it if I didn't have to use a Google 
service.

revSpeak works for Mac and Windows, it's a pity that it doesn't work for 
Android and iOS.

Thanks

Peter
--
Peter Reid
Loughborough, UK


___
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: Deleting a char inside a textField via code

2018-08-31 Thread Richmond Mathewson via use-livecode

To make things more complicated:

if one has this:

put numToCodePoint(7418) after the selectedText
put numToCodePoint(7418) after the selectedText
delete the last char of fld "XYZ"

it is the target glyph that is deleted and NOT the useless square

(ie. it is NOT the last char that is deleted).

On 31/8/2018 6:44 pm, Richmond Mathewson wrote:
Normally, if one were typing into a textField and made a mistake one 
would hit the back delete key

and the mistake would vanish.

How does one do this "programmatically"?

Here's the (admittedly odd scenario):

Unicode behaves inconsistently in various marginal cases with 
Devanagari script,

and what happens is that the first time one sends this:

put numToCodePoint(7418) after the selectedText

one ends up with a useless square.

But if one does this:

put numToCodePoint(7418) after the selectedText
put numToCodePoint(7418) after the selectedText

one ends up with the useless square PRECEDED by the target glyph.

So, the 'clever' work around might be to do this:

put numToCodePoint(7418) after the selectedText
put numToCodePoint(7418) after the selectedText

followed by deleting the useless square

However doing this:

put numToCodePoint(65288) after the selectedText

results in another useless square.

Richmond.


___
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: Datagrid substack question

2018-08-31 Thread Sannyasin Brahmanathaswami via use-livecode
Aha! that why a data grid on a cloned stack won't work!

On 8/28/18 6:14 AM, Knapp Martin via use-livecode wrote:
> Thanks zryip - I’ll give that a try!
>
> Marty
>
>> On Aug 28, 2018, at 12:31 AM, zryip theSlug via use-livecode 
>>  wrote:
>>
>> Marty,
>>
>> You have to change the row template property of your datagrid to point it
>> to the template group located in your renamed substack.
>>
>> set the dgProps["row template"] of grp "myDatagrid" to the long id of grp
>> "myGrpTemplate" of cd "myCardTemplate" of stack "myTemplateStack"


-- 
Svasti Astu, Be Well!
Brahmanathaswami
 
Get the SivaSiva app, it's free:
https://www.himalayanacademy.com/apps/sivasiva


___
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: fullscreenmode and rect of a substack on mobile device ?

2018-08-31 Thread Ludovic THEBAULT via use-livecode

> Le 30 août 2018 à 20:44, Ludovic THEBAULT via use-livecode 
>  a écrit :
> 
> You can download my test stack here :
> https://www.dropbox.com/s/iwwm2syiqzqamtg/testsubstack2.livecode?dl=1
> 
> Note : my script doesn’t work properly : i tested it on an android tablet and 
> the result is not accurate.


I updated the script, now it’s work for all screen size (in fullscreenmode 
showall). You can also test for other fullscreenmode.
I noticed that with some devices the top and bottom of the screenrect could be 
slightly hidden by the physical border of the screen (about ten pixels). I 
added a button to shift the dotted lines representing the screen boundaries by 
10 pixels with each click to test this.
___
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

Android Audio Recorder Woes

2018-08-31 Thread Dan Friedman via use-livecode
Hello!   I am trying to implement the Android Audio Recorder options in my 
project, but it’s not working.  I have checked the “Android Audio Recorder” in 
the Standalone Application Settings, and the called this:

androidRecorderSetRecordFormat "MPEG-4"
put (specialFolderPath("documents") & "/ test.mp4") into fPath
androidRecorderStartRecording fPath

The androidRecorderSetRecordFormat seems to be ok as it’s failing on the 
androidRecorderStartRecording call.   Is there something else I need to do or 
set to get this working?

Thanks in advance
-Dan
___
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: Deleting a char inside a textField via code

2018-08-31 Thread Richmond Mathewson via use-livecode

Digging further . . .

I found out that the problem appearas:

1. NOT to be with LiveCode.

2. NOT to be with MacOS.

Because using a font other than my one works well.

So?

What hidden aspects of my Devawriter.ttf font are gumming up the works?

Richmond.

On 31/8/2018 6:44 pm, Richmond Mathewson wrote:
Normally, if one were typing into a textField and made a mistake one 
would hit the back delete key

and the mistake would vanish.

How does one do this "programmatically"?

Here's the (admittedly odd scenario):

Unicode behaves inconsistently in various marginal cases with 
Devanagari script,

and what happens is that the first time one sends this:

put numToCodePoint(7418) after the selectedText

one ends up with a useless square.

But if one does this:

put numToCodePoint(7418) after the selectedText
put numToCodePoint(7418) after the selectedText

one ends up with the useless square PRECEDED by the target glyph.

So, the 'clever' work around might be to do this:

put numToCodePoint(7418) after the selectedText
put numToCodePoint(7418) after the selectedText

followed by deleting the useless square

However doing this:

put numToCodePoint(65288) after the selectedText

results in another useless square.

Richmond.


___
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


Deleting a char inside a textField via code

2018-08-31 Thread Richmond Mathewson via use-livecode
Normally, if one were typing into a textField and made a mistake one 
would hit the back delete key

and the mistake would vanish.

How does one do this "programmatically"?

Here's the (admittedly odd scenario):

Unicode behaves inconsistently in various marginal cases with Devanagari 
script,

and what happens is that the first time one sends this:

put numToCodePoint(7418) after the selectedText

one ends up with a useless square.

But if one does this:

put numToCodePoint(7418) after the selectedText
put numToCodePoint(7418) after the selectedText

one ends up with the useless square PRECEDED by the target glyph.

So, the 'clever' work around might be to do this:

put numToCodePoint(7418) after the selectedText
put numToCodePoint(7418) after the selectedText

followed by deleting the useless square

However doing this:

put numToCodePoint(65288) after the selectedText

results in another useless square.

Richmond.
___
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: On Performance of Array Access

2018-08-31 Thread Richard Gaskin via use-livecode

Impressive. Thank you.

--
 Richard Gaskin
 Fourth World Systems

Mark Waddingham wrote:
Generally, I don't tend to like to 'jump the gun' on anything related to 
optimization lest it is not what it seems when running in the real world 
but...


I'm becoming increasingly confident that a recent foray of mine into yet 
another attempt to improve the speed of array access in LC9 might have 
actually born some quite tasty fruit. Pleasingly the code changes 
required are small, highly localized and quite possibly more than 
suitable for including in a 9.0.x maintenance release.


The current WIP PR can be found here:

   https://github.com/livecode/livecode/pull/6671

Amusingly this didn't even start as an attempt at optimization, but an 
attempt to see if I could do anything about heap fragmentation!


The patch itself does three things:

   1) Minimizes the in-memory size of the core types - all 'book-keeping' 
records are now <=32 bytes on 64-bit systems


   2) Makes use of tArray[x]...[z] type expressions much more efficient 
when both evaluating and mutating


   3) Makes use of integer indicies in arrays much more efficient

I've been running it on a number of benchmarks, the two most notable 
follow.


LARGE ARRAY CONSTRUCTION

The following simple code example was supplied in Bug 17434 by Richard 
as it appears to show a memory leak (its actually heap fragmentation, 
but that's another story):


 put 100 into tMax
repeat with i = 1 to tMax
repeat with j = 1 to tMax
repeat with k = 1 to tMax
put any item of "bob,carol,ted,alice" into 
sA[i][j][k]
end repeat
end repeat
end repeat

The code constructs an 100x100x100 matrix (rendered as a nested array, 
rather than a flat one).


Timings in various versions (on my 2018 MBP laptop) are:

   6.7.11: 1117ms
   9.0.1:  4020ms
   PR6671: 1017ms

This would seem to be a not too uncommon a pattern of code - judging by 
JBV's recent post on here (which was essentially doing the same thing).


We can modify the above slightly to make it more focussed on array 
performance (i.e. taking out the need to construct / copy a random 
portion of a string):


 put 100 into tMax
repeat with i = 1 to tMax
repeat with j = 1 to tMax
repeat with k = 1 to tMax
put "bob,carol,ted,alice" into sA[i][j][k]
end repeat
end repeat
end repeat

Timings for this are:

   6.7.11: 1055ms
   9.0.1:  3281ms
   PR6671: 497ms

ARRAY RECORD FILTERING

The following code example was derived by me for my recent LCG talk 
based on a real-world code supplied by Mark Talluto. It iterates over a 
sequence of arrays, creating a new one where each record only has a 
subset of the keys. The keys to keep are taken from a stringlist:


private function _BenchmarkArrayFilterRecords pRecords, pColumnNames
local tFilteredRecords, tFilteredRecord
repeat for each element tRecord in pRecords
   repeat for each item tColumnName in pColumnNames
  put tRecord[tColumnName] into tFilteredRecord[tColumnName]
   end repeat
   put tFilteredRecord into \
 tFilteredRecords[the number of elements in tFilteredRecords 
+ 1]

end repeat
return tFilteredRecords
end _BenchmarkArrayFilterRecords

Timings for 10 iterations of the above are:

   6.7.11: 16872ms
   9.0.1:  8305ms
   PR6671: 4315ms

The following is the same as the above, except the keys to keep are 
taken from the keys of an array:


private function _BenchmarkArrayFilterRecordsSet pRecords, 
pColumnNameSet

local tFilteredRecords, tFilteredRecord
repeat for each element tRecord in pRecords
   repeat for each key tColumnName in pColumnNameSet
  put tRecord[tColumnName] into tFilteredRecord[tColumnName]
   end repeat
   put tFilteredRecord into \
 tFilteredRecords[the number of elements in tFilteredRecords 
+ 1]

end repeat
return tFilteredRecords
end _BenchmarkArrayFilterRecordsSet

Timings for 10 iterations of the above are:

   6.7.11: 16508ms
   9.0.1:  6397ms
   PR6671: 3001ms

REAL WORLD CASE

Now, I'm always a little skeptical about using synthetic benchmarks for 
performance. However, both of the above are actually real-world 
examples. Furthermore, when running a rather large LCS project on an 
engine with PR6671, I got a 2x speed up - one particular input took 
3mins to process, rather than 6mins (one phase of processing actually 
saw a 5x speed up!).


Anyway, thought this might make some potentially pleasing Friday 
afternoon news :)


Warmest Regards,

Mark.



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-31 Thread Brian Milby via use-livecode
I still think you are working too hard.  I just put this on my Fire.  (I
had to manually code the FSM).  This short handler sets everything properly:

on fixBackground
   local tCardW, tScreenW, tScreenH, tNewH, tRect
   put the width of this card into tCardW
   put the effective working screenRect into tRect
   put item 3 of tRect - item 1 of tRect into tScreenW
   put item 4 of tRect - item 2 of tRect into tScreenH
   put tCardW / (tScreenW / tScreenH) into tNewH
   set the height of grc "bkg" to tNewH
   set the loc of grc "bkg" to the loc of this card
   set the top of grc "lineTop" to item 2 of the rect of grc "bkg"
   set the bottom of grc "lineBottom" to item 4 of the rect of grc "bkg"
end fixBackground

The problem with the lines being off screen is that you need to use the
"effective working screenrect" to account for the area that you cannot
address.  On iOS, the top of the screen is within the card rect.  On the
Fire, it is not.  On my device, the top 24px are reserved.

Brian

On Fri, Aug 31, 2018 at 10:06 AM Ludovic THEBAULT via use-livecode <
use-livecode@lists.runrev.com> wrote:

>
> > Le 30 août 2018 à 20:44, Ludovic THEBAULT via use-livecode <
> use-livecode@lists.runrev.com> a écrit :
> >
> > You can download my test stack here :
> > https://www.dropbox.com/s/iwwm2syiqzqamtg/testsubstack2.livecode?dl=1
> >
> > Note : my script doesn’t work properly : i tested it on an android
> tablet and the result is not accurate.
>
>
> I updated the script, now it’s work for all screen size (in fullscreenmode
> showall). You can also test for other fullscreenmode.
> I noticed that with some devices the top and bottom of the screenrect
> could be slightly hidden by the physical border of the screen (about ten
> pixels). I added a button to shift the dotted lines representing the screen
> boundaries by 10 pixels with each click to test this.
> ___
> 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: On Performance of Array Access

2018-08-31 Thread Brian Milby via use-livecode
Cool. I subscribed to the PR :)

I’ll need to run this on the array stress test I did last week.

Thanks,
Brian
On Aug 31, 2018, 8:58 AM -0500, Mark Waddingham via use-livecode 
, wrote:
> Generally, I don't tend to like to 'jump the gun' on anything related to
> optimization lest it is not what it seems when running in the real world
> but...
>
> I'm becoming increasingly confident that a recent foray of mine into yet
> another attempt to improve the speed of array access in LC9 might have
> actually born some quite tasty fruit. Pleasingly the code changes
> required are small, highly localized and quite possibly more than
> suitable for including in a 9.0.x maintenance release.
>
> The current WIP PR can be found here:
>
> https://github.com/livecode/livecode/pull/6671
>
> Amusingly this didn't even start as an attempt at optimization, but an
> attempt to see if I could do anything about heap fragmentation!
>
> The patch itself does three things:
>
> 1) Minimizes the in-memory size of the core types - all 'book-keeping'
> records are now <=32 bytes on 64-bit systems
>
> 2) Makes use of tArray[x]...[z] type expressions much more efficient
> when both evaluating and mutating
>
> 3) Makes use of integer indicies in arrays much more efficient
>
> I've been running it on a number of benchmarks, the two most notable
> follow.
>
> LARGE ARRAY CONSTRUCTION
>
> The following simple code example was supplied in Bug 17434 by Richard
> as it appears to show a memory leak (its actually heap fragmentation,
> but that's another story):
>
> put 100 into tMax
> repeat with i = 1 to tMax
> repeat with j = 1 to tMax
> repeat with k = 1 to tMax
> put any item of "bob,carol,ted,alice" into sA[i][j][k]
> end repeat
> end repeat
> end repeat
>
> The code constructs an 100x100x100 matrix (rendered as a nested array,
> rather than a flat one).
>
> Timings in various versions (on my 2018 MBP laptop) are:
>
> 6.7.11: 1117ms
> 9.0.1: 4020ms
> PR6671: 1017ms
>
> This would seem to be a not too uncommon a pattern of code - judging by
> JBV's recent post on here (which was essentially doing the same thing).
>
> We can modify the above slightly to make it more focussed on array
> performance (i.e. taking out the need to construct / copy a random
> portion of a string):
>
> put 100 into tMax
> repeat with i = 1 to tMax
> repeat with j = 1 to tMax
> repeat with k = 1 to tMax
> put "bob,carol,ted,alice" into sA[i][j][k]
> end repeat
> end repeat
> end repeat
>
> Timings for this are:
>
> 6.7.11: 1055ms
> 9.0.1: 3281ms
> PR6671: 497ms
>
> ARRAY RECORD FILTERING
>
> The following code example was derived by me for my recent LCG talk
> based on a real-world code supplied by Mark Talluto. It iterates over a
> sequence of arrays, creating a new one where each record only has a
> subset of the keys. The keys to keep are taken from a stringlist:
>
> private function _BenchmarkArrayFilterRecords pRecords, pColumnNames
> local tFilteredRecords, tFilteredRecord
> repeat for each element tRecord in pRecords
> repeat for each item tColumnName in pColumnNames
> put tRecord[tColumnName] into tFilteredRecord[tColumnName]
> end repeat
> put tFilteredRecord into \
> tFilteredRecords[the number of elements in tFilteredRecords
> + 1]
> end repeat
> return tFilteredRecords
> end _BenchmarkArrayFilterRecords
>
> Timings for 10 iterations of the above are:
>
> 6.7.11: 16872ms
> 9.0.1: 8305ms
> PR6671: 4315ms
>
> The following is the same as the above, except the keys to keep are
> taken from the keys of an array:
>
> private function _BenchmarkArrayFilterRecordsSet pRecords,
> pColumnNameSet
> local tFilteredRecords, tFilteredRecord
> repeat for each element tRecord in pRecords
> repeat for each key tColumnName in pColumnNameSet
> put tRecord[tColumnName] into tFilteredRecord[tColumnName]
> end repeat
> put tFilteredRecord into \
> tFilteredRecords[the number of elements in tFilteredRecords
> + 1]
> end repeat
> return tFilteredRecords
> end _BenchmarkArrayFilterRecordsSet
>
> Timings for 10 iterations of the above are:
>
> 6.7.11: 16508ms
> 9.0.1: 6397ms
> PR6671: 3001ms
>
> REAL WORLD CASE
>
> Now, I'm always a little skeptical about using synthetic benchmarks for
> performance. However, both of the above are actually real-world
> examples. Furthermore, when running a rather large LCS project on an
> engine with PR6671, I got a 2x speed up - one particular input took
> 3mins to process, rather than 6mins (one phase of processing actually
> saw a 5x speed up!).
>
> Anyway, thought this might make some potentially pleasing Friday
> afternoon news :)
>
> Warmest Regards,
>
> Mark.
>
> --
> Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
> LiveCode: Everyone can create apps
>
> ___
> 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 get word offset all instances of a string in a chunk of text?

2018-08-31 Thread Keith Clarke via use-livecode
Thanks Alex, HH & Jim for all the help & ideas.

Just to close out the thread with a solution for future reference, the code 
below now extracts from a text source a list of unique words, cleaned up 
against a noise-word list, with word frequency, word & and a comma-delimited 
string of the word number within the original source.


# Build unique words array
repeat for each trueWord W in tSource

add 1 to tWordNum

if tANoise[W] then next repeat

put comma & tWordNum after tAWords[W]

end repeat


# Convert unique words array to list

repeat for each key K in tAWords

put K && tAWords[K] & CR after tTemp

end repeat


repeat for each line tLine in tTemp

put the number of items in tLine & comma & tLine & cr after tWords

end repeat


sort lines of tWords descending numeric by item 1 of each

put tWords into field "Words"


Thanks & regards,
Keith




 
___
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: am I regexing by mistake?

2018-08-31 Thread Brian Milby via use-livecode
Need to put question mark in brackets “[?]” when using wildcard filters if you 
want to match a literal question mark. Otherwise it signifies a single 
character match to anything.

Thanks,
Brian
On Aug 31, 2018, 9:12 AM -0500, David V Glasgow via use-livecode 
, wrote:
> Hello, folks.
>
> I am undertaking keyword searches of chat logs. The keywords are stored as 
> themed lists in fields.
>
> One of the things I am interested in is finding lines where one contributor 
> asks another about where they live, shop, go to school etc etc. So, (among 
> other phrases) I filter for lines in the text containing the acronym “ asl ” 
> (nowhere are quotes actually included in fields or variables, they’re just in 
> this mail). I pad with spaces so as not to find “asleep”. I also want to find 
> “asl?”
>
> So I repeat through lines of the keyword field “location"
>
> Filter lines of tsource with tpattern
>
> … which works for everything except fails to match “asl?”. It occurred to me 
> that perhaps the question mark is being interpreted as a regex symbol, so I 
> tried changing the line in the field to read “ asl/?”, but that doesn’t find 
> the “asl?” that I can see in the third line of the text to be searched….
>
>
> shadownave (09/16/14 1:44:58 AM): hey care to chat
> shadownave (09/16/14 1:45:09 AM): hey care to chat
> what_sez_moo (09/16/14 1:45:18 AM): sure asl?
> what_sez_moo (09/16/14 1:45:52 AM): 13 / F / Ashton here
> shadownave (09/16/14 1:51:00 AM): 25/m/Derby
> shadownave (09/16/14 1:51:03 AM): how r u tonight
> what_sez_moo (09/16/14 1:51:16 AM): bored.
>
>
> What am I doing wrong? Is this something to do with regex?
>
> Oh yes, and I thought there might be invisible characters messing things up, 
> so I exported source text as plain text from BBedit, with no improvement.
>
> best wishes
>
> David Glasgow
> ___
> 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: am I regexing by mistake?

2018-08-31 Thread David V Glasgow via use-livecode
Ah!  So its just a wildcard!  Brilliant.  Why didn’t I think of that?

 I was wrongly barking up the Regex tree, and making things more complicated 
than needed.

Thank you Brian.

Cheers

David G

> On 31 Aug 2018, at 3:35 pm, Brian Milby via use-livecode 
>  wrote:
> 
> Need to put question mark in brackets “[?]” when using wildcard filters if 
> you want to match a literal question mark. Otherwise it signifies a single 
> character match to anything.
> 
> Thanks,
> Brian
> On Aug 31, 2018, 9:12 AM -0500, David V Glasgow via use-livecode 
> , wrote:
>> Hello, folks.
>> 
>> I am undertaking keyword searches of chat logs. The keywords are stored as 
>> themed lists in fields.
>> 
>> One of the things I am interested in is finding lines where one contributor 
>> asks another about where they live, shop, go to school etc etc. So, (among 
>> other phrases) I filter for lines in the text containing the acronym “ asl ” 
>> (nowhere are quotes actually included in fields or variables, they’re just 
>> in this mail). I pad with spaces so as not to find “asleep”. I also want to 
>> find “asl?”
>> 
>> So I repeat through lines of the keyword field “location"
>> 
>> Filter lines of tsource with tpattern
>> 
>> … which works for everything except fails to match “asl?”. It occurred to me 
>> that perhaps the question mark is being interpreted as a regex symbol, so I 
>> tried changing the line in the field to read “ asl/?”, but that doesn’t find 
>> the “asl?” that I can see in the third line of the text to be searched….
>> 
>> 
>> shadownave (09/16/14 1:44:58 AM): hey care to chat
>> shadownave (09/16/14 1:45:09 AM): hey care to chat
>> what_sez_moo (09/16/14 1:45:18 AM): sure asl?
>> what_sez_moo (09/16/14 1:45:52 AM): 13 / F / Ashton here
>> shadownave (09/16/14 1:51:00 AM): 25/m/Derby
>> shadownave (09/16/14 1:51:03 AM): how r u tonight
>> what_sez_moo (09/16/14 1:51:16 AM): bored.
>> 
>> 
>> What am I doing wrong? Is this something to do with regex?
>> 
>> Oh yes, and I thought there might be invisible characters messing things up, 
>> so I exported source text as plain text from BBedit, with no improvement.
>> 
>> best wishes
>> 
>> David Glasgow
>> ___
>> 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


___
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