Re: Is there a command to display number of seconds as hrs:min:seconds?

2019-10-17 Thread Bill Vlahos via use-livecode
All great suggestions.

I mostly wanted to see if there already was such a function - which there 
obviously isn’t.

But it is great to see several easy ways to built your own.

Thanks all.

Bill Vlahos


> On Oct 17, 2019, at 8:51 AM, Bob Sneidar via use-livecode 
>  wrote:
> 
> The problem with one-liners is that the genius is implicit, not explicit. ;-)
> 
> Bob S
> 
> 
>> On Oct 17, 2019, at 08:44 , J. Landman Gay via use-livecode 
>>  wrote:
>> 
>> Show-off. :-)
>> --
>> Jacqueline Landman Gay | jac...@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: Merge PDF

2019-10-17 Thread hh via use-livecode
> Hugh Senior wrote:
> Has anyone got an LC-based method to merge pdf files? Just asking...

I'll publish this weekend on SampleStacks a pdfLib (split and merge)
based on a JS library (via a browser widget). Already 95% are done.

___
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: LiveCode Server

2019-10-17 Thread Ralf Bitter via use-livecode


> On 17. Oct 2019, at 19:27, Lagi Pittas via use-livecode 
>  wrote:
> 
> HI Ralph
> 
> Basically the server script does this
> 
> put arrayEncode($_SERVER) and sends back everything within the $_SERVER
> variable
> we then decode it in the App 
> 
> It gives us everything shown in the documentation but not the header info
> 
> 
>   - GATEWAY_INTERFACE
>   - SERVER_ADDR
>   - SERVER_NAME
>   - SERVER_SOFTWARE
>   - 
>   - SCRIPT_NAME
>   - SCRIPT_FILENAME
>   - CONTENT_TYPE
>   - CONTENT_LENGTH
> 
> But not the headers
> 
> Hope that helps
> 
> Lagi


OK, in case you are interested in all the headers the
server sends in response to a request you might indeed probably
find the answer by checking out the code in revliburl.livecodescript.
But just including the script only stack (using “start using stack”)
won’t work right away. Seems there are modifications needed
to be able to get a value from libURLLastRHheaders().
Would be glad to be wrong.

Ralf
___
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: Merge PDF

2019-10-17 Thread doc hawk via use-livecode

On Oct 17, 2019, at 9:27 AM, FlexibleLearning.com via use-livecode 
 wrote:
> 
> Has anyone got an LC-based method to merge pdf files?


LC business can’t even output a pdf widget save as low density raster at the 
moment.

I’m currently working on an interim solution that creates a PyPdf2 script, 
after which I may translate parts of that into livecode.

The process is ultimately pretty simple, but will involve learning more pdf 
than most people (including me) have any interest in . . . it would be *much* 
easier (at least for my purposes involving cropped sections of pages) in 
straight postscript . . .

Also, if you look through the archives for my bug report on the pdf widgets 
rasterizing output to 72pdf (it may actually be less; they’re *that* blurry), I 
attached a couple of example files where I force-merged pdf files by hand
___
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: LiveCode Server

2019-10-17 Thread Lagi Pittas via use-livecode
HI Ralph

Basically the server script does this

put arrayEncode($_SERVER) and sends back everything within the $_SERVER
variable
we then decode it in the App 

It gives us everything shown in the documentation but not the header info


   - GATEWAY_INTERFACE
   - SERVER_ADDR
   - SERVER_NAME
   - SERVER_SOFTWARE
   - 
   - SCRIPT_NAME
   - SCRIPT_FILENAME
   - CONTENT_TYPE
   - CONTENT_LENGTH

But not the headers

Hope that helps

Lagi



On Thu, 17 Oct 2019 at 17:55, Ralf Bitter via use-livecode <
use-livecode@lists.runrev.com> wrote:

