Re: Solved: Writing to Mac Application Support folder

2023-07-14 Thread scott--- via use-livecode
Thanks again, Jacque.

My solution for migrating preference files from the Preferences folder to the 
Container turned out to be quite simple but for some reason I spent a bunch of 
time pondering other more complicated methods. In the end I changed an existing 
function which returns a path to the preferences file and had it first look to 
see if a Container exists. If it doesn’t then it creates the Container but 
still returns the path to the original Preferences folder. (This works in my 
use case because the app's first call to this function will always be to “read” 
the preference file)  Now that the Container exists, all future calls to the 
function will return the Container path… and the original data, having been 
already loaded into the app, is ready to write to (and read from) the new 
Container location.

--
Scott Morrow

Elementary Software
(Now with 20% less chalk dust!)
web   https://elementarysoftware.com/
email sc...@elementarysoftware.com
booth1-360-734-4701
--

> On Jul 14, 2023, at 4:05 PM, J. Landman Gay via use-livecode 
>  wrote:
> 
> On 7/14/23 4:10 PM, scott--- via use-livecode wrote:
>> If the file (say a preference.txt file) already exists in the Preferences or 
>> App Support folder, are we able to continue writing to it?  In other words, 
>> is this an issue with the creation of the file or also of writing in general?
>> How are you handling this? Are you attempting to write to the Preferences or 
>> App Support folder first… and are you moving existing files to the 
>> “Container” folder?
> 
> That's a very good question and I'm afraid I don't know the answer. It's 
> worrying though, because a couple of my older products need to write to 
> Preferences. Here's what I do know.
> 
> The issue only came up recently. My tester with the problem is on Ventura but 
> I suspect it's a little older than that.
> 
> In the past I always wrote files to Preferences without issues. For my 
> current project there was already a prefs file there and it worked. But it 
> also worked if I put it directly in App Support, and also worked if I made a 
> container. In fact, it worked anywhere because it's my machine. Not so for 
> others.
> 
> For the tester, I originally tried to create and write the file in 
> Preferences as usual. It didn't work and no file was created. Another tester, 
> also on Ventura, had the Mac ask for permissions, he gave it, and it worked. 
> Everything else I subsequently tried also worked for him.
> 
> Next, I changed the app to write directly to Application Support. Same 
> problem, no file was created, the Mac didn't ask for permission. So I changed 
> it again to create a folder in Application Support with the name of the app 
> and put the prefs file in there. Same failure. Finally, I created the 
> container folder in ~/Library/Conainers and bingo, success.
> 
> The tester who gave permissions and had no trouble at any point, including 
> reading and writing to the container.
> 
> Since I can't test on my own machine, I'm waiting for someone who has my 
> older products to tell me there's a problem. Or I'll lean on my husband to 
> try it. Husbands are good for things like that.
> 
> 
> -- 
> 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: Solved: Writing to Mac Application Support folder

2023-07-14 Thread J. Landman Gay via use-livecode
What I found out is that the app container has permission automatically. 
That's the only place though. All other file access has to be initiated by 
the user.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On July 14, 2023 6:18:45 PM Bob Sneidar via use-livecode 
 wrote:


I don’t think there is any way past this. Ultimately the permissions to 
write to any path must be authorized by the current user agent. If they 
accept, well and good. If not, there cannot be any way around it.


Sent from my iPhone

On Jul 14, 2023, at 16:07, J. Landman Gay via use-livecode 
 wrote:


On 7/14/23 4:10 PM, scott--- via use-livecode wrote:
If the file (say a preference.txt file) already exists in the Preferences 
or App Support folder, are we able to continue writing to it?  In other 
words, is this an issue with the creation of the file or also of writing in 
general?
How are you handling this? Are you attempting to write to the Preferences 
or App Support folder first… and are you moving existing files to the 
“Container” folder?


That's a very good question and I'm afraid I don't know the answer. It's 
worrying though, because a couple of my older products need to write to 
Preferences. Here's what I do know.


The issue only came up recently. My tester with the problem is on Ventura 
but I suspect it's a little older than that.


In the past I always wrote files to Preferences without issues. For my 
current project there was already a prefs file there and it worked. But it 
also worked if I put it directly in App Support, and also worked if I made 
a container. In fact, it worked anywhere because it's my machine. Not so 
for others.


For the tester, I originally tried to create and write the file in 
Preferences as usual. It didn't work and no file was created. Another 
tester, also on Ventura, had the Mac ask for permissions, he gave it, and 
it worked. Everything else I subsequently tried also worked for him.


Next, I changed the app to write directly to Application Support. Same 
problem, no file was created, the Mac didn't ask for permission. So I 
changed it again to create a folder in Application Support with the name of 
the app and put the prefs file in there. Same failure. Finally, I created 
the container folder in ~/Library/Conainers and bingo, success.


The tester who gave permissions and had no trouble at any point, including 
reading and writing to the container.


Since I can't test on my own machine, I'm waiting for someone who has my 
older products to tell me there's a problem. Or I'll lean on my husband to 
try it. Husbands are good for things like that.



--
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

___
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: Solved: Writing to Mac Application Support folder

2023-07-14 Thread Bob Sneidar via use-livecode
I don’t think there is any way past this. Ultimately the permissions to write 
to any path must be authorized by the current user agent. If they accept, well 
and good. If not, there cannot be any way around it. 

Sent from my iPhone

