Re: Managing windows in the IDE on Mac

2023-07-31 Thread Jerry Jensen via use-livecode
I now always "set the backdrop to none” right away in the main stack. Otherwise 
mine is always black. Pain.
.Jerry

> On Jul 31, 2023, at 8:56 PM, J. Landman Gay via use-livecode 
>  wrote:
> 
> Hey Dar! So nice to see you here again.
> 
> The backdrop problem is a known bug on Ventura. Sometimes you can click where 
> the window ought to be and it comes to the front, but basically windowing is 
> broken. The only fix I know of for now is to not use a backdrop.
> 
> 
> 
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
> On July 31, 2023 7:50:52 PM Dar Scott via use-livecode 
>  wrote:
> 
>> It has been a while. Hi, all. I’m getting back into LiveCode.
>> 
>> I’m using 9.6.9 on Mac Ventura.
>> 
>> I’m having a lot of trouble with the windows in the IDE. The backdrop 
>> doesn’t always work. The stack I’m working on keeps disappearing. I can 
>> check Float above everything, but that is not what I need and it can become 
>> a problem when I want to look at something else. The Project Browser stays 
>> behind everything and then disappears when I click on it.
>> 
>> Dar
>> 
>> 
>> 
>> 
>> Dar Scott
>> 
>> 
>> 
>> +1.505.433.1024  | darzLAB.com  | 
>> darsc...@darzlab.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
> 
> 
> 
> 
> ___
> 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: Managing windows in the IDE on Mac

2023-07-31 Thread J. Landman Gay via use-livecode

Hey Dar! So nice to see you here again.

The backdrop problem is a known bug on Ventura. Sometimes you can click 
where the window ought to be and it comes to the front, but basically 
windowing is broken. The only fix I know of for now is to not use a backdrop.




--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On July 31, 2023 7:50:52 PM Dar Scott via use-livecode 
 wrote:



It has been a while. Hi, all. I’m getting back into LiveCode.

I’m using 9.6.9 on Mac Ventura.

I’m having a lot of trouble with the windows in the IDE. The backdrop 
doesn’t always work. The stack I’m working on keeps disappearing. I can 
check Float above everything, but that is not what I need and it can become 
a problem when I want to look at something else. The Project Browser stays 
behind everything and then disappears when I click on it.


Dar




Dar Scott



+1.505.433.1024  | darzLAB.com  | 
darsc...@darzlab.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





___
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


Managing windows in the IDE on Mac

2023-07-31 Thread Dar Scott via use-livecode
It has been a while. Hi, all. I’m getting back into LiveCode.

I’m using 9.6.9 on Mac Ventura. 

I’m having a lot of trouble with the windows in the IDE. The backdrop doesn’t 
always work. The stack I’m working on keeps disappearing. I can check Float 
above everything, but that is not what I need and it can become a problem when 
I want to look at something else. The Project Browser stays behind everything 
and then disappears when I click on it. 

Dar




Dar Scott



+1.505.433.1024  | darzLAB.com  | 
darsc...@darzlab.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: charIndex property

2023-07-31 Thread Bob Sneidar via use-livecode
Are you using Thunderbird for an email client? Or are you copying from the 
forum? This was talked about years ago. For some reason different apps format 
clipboard text differently, and this is an artifact of one of those apps. That 
is why I paste, then re-copy code in a text editor like TextEdit or Sublime 
Text. If I don’t, then the lines are double spaced and it looks like crap and 
is hard to read.

:-)

Bob S


On Jul 31, 2023, at 9:08 AM, Paul Dupuis via use-livecode 
 wrote:

I have no idea why pasting placed *'s all over the place!

___
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: charIndex property

2023-07-31 Thread Bob Sneidar via use-livecode
On Jul 31, 2023, at 8:54 AM, Paul Dupuis via use-livecode 
 wrote:

Bob,

Here is a version of Mark's method, for trueWords, sentences, and paragraphs, 
with the added parameter of pDirection to get the char index of the start of 
the chunk or the end of the chunk containing the character position pChunkIndex.

Thanks, but whatever email app you sent from borked the code, putting asterisks 
before and after every keyword and running other words together. I always 
paste/copy my code in a generic text editor before sending to the list.

At any rate, I cleaned it up and here is the code. Not sure why you made it a 
private function but I removed the keyword PRIVATE so it could be used anywhere.

