Check connection and timeout

2023-07-13 Thread Ludovic THEBAULT via use-livecode
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

Re: Convert date

2023-07-13 Thread Neville Smythe via use-livecode
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, mo

Re: Convert date

2023-07-13 Thread ambassador--- via use-livecode
Neville Smythe wrote: > I seem to have hallucinated that the built-in convert handler recognised > the ISO date and dateTime formats (-MM-DD, -MM-DD  > hh:mm:ss+-http://hh.ss, etc) but I must have written my own conversion > routines in a former life. > But one would have to ask… Why doesn’

Re: Field highlited

2023-07-13 Thread ambassador--- via use-livecode
Paul Dupuis 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. Any s

Re: Field highlited

2023-07-13 Thread Paul Dupuis via use-livecode
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

Re: Convert date

2023-07-13 Thread J. Landman Gay via use-livecode
On 7/13/23 3:19 AM, Neville Smythe via use-livecode wrote: I seem to have hallucinated that the built-in convert handler recognised the ISO date and dateTime formats (-MM-DD, -MM-DD hh:mm:ss+-hh.ss, etc) but I must have written my own conversion routines in a former life. But one would

Re: Field highlited

2023-07-13 Thread J. Landman Gay via use-livecode
On 7/13/23 2:58 PM, J. Landman Gay via use-livecode wrote: On 7/13/23 1:18 PM, Mark Smith via use-livecode wrote: Hi Paul, try “the selectedText". Whaddya know...it works! Another way is to turn off traversalOn in the button. That prevents the focus from changing. Actually, I've been tryi

Re: Search for an app in Google Play Store

2023-07-13 Thread 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:

Re: Crazy question: is it possible/reasonable to use Python in LC?

2023-07-13 Thread Mike Kerner via use-livecode
there are no crazy questions there is, however, bat-guano-crazy geoff canyon anyway, i think you will have to write the parser, linker, lexical analyzer, etc., and all the other pre-compiler stuff that you would have to write for any language. i'm not aware of something like a DLL for python. even

Crazy question: is it possible/reasonable to use Python in LC?

2023-07-13 Thread Geoff Canyon via use-livecode
I've been playing with Python, and it has a lot of nice qualities, but a built-in GUI isn't one of them (no apologies to tkinter). So it would be interesting/nice to be able to open LC, add a button to a stack, and put some python into the script of that button and have it just work, with access t

Re: Field highlited

2023-07-13 Thread J. Landman Gay via use-livecode
On 7/13/23 1:18 PM, Mark Smith via use-livecode wrote: Hi Paul, try “the selectedText". Whaddya know...it works! Another way is to turn off traversalOn in the button. That prevents the focus from changing. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software

Re: Field highlited

2023-07-13 Thread Mark Smith via use-livecode
Hi Paul, try “the selectedText". Create a scrolling text field, call it fld1, and put a large amount of text in it. Create 2 buttons: one with “on mouse down, answer “Hello World” and the other with “on mouse down, answer the selectedText of field “fld1” Now highlight an area of text in fld1. C

Re: Field highlited

2023-07-13 Thread Richmond via use-livecode
I just did this: on mouseLeave    put the selectedText of fld "f1" into fld "f2" end mouseLeave you can then do whatever you want with your button on the basis of the contents of fld "f2" Best, Richmond. On 13.07.23 20:20, Bob Sneidar via use-livecode wrote: Correction: on openField pu

Re: Field highlited

2023-07-13 Thread Bob Sneidar via use-livecode
Correction: on openField put long id of the target into pField if the savedChunk of pField is not empty then put the savedChunk of pField into tSelection select tSelection Set the savedChunk of pField to empty end if pass openField end openField > On Jul 13, 2023, at

Re: Convert date

2023-07-13 Thread Mark Smith via use-livecode
Thanks Bob. Sounds very useful. How does one access (or locate) the master library? Cheers, Mark Sent from my iPhone > On Jul 13, 2023, at 4:24 PM, Bob Sneidar via use-livecode > wrote: > > I wrote a formatDate function years ago that called this "sql date". Maybe I > should rename it “IS

Re: Field highlited

2023-07-13 Thread Bob Sneidar via use-livecode
Untested This in a frontScript: on openField put long id of the target into pField set the selection to the savedChunk of pField — if you want to restore the last selection Set the savedChunk of pField to empty pass openField end openField on exitField put the long id of the ta

Re: Field highlited

2023-07-13 Thread Paul Dupuis via use-livecode
Thank your Bob, Craig, and William for the responses. It appears the way I have done it in the past is the "best" option. I was hoping there was some clever trick I don't know, but it is what it is. I'll do what I have done before. Thanks again. On 7/12/2023 6:21 PM, Paul Dupuis via use-liveco

Re: Field highlited

2023-07-13 Thread William Prothero via use-livecode
Folks, A possible strategy is to change the color of a line in a field, when it is selected. There would need to be a script that could simply returns the content of a line of a specified color, changes the color to "unselected", or whatever your need requires. You could have multiple lines sele

Re: Field highlited

2023-07-13 Thread Craig Newman via use-livecode
Paul. I think that Bob S. is correct. The change in focus is sort of built into the engine, and a field cannot “remember” such a thing. A fun kludge would be to create one or more overlays, however you like those to look, and apply them to the field of interest. These overlays can be managed in

Re: Field highlited

2023-07-13 Thread Bob Sneidar via use-livecode
I do not see how that could work. In Windows, buttons can have the focus, which means a field would always lose it. What I do when I need something like this is I save the selection (or selectedChunk or some such thing) as a property of the field upon exitField. You could even put that in a fr

Re: Convert date

2023-07-13 Thread Bob Sneidar via use-livecode
I wrote a formatDate function years ago that called this "sql date". Maybe I should rename it “ISO Date” or just add a case for it. There is also an “sql time” format in the function formatTime. This way you can put format date(the date, “sql date”) && formative(the time, “sql time”) to get an s

Convert date

2023-07-13 Thread Neville Smythe via use-livecode
I seem to have hallucinated that the built-in convert handler recognised the ISO date and dateTime formats (-MM-DD, -MM-DD hh:mm:ss+-hh.ss, etc) but I must have written my own conversion routines in a former life. But one would have to ask… Why doesn’t it? After all, the original ISO 860