> On Jul 14, 2023, at 16:07, J. Landman Gay via use-livecode 
>  wrote:
> 
> On 7/14/23 4:10 PM, scott--- via use-livecode wrote:
>> If the file (say a preference.txt file) already exists in the Preferences or 
>> App Support folder, are we able to continue writing to it?  In other words, 
>> is this an issue with the creation of the file or also of writing in general?
>> How are you handling this? Are you attempting to write to the Preferences or 
>> App Support folder first… and are you moving existing files to the 
>> “Container” folder?
> 
> That's a very good question and I'm afraid I don't know the answer. It's 
> worrying though, because a couple of my older products need to write to 
> Preferences. Here's what I do know.
> 
> The issue only came up recently. My tester with the problem is on Ventura but 
> I suspect it's a little older than that.
> 
> In the past I always wrote files to Preferences without issues. For my 
> current project there was already a prefs file there and it worked. But it 
> also worked if I put it directly in App Support, and also worked if I made a 
> container. In fact, it worked anywhere because it's my machine. Not so for 
> others.
> 
> For the tester, I originally tried to create and write the file in 
> Preferences as usual. It didn't work and no file was created. Another tester, 
> also on Ventura, had the Mac ask for permissions, he gave it, and it worked. 
> Everything else I subsequently tried also worked for him.
> 
> Next, I changed the app to write directly to Application Support. Same 
> problem, no file was created, the Mac didn't ask for permission. So I changed 
> it again to create a folder in Application Support with the name of the app 
> and put the prefs file in there. Same failure. Finally, I created the 
> container folder in ~/Library/Conainers and bingo, success.
> 
> The tester who gave permissions and had no trouble at any point, including 
> reading and writing to the container.
> 
> Since I can't test on my own machine, I'm waiting for someone who has my 
> older products to tell me there's a problem. Or I'll lean on my husband to 
> try it. Husbands are good for things like that.
> 
> 
> -- 
> 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
___
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: Solved: Writing to Mac Application Support folder

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

On 7/14/23 4:10 PM, scott--- via use-livecode wrote:

If the file (say a preference.txt file) already exists in the Preferences or 
App Support folder, are we able to continue writing to it?  In other words, is 
this an issue with the creation of the file or also of writing in general?

How are you handling this? Are you attempting to write to the Preferences or 
App Support folder first… and are you moving existing files to the “Container” 
folder?


That's a very good question and I'm afraid I don't know the answer. It's worrying though, 
because a couple of my older products need to write to Preferences. Here's what I do know.


The issue only came up recently. My tester with the problem is on Ventura but I suspect it's a 
little older than that.


In the past I always wrote files to Preferences without issues. For my current project there 
was already a prefs file there and it worked. But it also worked if I put it directly in App 
Support, and also worked if I made a container. In fact, it worked anywhere because it's my 
machine. Not so for others.


For the tester, I originally tried to create and write the file in Preferences as usual. It 
didn't work and no file was created. Another tester, also on Ventura, had the Mac ask for 
permissions, he gave it, and it worked. Everything else I subsequently tried also worked for him.


Next, I changed the app to write directly to Application Support. Same problem, no file was 
created, the Mac didn't ask for permission. So I changed it again to create a folder in 
Application Support with the name of the app and put the prefs file in there. Same failure. 
Finally, I created the container folder in ~/Library/Conainers and bingo, success.


The tester who gave permissions and had no trouble at any point, including reading and writing 
to the container.


Since I can't test on my own machine, I'm waiting for someone who has my older products to tell 
me there's a problem. Or I'll lean on my husband to try it. Husbands are good for things like that.



--
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: Solved: Writing to Mac Application Support folder

2023-07-14 Thread Bob Sneidar via use-livecode
Create file and write permissions are very seldom different. 

Sent from my iPhone

> On Jul 14, 2023, at 14:11, scott--- via use-livecode 
>  wrote:
> 
> Hello Jacque,  I haven’t encountered this yet so I’m hoping to get some 
> advice about how to proceed.  2 questions:
> 
> If the file (say a preference.txt file) already exists in the Preferences or 
> App Support folder, are we able to continue writing to it?  In other words, 
> is this an issue with the creation of the file or also of writing in general?
> 
> How are you handling this? Are you attempting to write to the Preferences or 
> App Support folder first… and are you moving existing files to the 
> “Container” folder? 
> 
> Thanks for the heads-up and recipe on how to create the folder.
> 
> --
> Scott Morrow
> 
> Elementary Software
> (Now with 20% less chalk dust!)
> web   https://elementarysoftware.com/
> email sc...@elementarysoftware.com
> booth1-360-734-4701
> --
> 
>> On Jul 10, 2023, at 1:11 PM, J. Landman Gay via use-livecode 
>>  wrote:
>> 
>> After innumerable tests and failures I've figured out how to read/write to 
>> the Application Support folder on newer versions of MacOS X. Manually 
>> setting permissions in System Settings didn't work for my tester, and 
>> Ventura never did ask him to allow file access, so he was stuck.
>> 
>> In case anyone else needs to do this, here is what worked for distribution 
>> outside the Mac App Store.
>> 
>> 1. The app must be signed and notarized. I thank Matthias every day for his 
>> mrSignNotarizeHelper. The app does not need to be sandboxed.
>> 
>> 2. Apps can automatically read from and write to their own container. My 
>> problem was not knowing where the container was.
>> 
>> 3. The path to the container is in ~/Library/Containers//
>> 
>> We don't have a specialFolderPath for that, so here's how I did it:
>> 
>>   put specialFolderPath("support") into tContainer
>>   set the itemdel to slash
>>   put "Containers/your.bundle.id/" into last item of tContainer
>>   if there is no folder tContainer then
>> create folder tContainer
>> if the result <> empty then log "Create container:" && the result
>>   end if
>>   put tContainer & "yourFileName.ext" into tPath
>> 
>> This appears to work on any version of MacOS X so far, though I haven't yet 
>> heard from a tester on Mojave.
>> 
>> Note: in the past I could just write a file into the Preferences or the App 
>> Support folder and it worked. Now I can't. You need the app container.
>> 
>> -- 
>> 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
___
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: Solved: Writing to Mac Application Support folder

2023-07-14 Thread scott--- via use-livecode
Hello Jacque,  I haven’t encountered this yet so I’m hoping to get some advice 
about how to proceed.  2 questions:

If the file (say a preference.txt file) already exists in the Preferences or 
App Support folder, are we able to continue writing to it?  In other words, is 
this an issue with the creation of the file or also of writing in general?

How are you handling this? Are you attempting to write to the Preferences or 
App Support folder first… and are you moving existing files to the “Container” 
folder? 

Thanks for the heads-up and recipe on how to create the folder.

--
Scott Morrow

Elementary Software
(Now with 20% less chalk dust!)
web   https://elementarysoftware.com/
email sc...@elementarysoftware.com
booth1-360-734-4701
--

> On Jul 10, 2023, at 1:11 PM, J. Landman Gay via use-livecode 
>  wrote:
> 
> After innumerable tests and failures I've figured out how to read/write to 
> the Application Support folder on newer versions of MacOS X. Manually setting 
> permissions in System Settings didn't work for my tester, and Ventura never 
> did ask him to allow file access, so he was stuck.
> 
> In case anyone else needs to do this, here is what worked for distribution 
> outside the Mac App Store.
> 
> 1. The app must be signed and notarized. I thank Matthias every day for his 
> mrSignNotarizeHelper. The app does not need to be sandboxed.
> 
> 2. Apps can automatically read from and write to their own container. My 
> problem was not knowing where the container was.
> 
> 3. The path to the container is in ~/Library/Containers//
> 
> We don't have a specialFolderPath for that, so here's how I did it:
> 
>put specialFolderPath("support") into tContainer
>set the itemdel to slash
>put "Containers/your.bundle.id/" into last item of tContainer
>if there is no folder tContainer then
>  create folder tContainer
>  if the result <> empty then log "Create container:" && the result
>end if
>put tContainer & "yourFileName.ext" into tPath
> 
> This appears to work on any version of MacOS X so far, though I haven't yet 
> heard from a tester on Mojave.
> 
> Note: in the past I could just write a file into the Preferences or the App 
> Support folder and it worked. Now I can't. You need the app container.
> 
> -- 
> 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: Solved: Writing to Mac Application Support folder

2023-07-14 Thread scott--- via use-livecode
Hello Jacque,  I haven’t encountered this yet so I’m hoping to get some advice 
about how to proceed.  2 questions:

If the file (say a preference.txt file) already exists in the Preferences or 
App Support folder, are we able to continue writing to it?  In other words, is 
this an issue with the creation of the file or also of writing in general?

How are you handling this? Are you attempting to write to the Preferences or 
App Support folder first… and are you moving existing files to the “Container” 
folder? 

Thanks for the heads-up and recipe on how to create the folder.

--
Scott Morrow

Elementary Software
(Now with 20% less chalk dust!)
web   https://elementarysoftware.com/
email sc...@elementarysoftware.com
booth1-360-734-4701
--

> On Jul 10, 2023, at 1:11 PM, J. Landman Gay via use-livecode 
>  wrote:
> 
> After innumerable tests and failures I've figured out how to read/write to 
> the Application Support folder on newer versions of MacOS X. Manually setting 
> permissions in System Settings didn't work for my tester, and Ventura never 
> did ask him to allow file access, so he was stuck.
> 
> In case anyone else needs to do this, here is what worked for distribution 
> outside the Mac App Store.
> 
> 1. The app must be signed and notarized. I thank Matthias every day for his 
> mrSignNotarizeHelper. The app does not need to be sandboxed.
> 
> 2. Apps can automatically read from and write to their own container. My 
> problem was not knowing where the container was.
> 
> 3. The path to the container is in ~/Library/Containers//
> 
> We don't have a specialFolderPath for that, so here's how I did it:
> 
>put specialFolderPath("support") into tContainer
>set the itemdel to slash
>put "Containers/your.bundle.id/" into last item of tContainer
>if there is no folder tContainer then
>  create folder tContainer
>  if the result <> empty then log "Create container:" && the result
>end if
>put tContainer & "yourFileName.ext" into tPath
> 
> This appears to work on any version of MacOS X so far, though I haven't yet 
> heard from a tester on Mojave.
> 
> Note: in the past I could just write a file into the Preferences or the App 
> Support folder and it worked. Now I can't. You need the app container.
> 
> -- 
> 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: Field highlited

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

On 7/14/23 11:14 AM, Mark Smith via use-livecode wrote:

BTW, is there a way of determining the default highlight colour?


The dictionary says: "By default, the global hiliteColor property is set to the system 
highlight color."


I'd guess yours is blue. That's pretty standard on Mac.

--
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: Search for an app in Google Play Store

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

On 7/14/23 7:16 AM, Klaus major-k via use-livecode wrote:

I am looking for a support email at GOOGLE Dev.
My problem is the search engine of Google Play Store.
Just like the subject says. ;-)


Oh right, I'm supposed to read the subject title. Oops. This is the closest 
thing I could find:


They don't make it easy.

--
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: Convert date

2023-07-14 Thread Bob Sneidar via use-livecode
Because I’m not that good with regular expressions and the format function. :-) 
But you example has one too many close parens. 

Also, for SQL Date I do not thing UK or US matters. It’s -MM-DD everywhere, 
isn’t it? 

Also, I assumed that the localization of the LC engine would take into account 
the local date format for the built in date functions. Is that incorrect? 

Bob S


> On Jul 14, 2023, at 11:39 AM, Alex Tweedly via use-livecode 
>  wrote:
> 
> 
> On 14/07/2023 16:34, Bob Sneidar via use-livecode wrote:
>>   CASE "sql date"
>>  put item 1 of theDate & "-" & \
>> format("%02d",item 2 of theDate) & "-" & \
>> format("%02d",item 3 of theDate) into theDate
>>  break
> 
> Why not just
> 
> put format("%s-%02d-%02d", item 1 of theDate, item 2 of theDate), \
>   item 3 of theDate) into theDate
> 
> Alex.
> 
> btw - you forgot the if/switch check for
>"if in the USA" vs "if in the 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