Thanks Mark for this effort. I think it should become part of the Master 
Library.

Bob S

function  rwCharIndex pText, pChunkType, pChunkIndex, pDirection
   -- pText is the full text
   -- pChunkType is once of: words|sentences|paragraphs
   -- pChunkIndex is the integer index in the indicated units. ie. "word",7 is 
the 7th word
   -- pDirection is one of: first|last meaning either the 1st character of the 
chunk or the last character
   -- error checking, empty is returned if an error occurs with the parameters
   if  pText is empty then return empty
   if  pChunkType is not among the items of "words,sentences,paragraphs" then 
return empty
   if  pChunkIndex is not an integer then return empty
   if  pDirection is not among the items of "first,last" then return empty
   local tL
   switch  pChunkType
  case  "words"
 switch  pDirection
case  "first"
   put null into trueWord pChunkIndex to-1 of pText
   put codeunitOffset(null,pText) into N
   delete codeunit N to-1 of pText
   return (the number of chars in pText + 1)
   break
case  "last"
   put length(trueWord pChunkIndex of pText) into tL
   put null into trueWord pChunkIndex to-1 of pText
   put codeunitOffset(null,pText) into N
   delete codeunit N to-1 of pText
   return (the number of characters in pText + tL)
   break
 end   switch
 break
  case  "sentences"
 switch  pDirection
case  "first"
   put null into sentence pChunkIndex to-1 of pText
   put codeunitOffset(null,pText) into N
   delete codeunit N to-1 of pText
   return (the number of chars in pText + 1)
   break
case  "last"
   put length(sentence pChunkIndex of pText) into tL
   put null into sentence pChunkIndex to-1 of pText
   put codeunitOffset(null,pText) into N
   delete codeunit N to-1 of pText
   return (the number of characters in pText + tL)
   break
 end   switch
 break
  case  "paragraphs"
 switch  pDirection
case  "first"
   put null into paragraph pChunkIndex to-1 of pText
   put codeunitOffset(null,pText) into N
   delete codeunit N to-1 of pText
   return (the number of chars in pText + 1)
   break
case  "last"
   put length(paragraph pChunkIndex of pText) into tL
   put null into paragraph pChunkIndex to-1 of pText
   put codeunitOffset(null,pText) into N
   delete codeunit N to-1 of pText
   return (the number of characters in pText + tL)
   break
 end   switch
 break
   end   switch
end rwCharIndex
___
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: charIndex property

2023-07-31 Thread Paul Dupuis via use-livecode

I have no idea why pasting placed *'s all over the place!

On 7/31/2023 11:54 AM, Paul Dupuis via use-livecode wrote:

Bob,

Here is a version of Mark's method, for trueWords, sentences, and 
paragraphs, with the added parameter of pDirection to get the char 
index of the start of the chunk or the end of the chunk containing the 
character position pChunkIndex.


*private**function* rwCharIndex pText, pChunkType, pChunkIndex, 
pDirection


*-- pText is the full text*

*-- pChunkType is once of: words|sentences|paragraphs*

*-- pChunkIndex is the integer index in the indicated units. ie. 
"word",7 is the 7th word*


*-- pDirection is one of: first|last meaning either the 1st character 
of the chunk or the last character*


*-- error checking, emty is returned if an error occurs with the 
parameters*


*if* pText isempty*then* *return*empty

*if* pChunkType isnotamongtheitemsof"words,sentences,paragraphs"*then* 
*return*empty


*if* pChunkIndex isnotaninteger*then* *return*empty

*if* pDirection isnotamongtheitemsof"first,last"*then* *return*empty

*local*tL

*switch* pChunkType

*case* "words"

*switch* pDirection

*case* "first"

*put*nullintotrueWordpChunkIndex to-1 ofpText

*put*codeunitOffset(null,pText) intoN

*delete*codeunitN to-1 ofpText

*return*(thenumberofcharsinpText + 1)

*break*

*case* "last"

*put*length(trueWordpChunkIndex ofpText) intotL

*put*nullintotrueWordpChunkIndex to-1 ofpText

*put*codeunitOffset(null,pText) intoN

*delete*codeunitN to-1 ofpText

*return*(thenumberofcharactersinpText + tL)

*break*