>
>
> > On 17. Oct 2019, at 17:24, Lagi Pittas via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > There is no  $_SERVER["HTTP_Authorization"] in the docs the closest is
> > $_SERVER["HTTP] but since
> > the code gives an error and the return is empty it's a moot point.
>
>
> Lagi, the original question was:
>
> > how to read an "Authorization: Bearer" header in
> > LiveCode Script on the server??
>
>
> because
>
> > we want to do basic validation by passing a token from
> > the App to the server script.
>
>
> Please correct me if I am on the wrong track, but to my
> understanding the issue is related to reading
> the Authorization request header sent by an app to
> the server. In this case there is a server variable
> $_SERVER["HTTP_Authorization"] which can be read
> by LC server. Of course there is no  $_SERVER["HTTP_Authorization"]
> in the docs.
>
>
> Ralf
> ___
> 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: LiveCode Server

2019-10-17 Thread Ralf Bitter via use-livecode



> On 17. Oct 2019, at 17:24, Lagi Pittas via use-livecode 
>  wrote:
> 
> There is no  $_SERVER["HTTP_Authorization"] in the docs the closest is
> $_SERVER["HTTP] but since
> the code gives an error and the return is empty it's a moot point.


Lagi, the original question was:

> how to read an "Authorization: Bearer" header in
> LiveCode Script on the server??


because

> we want to do basic validation by passing a token from
> the App to the server script.


Please correct me if I am on the wrong track, but to my
understanding the issue is related to reading
the Authorization request header sent by an app to
the server. In this case there is a server variable
$_SERVER["HTTP_Authorization"] which can be read
by LC server. Of course there is no  $_SERVER["HTTP_Authorization"]
in the docs.


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


Merge PDF

2019-10-17 Thread FlexibleLearning.com via use-livecode
Has anyone got an LC-based method to merge pdf files?

Just asking...

Hugh Senior


___
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: Is there a command to display number of seconds as hrs:min:seconds?

2019-10-17 Thread Bob Sneidar via use-livecode
The problem with one-liners is that the genius is implicit, not explicit. ;-)

Bob S


> On Oct 17, 2019, at 08:44 , J. Landman Gay via use-livecode 
>  wrote:
> 
> Show-off. :-)
> --
> Jacqueline Landman Gay | jac...@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: Is there a command to display number of seconds as hrs:min:seconds?

2019-10-17 Thread J. Landman Gay via use-livecode

Show-off. :-)
--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On October 17, 2019 5:22:44 AM Mark Waddingham via use-livecode 
 wrote:



On 2019-10-17 10:50, Klaus major-k via use-livecode wrote:

save some lines by setting the numberformat first (lazy moi :-)

...



Save even more lines by using format, div and mod...

function formatRemainingTime pSeconds
  return format("%02d:%02d:%02d", pSeconds div 3600, (pSeconds mod 3600)
div 60, pSeconds mod 60)
end formatRemainingTime

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





___
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: LiveCode Server

2019-10-17 Thread Lagi Pittas via use-livecode
Hi Everybody


If anybody else (Mark? even) has any insights

We have found this function libURLLastRHheaders, which seems to get the
last headers set to the server.
 In the documentation, it indicates that it works on the Server version.

We put it in the server code, but get the following error which indicates
that the lib is NOT included on the server.


file /var/www/html/xb_admin_accountant_new.lc
  row 12, col 8: Function: error in function handler (libURLLastRHHeaders)
  row 12, col 8: put: error in expression


My question is, does the internet lib work on LC Server so we can call
libURLLastRHHeaders?

If YES, then which files do we add to the server and where. Also, do we
need to add an include line in the script to load the function?


Thanks for your help


Regards Lagi (and Todd)

btw