___
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: Convert date

2023-07-14 Thread Alex Tweedly via use-livecode



On 14/07/2023 16:34, Bob Sneidar via use-livecode wrote:

   CASE "sql date"
  put item 1 of theDate & "-" & \
 format("%02d",item 2 of theDate) & "-" & \
 format("%02d",item 3 of theDate) into theDate
  break


Why not just

put format("%s-%02d-%02d", item 1 of theDate, item 2 of theDate), \
   item 3 of theDate) into theDate

Alex.

btw - you forgot the if/switch check for
"if in the USA" vs "if in the 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: Field highlited

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

Use the effective keyword as in:

put the effective hiliteColor of field X into tHiliteColor

It will figure out the color by inheritance. If you just put the 
hiliteColor of field X  (without it being set specifically for field X) 
your get empty



On 7/14/2023 12:14 PM, Mark Smith wrote:

BTW, is there a way of determining the default highlight colour? When I select 
some text in a field it highlights to a light blue color, but I can’t find 
where that color is set.

Thanks
Mark



On 13 Jul 2023, at 11:01 pm, Paul Dupuis via use-livecode 
 wrote:

On 7/12/2023 6:21 PM, Paul Dupuis via use-livecode wrote:

I have a LC9 field object - just a scrolling field (not a list field) with a 
lot of text. The user selects some text and then click a button near the field. 
I want the selection to remain highlighted, but when you click outside the 
field the highlight goes away.


Thanks to Richmond, Mark, and Jacque for your responses.

So, I actually need to note the position of the selected (i.e. char x to y) 
rather than the selected text itself.

Indeed, if you have text highlighted in a lock, scrolling text field (autohilite on) and 
click a button, the highlight does not go away. However, if you click on another field it 
does. I need a solution where the highlight appears to remain in the primary 
"Content" field no matter what else the user clicks on in terms of other UI 
actions.

So, it still seems the "best" way to do this is using the on selectioChanged 
message and getting the selectedChunk and if not empty and word 2 is not > word 4 
(insertion point), then save word 2 as the start and word 4 as the end and change the 
background color of the selected range to the highlight color, clearing another of 
background color

This makes it appear that the selection remains, updates it when the use makes 
a new selection, but sacrifices any other use of background color for the text 
in the field (which I can live with)

Thanks all,

___
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: Check connection and timeout

2023-07-14 Thread Bob Sneidar via use-livecode
Hi Ludovic. 

I use a simple method of sockets to determine if I have a connection to a host. 
I close the socket first: 

closeSocket 127.0.0.1:3306

Then I open the socket:

Open socket to 127.0.0.1:3306
Put the result into tError

If terror begins with “ERROR: “ then
   — your code here
End if

Then close the socket again. 

Close socket 127.0.0.1:3306

I find this to be the most reliable way to check a connection. I may not have 
internet, but the host may not be on the internet it may be local. Also, 
sockets will always work whereas ICMP can be blocked by a firewall. And simply 
trying to connect to a host will, as you have noticed bring timeouts into play. 

Bob S



> On Jul 13, 2023, at 11:26 PM, Ludovic THEBAULT via use-livecode 
>  wrote:
> 
> Hello,
> 
> I use this code to check is there is an internet connection :
> 
> tsNETSETTIMEOUTS 60,0,2000,6,5,1000
> 
> put tsNetHeadSync("https://google.com/";, tHeaders, tResult, tBytes) into 
> tRecvHeaders
> 
>   if tResult begins with "tsneterr:" then
>  return false 
>   else
>  return true 
>   end if
> 
> 
> But the setting for the timeout of tsNETSETTIMEOUTS is not active, I always 
> have a 30 seconds timeout.
> 
> Is there an other settings ?
> 
> Thanks.
> ___
> 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: Field highlited

2023-07-14 Thread Mark Smith via use-livecode
BTW, is there a way of determining the default highlight colour? When I select 
some text in a field it highlights to a light blue color, but I can’t find 
where that color is set.

Thanks
Mark


> On 13 Jul 2023, at 11:01 pm, Paul Dupuis via use-livecode 
>  wrote:
> 
> On 7/12/2023 6:21 PM, Paul Dupuis via use-livecode wrote:
>> I have a LC9 field object - just a scrolling field (not a list field) with a 
>> lot of text. The user selects some text and then click a button near the 
>> field. I want the selection to remain highlighted, but when you click 
>> outside the field the highlight goes away.
>> 
> Thanks to Richmond, Mark, and Jacque for your responses.
> 
> So, I actually need to note the position of the selected (i.e. char x to y) 
> rather than the selected text itself.
> 
> Indeed, if you have text highlighted in a lock, scrolling text field 
> (autohilite on) and click a button, the highlight does not go away. However, 
> if you click on another field it does. I need a solution where the highlight 
> appears to remain in the primary "Content" field no matter what else the user 
> clicks on in terms of other UI actions.
> 
> So, it still seems the "best" way to do this is using the on selectioChanged 
> message and getting the selectedChunk and if not empty and word 2 is not > 
> word 4 (insertion point), then save word 2 as the start and word 4 as the end 
> and change the background color of the selected range to the highlight color, 
> clearing another of background color
> 
> This makes it appear that the selection remains, updates it when the use 
> makes a new selection, but sacrifices any other use of background color for 
> the text in the field (which I can live with)
> 
> Thanks all,
> 
> ___
> 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: Check connection and timeout

2023-07-14 Thread Bob Sneidar via use-livecode
Oooohhh… code candy! Thanks again Ralph! 

Bob S