*end* *switch*

*break*

*case* "sentences"

*switch* pDirection

*case* "first"

*put*nullintosentencepChunkIndex to-1 ofpText

*put*codeunitOffset(null,pText) intoN

*delete*codeunitN to-1 ofpText

*return*(thenumberofcharsinpText + 1)

*break*

*case* "last"

*put*length(sentencepChunkIndex ofpText) intotL

*put*nullintosentencepChunkIndex to-1 ofpText

*put*codeunitOffset(null,pText) intoN

*delete*codeunitN to-1 ofpText

*return*(thenumberofcharactersinpText + tL)

*break*

*end* *switch*

*break*

*case* "paragraphs"

*switch* pDirection

*case* "first"

*put*nullintoparagraphpChunkIndex to-1 ofpText

*put*codeunitOffset(null,pText) intoN

*delete*codeunitN to-1 ofpText

*return*(thenumberofcharsinpText + 1)

*break*

*case* "last"

*put*length(paragraphpChunkIndex ofpText) intotL

*put*nullintoparagraphpChunkIndex to-1 ofpText

*put*codeunitOffset(null,pText) intoN

*delete*codeunitN to-1 ofpText

*return*(thenumberofcharactersinpText + tL)

*break*

*end* *switch*

*break*

*end* *switch*

*end*rwCharIndex




On 7/31/2023 11:44 AM, Bob Sneidar via use-livecode wrote:
I replaced the code in the original function with this code and it 
won’t compile.


Do you mind posting the full working function again?

Bob S


On Jul 27, 2023, at 2:06 PM, Mark Waddingham via use-livecode 
 wrote:


Oh those pesky chunks which don’t ‘cover’ the target string (which 
is actually all of them except codeunit/point/char come to think of 
it). I should have run through a few more examples in my head before 
posting….


Alternative attempt:

Put null into word N to -1 of S
Delete codeunit (codeunitoffset(null, S) to -1 of S
Return the number of chars in S + 1

The problem before was the chars which do not form part of the last 
chunk and remain after deletion.


The above puts in a sentinel char which can be searched for to find 
where the requested chunk started.


Second time lucky? ;)

Mark.

Sent from my iPhone

On 27 Jul 2023, at 21:23, Paul Dupuis via use-livecode 
 wrote:


On 7/27/2023 4:31 AM, Mark Waddingham via use-livecode wrote:

On 2023-07-26 18:02, Paul Dupuis via use-livecode wrote:
If I have some text in a field, I can use the "charIndex" 
property (see Dictionary) to obtain teh character position of the 
first character of a chunk.


Does anyone know of a clever way to do the equivalent of the 
charIndex for an arbitrary chunk expression for a 
container/variable (i.e. not an actual field object)?

This should work I think:

   function charIndexOfWord pWordIndex, pTarget
  delete word pWordIndex to -1 of pTarget
  return the number of characters in pTarget + 1
   end charIndexOfWord

Deletion of chunks works from the first char that makes up the 
computed range, so you are left with all the characters which sit 
before it.


The index of the character immediately before the start of the 
specified word is the just the number of characters which sit 
before it; and so the index of the first char of the specified 
word (which is what charIndex gives you in a field) is that +1.


The above should work for both +ve and -ve indices, and the 
obvious changes will make it work for other string chunks (i.e. 
change 'Word' for ).



Mark,

Thank you very much. This was a brilliant approach and I should 
have thought of it myself. However, it is not quite an accurate 
substitute for the charIndex property of a field. The following 
example illustrates the issue:


pTarget is [The 

LC domains for sale

2023-07-31 Thread Richard Gaskin via use-livecode
I had taken out these domains some time ago for possible projects, but now I'm 
planning on having those proposed services become part of the existing 
livecodejournal.com domain instead.
 
If anyone here is interested in these domains they're listed at AfterNIC.com, 
and I'd be happy to negotiate favorable pricing if you have a 
community-oriented use in mind:
 
livecodeworld.com
learnlivecode.com
 
-- 
 
Richard Gaskin
Fourth World System
 

___
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: charIndex property

2023-07-31 Thread Paul Dupuis via use-livecode

Bob,

Here is a version of Mark's method, for trueWords, sentences, and 
paragraphs, with the added parameter of pDirection to get the char index 
of the start of the chunk or the end of the chunk containing the 
character position pChunkIndex.


*private**function* rwCharIndex pText, pChunkType, pChunkIndex, pDirection

*-- pText is the full text*

*-- pChunkType is once of: words|sentences|paragraphs*

*-- pChunkIndex is the integer index in the indicated units. ie. 
"word",7 is the 7th word*


*-- pDirection is one of: first|last meaning either the 1st character of 
the chunk or the last character*


*-- error checking, emty is returned if an error occurs with the parameters*

*if* pText isempty*then* *return*empty

*if* pChunkType isnotamongtheitemsof"words,sentences,paragraphs"*then* 
*return*empty


*if* pChunkIndex isnotaninteger*then* *return*empty

*if* pDirection isnotamongtheitemsof"first,last"*then* *return*empty

*local*tL

*switch* pChunkType

*case* "words"

*switch* pDirection

*case* "first"

*put*nullintotrueWordpChunkIndex to-1 ofpText

*put*codeunitOffset(null,pText) intoN

*delete*codeunitN to-1 ofpText

*return*(thenumberofcharsinpText + 1)

*break*

*case* "last"

*put*length(trueWordpChunkIndex ofpText) intotL

*put*nullintotrueWordpChunkIndex to-1 ofpText

*put*codeunitOffset(null,pText) intoN

*delete*codeunitN to-1 ofpText

*return*(thenumberofcharactersinpText + tL)

*break*

*end* *switch*

*break*

*case* "sentences"

*switch* pDirection

*case* "first"

*put*nullintosentencepChunkIndex to-1 ofpText

*put*codeunitOffset(null,pText) intoN

*delete*codeunitN to-1 ofpText

*return*(thenumberofcharsinpText + 1)

*break*

*case* "last"

*put*length(sentencepChunkIndex ofpText) intotL

*put*nullintosentencepChunkIndex to-1 ofpText

*put*codeunitOffset(null,pText) intoN

*delete*codeunitN to-1 ofpText

*return*(thenumberofcharactersinpText + tL)

*break*

*end* *switch*

*break*

*case* "paragraphs"

*switch* pDirection

*case* "first"

*put*nullintoparagraphpChunkIndex to-1 ofpText

*put*codeunitOffset(null,pText) intoN

*delete*codeunitN to-1 ofpText

*return*(thenumberofcharsinpText + 1)

*break*

*case* "last"

*put*length(paragraphpChunkIndex ofpText) intotL

*put*nullintoparagraphpChunkIndex to-1 ofpText

*put*codeunitOffset(null,pText) intoN

*delete*codeunitN to-1 ofpText

*return*(thenumberofcharactersinpText + tL)

*break*

*end* *switch*

*break*

*end* *switch*

*end*rwCharIndex




On 7/31/2023 11:44 AM, Bob Sneidar via use-livecode wrote:

I replaced the code in the original function with this code and it won’t 
compile.

Do you mind posting the full working function again?

Bob S



On Jul 27, 2023, at 2:06 PM, Mark Waddingham via use-livecode 
 wrote:

Oh those pesky chunks which don’t ‘cover’ the target string (which is actually 
all of them except codeunit/point/char come to think of it). I should have run 
through a few more examples in my head before posting….

Alternative attempt:

Put null into word N to -1 of S
Delete codeunit (codeunitoffset(null, S) to -1 of S
Return the number of chars in S + 1

The problem before was the chars which do not form part of the last chunk and 
remain after deletion.

The above puts in a sentinel char which can be searched for to find where the 
requested chunk started.

Second time lucky? ;)

Mark.

Sent from my iPhone


On 27 Jul 2023, at 21:23, Paul Dupuis via use-livecode 
 wrote:

On 7/27/2023 4:31 AM, Mark Waddingham via use-livecode wrote:

On 2023-07-26 18:02, Paul Dupuis via use-livecode wrote:
If I have some text in a field, I can use the "charIndex" property (see 
Dictionary) to obtain teh character position of the first character of a chunk.

Does anyone know of a clever way to do the equivalent of the charIndex for an 
arbitrary chunk expression for a container/variable (i.e. not an actual field 
object)?

This should work I think:

   function charIndexOfWord pWordIndex, pTarget
  delete word pWordIndex to -1 of pTarget
  return the number of characters in pTarget + 1
   end charIndexOfWord

Deletion of chunks works from the first char that makes up the computed range, 
so you are left with all the characters which sit before it.

The index of the character immediately before the start of the specified word 
is the just the number of characters which sit before it; and so the index of 
the first char of the specified word (which is what charIndex gives you in a 
field) is that +1.

The above should work for both +ve and -ve indices, and the obvious changes will make 
it work for other string chunks (i.e. change 'Word' for ).


Mark,

Thank you very much. This was a brilliant approach and I should have thought of 
it myself. However, it is not quite an accurate substitute for the charIndex 
property of a field. The following example illustrates the issue:

pTarget is [The quick brown fox jumps over the lazy dog. The lazy dog was named 
"Oz".]
pWordIndex is 8 (having been derived from searching for 'lazy', 

Re: charIndex property

2023-07-31 Thread Bob Sneidar via use-livecode
I replaced the code in the original function with this code and it won’t 
compile. 

Do you mind posting the full working function again? 

Bob S


> On Jul 27, 2023, at 2:06 PM, Mark Waddingham via use-livecode 
>  wrote:
> 
> Oh those pesky chunks which don’t ‘cover’ the target string (which is 
> actually all of them except codeunit/point/char come to think of it). I 
> should have run through a few more examples in my head before posting….
> 
> Alternative attempt:
> 
> Put null into word N to -1 of S
> Delete codeunit (codeunitoffset(null, S) to -1 of S
> Return the number of chars in S + 1
> 
> The problem before was the chars which do not form part of the last chunk and 
> remain after deletion.
> 
> The above puts in a sentinel char which can be searched for to find where the 
> requested chunk started.
> 
> Second time lucky? ;)
> 
> Mark.
> 
> Sent from my iPhone
> 
>> On 27 Jul 2023, at 21:23, Paul Dupuis via use-livecode 
>>  wrote:
>> 
>> On 7/27/2023 4:31 AM, Mark Waddingham via use-livecode wrote:
 On 2023-07-26 18:02, Paul Dupuis via use-livecode wrote:
 If I have some text in a field, I can use the "charIndex" property (see 
 Dictionary) to obtain teh character position of the first character of a 
 chunk.
 
 Does anyone know of a clever way to do the equivalent of the charIndex for 
 an arbitrary chunk expression for a container/variable (i.e. not an actual 
 field object)?
>>> 
>>> This should work I think:
>>> 
>>>   function charIndexOfWord pWordIndex, pTarget
>>>  delete word pWordIndex to -1 of pTarget
>>>  return the number of characters in pTarget + 1
>>>   end charIndexOfWord
>>> 
>>> Deletion of chunks works from the first char that makes up the computed 
>>> range, so you are left with all the characters which sit before it.
>>> 
>>> The index of the character immediately before the start of the specified 
>>> word is the just the number of characters which sit before it; and so the 
>>> index of the first char of the specified word (which is what charIndex 
>>> gives you in a field) is that +1.
>>> 
>>> The above should work for both +ve and -ve indices, and the obvious changes 
>>> will make it work for other string chunks (i.e. change 'Word' for ).
>>> 
>> 
>> Mark,
>> 
>> Thank you very much. This was a brilliant approach and I should have thought 
>> of it myself. However, it is not quite an accurate substitute for the 
>> charIndex property of a field. The following example illustrates the issue:
>> 
>> pTarget is [The quick brown fox jumps over the lazy dog. The lazy dog was 
>> named "Oz".]
>> pWordIndex is 8 (having been derived from searching for 'lazy', the 8th word)
>> 
>> Using [] to quote strings.
>> delete word 8 to -1 of pTarget -- deletes [lazy] to ["Oz"] but not the 
>> period (.) at the end since it is not considered part of word -1.
>> This leaves pTarget as [The quick brown fox jumps over the .]
>> The number of characters in pTarget + 1 is actually not the position of the 
>> [l] in [lazy], which is character 36, but the [a] in [azy], character 37, 
>> due to the period being left.
>> 
>> There are some similar issues, being off by  or more, with sentences and 
>> paragraphs in longer text.
>> 
>> Thank you very much for chiming in with a good direction to try.
>> 
>> Paul Dupuis
>> Researchware
>> 
>> 
>> ___
>> 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