There is no  $_SERVER["HTTP_Authorization"] in the docs the closest is
$_SERVER["HTTP] but since
the code gives an error and the return is empty it's a moot point.




On Thu, 17 Oct 2019 at 15:13, Ralf Bitter via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Lagi, sorry for not expressing myself well. Of course I
> meant the whole process including reading HTTP
> headers on the server.
> This means $_SERVER["HTTP_Authorization"]
> should not be empty in your case
>
>
> Ralf
>
>
>
> > On 17. Oct 2019, at 15:51, Lagi Pittas via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Hi Ralf,
> >
> > The problem isn't the sending of the headers but reading them using
> > livecode server.
> > We are using Linux servers so the Mac problem is not an issue.
> >
> > Via PHP the call is get_headers ( string $url [, int $format = 0 [,
> > resource $context ]] ) : array
> >
> > Basically is there a way of doing that in pure livecode server?
> >
> > Regards Lagi (and Todd)
> >
> > On Thu, 17 Oct 2019 at 14:18, Ralf Bitter via use-livecode <
> > use-livecode@lists.runrev.com >
> wrote:
> >
> >> Todd, sending Authorization HTTP request headers
> >> to LC server on Linux should work. I have
> >> troubles with request headers too, but only on Mac OS.
> >>
> >>
> >> Ralf
> >>
> >>
> >>
> >>> On 17. Oct 2019, at 13:56, Todd Fabacher via use-livecode <
> >> use-livecode@lists.runrev.com >
> wrote:
> >>>
> >>> Hello all,
> >>>
> >>> We are running LC Server Scripts to process some DB request and we
> >>> want to do basic validation by passing a token from the App to the
> >>> server script.
> >>>
> >>> The problem is I can not find where I can get the headers on the
> >>> server. I looked in $_SERVER, but not there. I see the CONTENT_TYPE
> >>> and HTTP ACCEPTS which I set in my header, but I can's find anything
> >>> else from the header that was posted.
> >>>
> >>> Does anyone know how to read an "Authorization: Bearer" header in
> >>> LiveCode Script on the server?? Thanks for the help.
> >>>
> >>> --Todd Fabacher
>
>
> ___
> 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: Is there a command to display number of seconds as hrs:min:seconds?

2019-10-17 Thread Bob Sneidar via use-livecode
I call it sqltime because it has to be formatted as hh:mm:ss. 

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


> On Oct 16, 2019, at 17:23 , Bill Vlahos via use-livecode 
>  wrote:
> 
> I’m writing a countdown timer application and want to display the remaining 
> time not as the number of seconds but in the format of HR:MIN:SEC left.
> 
> For example 75 seconds would display as “0:1:15”.
> 130 seconds would display as “0:2:10”.
> 
> I know how to do the math to figure it out but I’m wondering if there is a 
> built in function to do this.
> 
> Convert wants to deal with actual time so I would get something like “0:1:15 
> PM”.
> 
> Thanks,
> Bill Vlahos
> ___
> 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: LiveCode Server

2019-10-17 Thread Ralf Bitter via use-livecode
Lagi, sorry for not expressing myself well. Of course I
meant the whole process including reading HTTP
headers on the server.
This means $_SERVER["HTTP_Authorization"]
should not be empty in your case


Ralf



> On 17. Oct 2019, at 15:51, Lagi Pittas via use-livecode 
>  wrote:
> 
> Hi Ralf,
> 
> The problem isn't the sending of the headers but reading them using
> livecode server.
> We are using Linux servers so the Mac problem is not an issue.
> 
> Via PHP the call is get_headers ( string $url [, int $format = 0 [,
> resource $context ]] ) : array
> 
> Basically is there a way of doing that in pure livecode server?
> 
> Regards Lagi (and Todd)
> 
> On Thu, 17 Oct 2019 at 14:18, Ralf Bitter via use-livecode <
> use-livecode@lists.runrev.com > wrote:
> 
>> Todd, sending Authorization HTTP request headers
>> to LC server on Linux should work. I have
>> troubles with request headers too, but only on Mac OS.
>> 
>> 
>> Ralf
>> 
>> 
>> 
>>> On 17. Oct 2019, at 13:56, Todd Fabacher via use-livecode <
>> use-livecode@lists.runrev.com > wrote:
>>> 
>>> Hello all,
>>> 
>>> We are running LC Server Scripts to process some DB request and we
>>> want to do basic validation by passing a token from the App to the
>>> server script.
>>> 
>>> The problem is I can not find where I can get the headers on the
>>> server. I looked in $_SERVER, but not there. I see the CONTENT_TYPE
>>> and HTTP ACCEPTS which I set in my header, but I can's find anything
>>> else from the header that was posted.
>>> 
>>> Does anyone know how to read an "Authorization: Bearer" header in
>>> LiveCode Script on the server?? Thanks for the help.
>>> 
>>> --Todd Fabacher


___
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: LiveCode Server

2019-10-17 Thread Lagi Pittas via use-livecode
Hi Ralf,

The problem isn't the sending of the headers but reading them using
livecode server.
We are using Linux servers so the Mac problem is not an issue.

Via PHP the call is get_headers ( string $url [, int $format = 0 [,
resource $context ]] ) : array

Basically is there a way of doing that in pure livecode server?

Regards Lagi (and Todd)

On Thu, 17 Oct 2019 at 14:18, Ralf Bitter via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Todd, sending Authorization HTTP request headers
> to LC server on Linux should work. I have
> troubles with request headers too, but only on Mac OS.
>
>
> Ralf
>
>
>
> > On 17. Oct 2019, at 13:56, Todd Fabacher via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Hello all,
> >
> > We are running LC Server Scripts to process some DB request and we
> > want to do basic validation by passing a token from the App to the
> > server script.
> >
> > The problem is I can not find where I can get the headers on the
> > server. I looked in $_SERVER, but not there. I see the CONTENT_TYPE
> > and HTTP ACCEPTS which I set in my header, but I can's find anything
> > else from the header that was posted.
> >
> > Does anyone know how to read an "Authorization: Bearer" header in
> > LiveCode Script on the server?? Thanks for the help.
> >
> > --Todd Fabacher
>
>
> ___
> 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: LC Server Session Cookies

2019-10-17 Thread Ralph DiMola via use-livecode
Panos,

Thanks!
I will try that for "put secure cookie". The first problem is the a "start
session" creates a cookie on the client and I don't see a way to add the
attributes.

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net
Phone: 518-636-3998 Ex:11
Cell: 518-796-9332


-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf
Of panagiotis merakos via use-livecode
Sent: Thursday, October 17, 2019 3:30 AM
To: How to use LiveCode
Cc: panagiotis merakos
Subject: Re: LC Server Session Cookies

Hello Ralph,

Does it work if you append this attribute to the "cookieValue" param?
Something like:

put secure cookie "testcookie4" for "/products/" on "www.livecode.com" with
"some_cookie_value; SameSite=None" until (the seconds + 60 * 60 * 24 * 365)

Kind regards,
Panos
--

On Thu, 17 Oct 2019 at 01:25, Ralph DiMola via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I started getting this warning in Chrome yesterday. It pops up when I 
> start an LC Server session. I don't see a way to set this attribute 
> when creating the session. I also don't see a way to set the attribute 
> when creating a cookie with "put cookie". Does this require a change 
> to LC Server or am I missing something?
>
> A cookie associated with a cross-site resource at 
> http://x.on-rev.com/ was set without the `SameSite` attribute. A 
> future release of Chrome will only deliver cookies with cross-site 
> requests if they are set with `SameSite=None` and `Secure`. You can 
> review cookies in developer tools under Application>Storage>Cookies 
> and see more details at
> https://www.chromestatus.com/feature/5088147346030592 and 
> https://www.chromestatus.com/feature/5633521622188032.
>
> 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: LiveCode Server

2019-10-17 Thread Ralf Bitter via use-livecode
Todd, sending Authorization HTTP request headers
to LC server on Linux should work. I have
troubles with request headers too, but only on Mac OS.


Ralf



> On 17. Oct 2019, at 13:56, Todd Fabacher via use-livecode 
>  wrote:
> 
> Hello all,
> 
> We are running LC Server Scripts to process some DB request and we
> want to do basic validation by passing a token from the App to the
> server script.
> 
> The problem is I can not find where I can get the headers on the
> server. I looked in $_SERVER, but not there. I see the CONTENT_TYPE
> and HTTP ACCEPTS which I set in my header, but I can's find anything
> else from the header that was posted.
> 
> Does anyone know how to read an "Authorization: Bearer" header in
> LiveCode Script on the server?? Thanks for the help.
> 
> --Todd Fabacher


___
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


LiveCode Server

2019-10-17 Thread Todd Fabacher via use-livecode
Hello all,

We are running LC Server Scripts to process some DB request and we
want to do basic validation by passing a token from the App to the
server script.

The problem is I can not find where I can get the headers on the
server. I looked in $_SERVER, but not there. I see the CONTENT_TYPE
and HTTP ACCEPTS which I set in my header, but I can's find anything
else from the header that was posted.

Does anyone know how to read an "Authorization: Bearer" header in
LiveCode Script on the server?? Thanks for the help.

--Todd Fabacher

___
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: Is there a command to display number of seconds as hrs:min:seconds?

2019-10-17 Thread hh via use-livecode
Save a lot of lines by using "format":

on countdown t
  put format("%02d:%02d:%02d",t div 3600,(t mod 3600) div 60,t mod 60) into fld 
1
  subtract 1 from t
  if t < 0 then exit countDown
  send "countdown t" to me in (1000-the millisecs mod 1000) millisecs
end countdown

> > Terry J. wrote:
> > Not built-in but...
> > 
> > function formatRemainingTime pTime
> >   put trunc(pTime/3600) into tHours
> >   put pTime mod 3600 into tTimeX
> >   put trunc(tTimeX/60) into tMins
> >   put tTimeX mod 60 into tSecs
> >   if tHours < 10 then put "0" before tHours
> >   if tMins < 10 then put "0" before tMins
> >   if tSecs < 10 then put "0" before tSecs
> >   return tHours&":"&":"
> > end formatRemainingTime
> 
> Klaus M. wrote:
> save some lines by setting the numberformat first (lazy moi :-)
> 
> function formatRemainingTime pTime
>set the numberformat to "xx"
>put trunc(pTime/3600) into tHours
>put pTime mod 3600 into tTimeX
>put trunc(tTimeX/60) into tMins
>put tTimeX mod 60 into tSecs
>return tHours&":"&":"
> end formatRemainingTime



___
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: Is there a command to display number of seconds as hrs:min:seconds?

2019-10-17 Thread Klaus major-k via use-livecode
Hi Mark,

> Am 17.10.2019 um 12:21 schrieb Mark Waddingham via use-livecode 
> :
> 
> On 2019-10-17 10:50, Klaus major-k via use-livecode wrote:
>> save some lines by setting the numberformat first (lazy moi :-)
>> ...
> Save even more lines by using format, div and mod...
> 
> function formatRemainingTime pSeconds
>  return format("%02d:%02d:%02d", pSeconds div 3600, (pSeconds mod 3600) div 
> 60, pSeconds mod 60)
> end formatRemainingTime

Sheesh... :-D

> Warmest Regards,
> 
> Mark.

Best

Klaus

--
Klaus Major
https://www.major-k.de
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: Is there a command to display number of seconds as hrs:min:seconds?

2019-10-17 Thread Mark Waddingham via use-livecode

On 2019-10-17 10:50, Klaus major-k via use-livecode wrote:

save some lines by setting the numberformat first (lazy moi :-)

...



Save even more lines by using format, div and mod...

function formatRemainingTime pSeconds
  return format("%02d:%02d:%02d", pSeconds div 3600, (pSeconds mod 3600) 
div 60, pSeconds mod 60)

end formatRemainingTime

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: Is there a command to display number of seconds as hrs:min:seconds?

2019-10-17 Thread Klaus major-k via use-livecode
Hi all,

> Am 17.10.2019 um 02:41 schrieb Terry Judd via use-livecode 
> :
> 
> Not built-in but...
> 
> function formatRemainingTime pTime
>   put trunc(pTime/3600) into tHours
>   put pTime mod 3600 into tTimeX
>   put trunc(tTimeX/60) into tMins
>   put tTimeX mod 60 into tSecs
>   if tHours < 10 then put "0" before tHours
>   if tMins < 10 then put "0" before tMins
>   if tSecs < 10 then put "0" before tSecs
>   return tHours&":"&":"
> end formatRemainingTime

save some lines by setting the numberformat first (lazy moi :-)

function formatRemainingTime pTime
   set the numberformat to "xx"
   put trunc(pTime/3600) into tHours
   put pTime mod 3600 into tTimeX
   put trunc(tTimeX/60) into tMins
   put tTimeX mod 60 into tSecs
   return tHours&":"&":"
end formatRemainingTime


Best

Klaus

--
Klaus Major
https://www.major-k.de
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: LC Server Session Cookies

2019-10-17 Thread panagiotis merakos via use-livecode
Hello Ralph,

Does it work if you append this attribute to the "cookieValue" param?
Something like:

put secure cookie "testcookie4" for "/products/" on "www.livecode.com" with
"some_cookie_value; SameSite=None" until (the seconds + 60 * 60 * 24 * 365)

Kind regards,
Panos
--

On Thu, 17 Oct 2019 at 01:25, Ralph DiMola via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I started getting this warning in Chrome yesterday. It pops up when I start
> an LC Server session. I don't see a way to set this attribute when creating
> the session. I also don't see a way to set the attribute when creating a
> cookie with "put cookie". Does this require a change to LC Server or am I
> missing something?
>
> A cookie associated with a cross-site resource at http://x.on-rev.com/
> was set without the `SameSite` attribute. A future release of Chrome will
> only deliver cookies with cross-site requests if they are set with
> `SameSite=None` and `Secure`. You can review cookies in developer tools
> under Application>Storage>Cookies and see more details at
> https://www.chromestatus.com/feature/5088147346030592 and
> https://www.chromestatus.com/feature/5633521622188032.
>
> 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