> On Jul 14, 2023, at 9:04 AM, Ralph DiMola via use-livecode 
>  wrote:
> 
> Bob,
> 
> I use this function to return an array of the timeouts.
> 
> function EIStsNetGetTimeouts
>   local tTimeouts, tTsNetTimeoutArray
>   put tsNetGetTimeouts() into tTimeouts
>   put item 1 of tTimeouts into tTsNetTimeoutArray["DnsCacheTimeout"]
>   put item 2 of tTimeouts into tTsNetTimeoutArray["RequestTimeoutMS"]
>   put item 3 of tTimeouts into tTsNetTimeoutArray["ConnectTimeoutMS"]
>   put item 4 of tTimeouts into tTsNetTimeoutArray["AcceptTimeoutMS"]
>   put item 5 of tTimeouts into tTsNetTimeoutArray["LowSpeedTime"]
>   put item 6 of tTimeouts into tTsNetTimeoutArray["LowSpeedLimit"]
>   return tTsNetTimeoutArray
> end EIStsNetGetTimeouts
> 
> Ralph DiMola
> IT Director
> Evergreen Information Services
> rdim...@evergreeninfo.net
> 
> 
> -Original Message-
> From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf
> Of Bob Sneidar via use-livecode
> Sent: Friday, July 14, 2023 11:47 AM
> To: How to use LiveCode
> Cc: Bob Sneidar
> Subject: Re: Check connection and timeout
> 
> Thanks Ralph, very handy, but is there a way to get the timeout to see if
> the command to set the timeout worked? I change networks frequently, and if
> I do not disconnect and reconnect to my SQL database, I run the risk of
> using a stale connection, and then I face the dreaded 60 second stall before
> I can proceed.
> 
> Bob S
> 
> 
> On Jul 14, 2023, at 8:36 AM, Ralph DiMola via use-livecode
>  wrote:
> 
> Sorry,
> 
> It was mine...
> 
> function GetNetworkType
>  local tLibUrlDriver
>  try
> put the behavior of stack"revLibUrl" into tLibUrlDriver
>  end try
>  if tLibUrlDriver is empty then
> return "libURL"
>  else
> return "tsNet"
>  end if
> end GetNetworkType
> 
> Ralph DiMola
> IT Director
> Evergreen Information Services
> rdim...@evergreeninfo.net
> 
> ___
> 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: Check connection and timeout

2023-07-14 Thread Ralph DiMola via use-livecode
Bob,

I use this function to return an array of the timeouts.

function EIStsNetGetTimeouts
   local tTimeouts, tTsNetTimeoutArray
   put tsNetGetTimeouts() into tTimeouts
   put item 1 of tTimeouts into tTsNetTimeoutArray["DnsCacheTimeout"]
   put item 2 of tTimeouts into tTsNetTimeoutArray["RequestTimeoutMS"]
   put item 3 of tTimeouts into tTsNetTimeoutArray["ConnectTimeoutMS"]
   put item 4 of tTimeouts into tTsNetTimeoutArray["AcceptTimeoutMS"]
   put item 5 of tTimeouts into tTsNetTimeoutArray["LowSpeedTime"]
   put item 6 of tTimeouts into tTsNetTimeoutArray["LowSpeedLimit"]
   return tTsNetTimeoutArray
end EIStsNetGetTimeouts

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net


-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf
Of Bob Sneidar via use-livecode
Sent: Friday, July 14, 2023 11:47 AM
To: How to use LiveCode
Cc: Bob Sneidar
Subject: Re: Check connection and timeout

Thanks Ralph, very handy, but is there a way to get the timeout to see if
the command to set the timeout worked? I change networks frequently, and if
I do not disconnect and reconnect to my SQL database, I run the risk of
using a stale connection, and then I face the dreaded 60 second stall before
I can proceed.

Bob S


On Jul 14, 2023, at 8:36 AM, Ralph DiMola via use-livecode
 wrote:

Sorry,

It was mine...

function GetNetworkType
  local tLibUrlDriver
  try
 put the behavior of stack"revLibUrl" into tLibUrlDriver
  end try
  if tLibUrlDriver is empty then
 return "libURL"
  else
 return "tsNet"
  end if
end GetNetworkType

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net

___
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: Check connection and timeout

2023-07-14 Thread Bob Sneidar via use-livecode
Thanks Ralph, very handy, but is there a way to get the timeout to see if the 
command to set the timeout worked? I change networks frequently, and if I do 
not disconnect and reconnect to my SQL database, I run the risk of using a 
stale connection, and then I face the dreaded 60 second stall before I can 
proceed.

Bob S


On Jul 14, 2023, at 8:36 AM, Ralph DiMola via use-livecode 
 wrote:

Sorry,

It was mine...

function GetNetworkType
  local tLibUrlDriver
  try
 put the behavior of stack"revLibUrl" into tLibUrlDriver
  end try
  if tLibUrlDriver is empty then
 return "libURL"
  else
 return "tsNet"
  end if
end GetNetworkType

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net

___
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: Check connection and timeout

2023-07-14 Thread Ralph DiMola via use-livecode
Sorry,

It was mine...

function GetNetworkType
   local tLibUrlDriver
   try
  put the behavior of stack"revLibUrl" into tLibUrlDriver
   end try
   if tLibUrlDriver is empty then
  return "libURL"
   else
  return "tsNet"
   end if
end GetNetworkType

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net

-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of 
Bob Sneidar via use-livecode
Sent: Friday, July 14, 2023 11:21 AM
To: How to use LiveCode
Cc: Bob Sneidar
Subject: Re: Check connection and timeout

getNetwotkType() is not a valid function. 

Bob S


> On Jul 14, 2023, at 8:14 AM, Ralph DiMola via use-livecode 
>  wrote:
> 
> Ludovic,
> 
> Make sure that tsNet is active:
> 
> command NetworkType
>   if GetNetworkType() = "libURL" then
>  answer"tsNet is disabled(LibURL)"
>   else
>  answer "tsNet in use"&cr&"Version==>"& tsNetVersion()
>   end if
> end NetworkType
> 
> Did you initialize tsNet? ==> tsNetInit
> 
> Disable tsNet ==> dispatch "revunloadlibrary" to stack "tsnetliburl"
> To enable tsNet ==> dispatch "revloadlibrary" to stack "tsnetliburl"
> 
> Ralph DiMola
> IT Director
> Evergreen Information Services
> rdim...@evergreeninfo.net
> 
> -Original Message-
> From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf 
> Of Ludovic THEBAULT via use-livecode
> Sent: Friday, July 14, 2023 3:51 AM
> To: How to use LiveCode
> Cc: Ludovic THEBAULT
> Subject: Re: Check connection and timeout
> 
> 
> 
>> Le 14 juil. 2023 à 08:26, Ludovic THEBAULT via use-livecode 
>>  a écrit :
>> 
>> Hello,
>> 
>> I use this code to check is there is an internet connection :
>> 
>> tsNETSETTIMEOUTS 60,0,2000,6,5,1000
>> 
>> put tsNetHeadSync("https://google.com/";, tHeaders, tResult, tBytes) into 
>> tRecvHeaders
>> 
>>  if tResult begins with "tsneterr:" then
>> return false 
>>  else
>> return true 
>>  end if
>> 
>> 
>> But the setting for the timeout of tsNETSETTIMEOUTS is not active, I always 
>> have a 30 seconds timeout.
>> 
>> Is there an other settings ?
>> 
> 
> 
> Addendum :  it happen when there is a connection (aka in 4G or Wifi) but no 
> enough network.
> 
> 
> ___
> 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


___
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: Convert date

2023-07-14 Thread Bob Sneidar via use-livecode
Hmmm… I read the enhancement request. I’m still in the dark though on how to 
get to "2023-07-14 08:30:00" from “7/14/23” using format strings. Here’s my 
solution for those who do not want to download the masterLibrary. Given these, 
what else do you need? 

FUNCTION formatDate theDate, theFormat
   /*
   Accepts any valid date for the first parameter. If not a valid date, it 
simply returns
   what was passed. Second parameter can be any of the following:
   sql date: date in the -mm-dd format
   short date, abbreviated date, internet date, long date: LC versions of the 
same
   julian date: Julian number based on (I believe) Jacques formula
   */

   put theDate into tSavedDate
   put the itemdelimiter into theOldDelim
   set the itemdelimiter to "-"
   
   IF the length of item 1 of theDate = 4 AND \
  the number of items of theDate = 3 AND \
  item 1 of theDate is a number AND \
  item 2 of theDate is a number AND \
  item 3 of theDate is a number THEN
  put item 2 of theDate & "/" & \
 item 3 of theDate & "/" & \
 item 1 of theDate into theDate
   END IF
   
   -- replace "." with "/" in theDate
   convert theDate to dateitems
   set the itemdelimiter to theOldDelim
   
   if the number of items of theDate <> 7 then
  answer "'" & theDate & "' is not a valid date format!"
  return tSavedDate
   end if
   
   SWITCH theFormat
  CASE "sql date"
 put item 1 of theDate & "-" & \
format("%02d",item 2 of theDate) & "-" & \
format("%02d",item 3 of theDate) into theDate
 break
  CASE "short date"
 convert theDate from dateitems to short date
 break
  CASE "abbreviated date"
 convert theDate from dateitems to abbreviated date
 break
  CASE "abbr date"
 convert theDate from dateitems to abbreviated date
 break
  CASE "internet date"
 convert theDate from dateitems to internet date
 break
  CASE "long date"
 convert theDate from dateitems to long date
 break
  CASE "julian date"
 put the date into theDate
 convert theDate to dateItems
 IF  ((item 2 of theDate = 1) OR (item 2 of theDate = 2)) THEN
put 1 into theDay
 ELSE
put 0 into theDay
 END IF
 put item 1 of theDate + 4800 - theDay into theYear
 put item 2 of theDate + (12 * theDay) - 3 into theMonth
 put item 3 of theDate + \
((153 * theMonth + 2) div 5) + \
(365 * theYear) + \
(theYear div 4) - \
(theYear div 100) + \
(theYear div 400) - \
32045 into theDate
 break
   END SWITCH
   
   return theDate
END formatDate

FUNCTION formatTime theTime, theFormat
   /*
   accepts any valid time and returns the form of the time specified in the 
second parameter.
   The valid formats are:
   sql time: hh:mm:ss (Note: combining sql date from the formatDate() function 
with the
   sql time will produce a valid SQL date time type).
   short time: LC short time format
   abbreviated time: LC abbr time format (same as short time)
   long time: LC long time format
   seconds: the number of seconds since the prior midnight
   military: the military time 00:00 - 23:59
   */

   IF theTime is empty THEN return empty
   
   set the numberformat to "00"
   SWITCH theFormat
  CASE "sql time"
 convert theTime to dateitems
 put (item 4 of theTime +0) & ":" & \
(item 5 of theTime +0) & ":" & \
(item 6 of theTime +0) into theTime
 break
  CASE "short time"
 convert theTime to short time
 break
  CASE "abbreviated time"
 convert theTime to abbreviated time
 break
  CASE "long time"
 convert theTime to long time
 break
  CASE "seconds"
 convert theTime to seconds
 break
  CASE "military"
 set the itemdelimiter to ":"
 
 IF theTime contains "PM" THEN
add 12 to item 1 of theTime
 END IF
 
 put word 1 of item 2 of theTime into item 2 of theTime
 break
   END SWITCH
   
   return theTime
END formatTime

And as an added bonus, those who use Spiceworks know they format time for 
tickets as 0h0m0s. 

FUNCTION spiceTime pStartTime, pEndTime
   convert pStartTime to dateItems
   convert pEndTime to dateItems
   subtract item 4 of pStartTime from item 4 of pEndTime
   subtract item 5 of pStartTime from item 5 of pEndTime
   convert pEndTime from dateItems to short time
   put formatTime(pEndTime, "military") into pEndTime
   set the itemdelimiter to ":"
   IF item 1 of pEndTime > 11 THEN subtract 12 from item 1 of pEndTime
   put item 1 of pEndTime & "h" & item 2 of pEndTime & "m" into tTotalTime
   return tTotalTime
END spiceTime

Bob S


> On Jul 13, 2023, at 4:19 PM, ambassador--- via use-livecode 
>  wrote:
> 
> Neville Smythe wrote:

Re: Convert date

2023-07-14 Thread Brian Milby via use-livecode
We actually do with LCB libraries (Icon SVG Library is one example), but with 
the caveat that they are not as performant as LCS code in many cases (compare 
the LCS and LCB implementations of JSON for example).  LCS libraries are doable 
too.  Just make everything internal private/script local and only expose the 
calls you want to be public.  We just don’t currently have a built in way to 
manage them like the LCB modules.

Brian Milby
br...@milby7.com

> On Jul 14, 2023, at 8:11 AM, Mark Smith via use-livecode 
>  wrote:
> 
> Which makes me think, it would be nice if we could have plug-in code 
> modules. Essentially a faceless widget that could be called to perform some 
> sort of action (with parameters). Completely encapsulated. Or is that “bat 
> crazy” as Mike would say 😊

___
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: Check connection and timeout

2023-07-14 Thread Bob Sneidar via use-livecode
getNetwotkType() is not a valid function. 

Bob S


> On Jul 14, 2023, at 8:14 AM, Ralph DiMola via use-livecode 
>  wrote:
> 
> Ludovic,
> 
> Make sure that tsNet is active:
> 
> command NetworkType
>   if GetNetworkType() = "libURL" then
>  answer"tsNet is disabled(LibURL)"
>   else
>  answer "tsNet in use"&cr&"Version==>"& tsNetVersion()
>   end if
> end NetworkType
> 
> Did you initialize tsNet? ==> tsNetInit
> 
> Disable tsNet ==> dispatch "revunloadlibrary" to stack "tsnetliburl"
> To enable tsNet ==> dispatch "revloadlibrary" to stack "tsnetliburl"
> 
> Ralph DiMola
> IT Director
> Evergreen Information Services
> rdim...@evergreeninfo.net
> 
> -Original Message-
> From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf 
> Of Ludovic THEBAULT via use-livecode
> Sent: Friday, July 14, 2023 3:51 AM
> To: How to use LiveCode
> Cc: Ludovic THEBAULT
> Subject: Re: Check connection and timeout
> 
> 
> 
>> Le 14 juil. 2023 à 08:26, Ludovic THEBAULT via use-livecode 
>>  a écrit :
>> 
>> Hello,
>> 
>> I use this code to check is there is an internet connection :
>> 
>> tsNETSETTIMEOUTS 60,0,2000,6,5,1000
>> 
>> put tsNetHeadSync("https://google.com/";, tHeaders, tResult, tBytes) into 
>> tRecvHeaders
>> 
>>  if tResult begins with "tsneterr:" then
>> return false 
>>  else
>> return true 
>>  end if
>> 
>> 
>> But the setting for the timeout of tsNETSETTIMEOUTS is not active, I always 
>> have a 30 seconds timeout.
>> 
>> Is there an other settings ?
>> 
> 
> 
> Addendum :  it happen when there is a connection (aka in 4G or Wifi) but no 
> enough network.
> 
> 
> ___
> 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: Check connection and timeout

2023-07-14 Thread Bob Sneidar via use-livecode
I’m interested in this. But how do you GET the timeout? 

Bob S


> On Jul 13, 2023, at 11:26 PM, Ludovic THEBAULT via use-livecode 
>  wrote:
> 
> Hello,
> 
> I use this code to check is there is an internet connection :
> 
> tsNETSETTIMEOUTS 60,0,2000,6,5,1000
> 
> put tsNetHeadSync("https://google.com/";, tHeaders, tResult, tBytes) into 
> tRecvHeaders
> 
>   if tResult begins with "tsneterr:" then
>  return false 
>   else
>  return true 
>   end if
> 
> 
> But the setting for the timeout of tsNETSETTIMEOUTS is not active, I always 
> have a 30 seconds timeout.
> 
> Is there an other settings ?
> 
> Thanks.

___
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: Convert date

2023-07-14 Thread Bob Sneidar via use-livecode
I beg to differ. Again, Livecode is a way to build both the tools and the 
product made by those tools. Livecode is NOT a collection of every conceivable 
tool for everything everyone wants to do. No language is. 

I think the LC dev team is far more useful to everyone if they focus on 
completing the projects they already have, and squashing the long standing and 
pervasive bugs that exist. 

I think if there is a fairly easy way to create the tool you need with the 
codeset you now have, then you would need a compelling reason, like dramatic 
performance increases to justify building it into the engine. 

Bob S


> On Jul 14, 2023, at 4:08 AM, Paul Dupuis via use-livecode 
>  wrote:
> 
> Yes to this. I have, lot so many developer, a set of functions to translate 
> to and from this date format.
> 
> We can all write our own or use ones others have provided, but it would be 
> nice if this was built into the language.
> 
> 
> On 7/13/2023 10:59 PM, Neville Smythe via use-livecode wrote:
>> Jacque: Nice! Particularly as a demonstration of the variety of ways to 
>> achieve an objective in LC and different coding styles. I’ll add the 
>> snippets to my own version.
>> 
>> The ISO date (aka sql date) format is my favourite because it avoids the 
>> ambiguity of the English/American ordering of day, month and mostly because 
>> it works for sorting. I could wish it were universally adopted.
>> 
>> Neville Smythe

___
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: Check connection and timeout

2023-07-14 Thread Ralph DiMola via use-livecode
Ludovic,

Make sure that tsNet is active:

command NetworkType
   if GetNetworkType() = "libURL" then
  answer"tsNet is disabled(LibURL)"
   else
  answer "tsNet in use"&cr&"Version==>"& tsNetVersion()
   end if
end NetworkType

Did you initialize tsNet? ==> tsNetInit

Disable tsNet ==> dispatch "revunloadlibrary" to stack "tsnetliburl"
To enable tsNet ==> dispatch "revloadlibrary" to stack "tsnetliburl"

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net

-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of 
Ludovic THEBAULT via use-livecode
Sent: Friday, July 14, 2023 3:51 AM
To: How to use LiveCode
Cc: Ludovic THEBAULT
Subject: Re: Check connection and timeout



> Le 14 juil. 2023 à 08:26, Ludovic THEBAULT via use-livecode 
>  a écrit :
> 
> Hello,
> 
> I use this code to check is there is an internet connection :
> 
> tsNETSETTIMEOUTS 60,0,2000,6,5,1000
> 
> put tsNetHeadSync("https://google.com/";, tHeaders, tResult, tBytes) into 
> tRecvHeaders
> 
>   if tResult begins with "tsneterr:" then
>  return false 
>   else
>  return true 
>   end if
> 
> 
> But the setting for the timeout of tsNETSETTIMEOUTS is not active, I always 
> have a 30 seconds timeout.
> 
> Is there an other settings ?
> 


Addendum :  it happen when there is a connection (aka in 4G or Wifi) but no 
enough network.


___
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: Search for an app in Google Play Store

2023-07-14 Thread Klaus major-k via use-livecode
Hi Jacques,

> Am 13.07.2023 um 22:43 schrieb J. Landman Gay via use-livecode 
> :
> 
> On 7/11/23 2:44 PM, Klaus major-k via use-livecode wrote:
>>> You could try writing to support and see if they can tell you what's wrong.
>> yes, worth a try, do you have the supports email address?
> Sorry for the late reply, you may have found it already but you can write to 
> support here:
> 

oops, just noticed...

I am looking for a support email at GOOGLE Dev.
My problem is the search engine of Google Play Store.
Just like the subject says. ;-)

> Scroll to the middle of the page, there's a button.
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com

Best

Klaus
--
Klaus Major
https://www.major-k.de
https://www.major-k.de/bass
kl...@major-k.de


___
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: Convert date

2023-07-14 Thread Mark Smith via use-livecode
Which makes me think, it would be nice if we could have plug-in code modules. 
Essentially a faceless widget that could be called to perform some sort of 
action (with parameters). Completely encapsulated. Or is that “bat crazy” as 
Mike would say 😊

> On 14 Jul 2023, at 12:08 pm, Paul Dupuis via use-livecode 
>  wrote:
> 
> Yes to this. I have, lot so many developer, a set of functions to translate 
> to and from this date format.
> 
> We can all write our own or use ones others have provided, but it would be 
> nice if this was built into the language.
> 
> 
> On 7/13/2023 10:59 PM, Neville Smythe via use-livecode wrote:
>> Jacque: Nice! Particularly as a demonstration of the variety of ways to 
>> achieve an objective in LC and different coding styles. I’ll add the 
>> snippets to my own version.
>> 
>> The ISO date (aka sql date) format is my favourite because it avoids the 
>> ambiguity of the English/American ordering of day, month and mostly because 
>> it works for sorting. I could wish it were universally adopted.
>> 
>> Neville Smythe
>> 
>> 
>> 
>> 
>> ___
>> 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: Convert date

2023-07-14 Thread Paul Dupuis via use-livecode
Yes to this. I have, lot so many developer, a set of functions to 
translate to and from this date format.


We can all write our own or use ones others have provided, but it would 
be nice if this was built into the language.



On 7/13/2023 10:59 PM, Neville Smythe via use-livecode wrote:

Jacque: Nice! Particularly as a demonstration of the variety of ways to achieve 
an objective in LC and different coding styles. I’ll add the snippets to my own 
version.

The ISO date (aka sql date) format is my favourite because it avoids the 
ambiguity of the English/American ordering of day, month and mostly because it 
works for sorting. I could wish it were universally adopted.

Neville Smythe




___
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: Search for an app in Google Play Store

2023-07-14 Thread Klaus major-k via use-livecode
Hi Jacques,

> Am 13.07.2023 um 22:43 schrieb J. Landman Gay via use-livecode 
> :
> 
> On 7/11/23 2:44 PM, Klaus major-k via use-livecode wrote:
>>> You could try writing to support and see if they can tell you what's wrong.
>> yes, worth a try, do you have the supports email address?
> 
> Sorry for the late reply, you may have found it already but you can write to 
> support here:
> 
> Scroll to the middle of the page, there's a button.

thank you very much!

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

Best

Klaus

--
Klaus Major
https://www.major-k.de
https://www.major-k.de/bass
kl...@major-k.de


___
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: Check connection and timeout

2023-07-14 Thread Ludovic THEBAULT via use-livecode


> Le 14 juil. 2023 à 08:26, Ludovic THEBAULT via use-livecode 
>  a écrit :
> 
> Hello,
> 
> I use this code to check is there is an internet connection :
> 
> tsNETSETTIMEOUTS 60,0,2000,6,5,1000
> 
> put tsNetHeadSync("https://google.com/";, tHeaders, tResult, tBytes) into 
> tRecvHeaders
> 
>   if tResult begins with "tsneterr:" then
>  return false 
>   else
>  return true 
>   end if
> 
> 
> But the setting for the timeout of tsNETSETTIMEOUTS is not active, I always 
> have a 30 seconds timeout.
> 
> Is there an other settings ?
> 


Addendum :  it happen when there is a connection (aka in 4G or Wifi) but no 
enough network.


___
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