Re: How to get the number of lines of a fld referenced by long ID in a variable.

2017-06-28 Thread J. Landman Gay via use-livecode

On 6/28/17 9:25 PM, Sannyasin Brahmanathaswami via use-livecode wrote:

on addSpaceBelowListLines pField,pSpace
 put the number of lines of pField
# returns 1 --
# --  of course, that's a prop of the var, not the object it refes to

  repeat with x = 1 to (the number of lines of pField)
   set the spacebelow of line x of pField to pSpace
  end repeat
end addSpaceBelowListLines

# only line 1 gets added space.



Try this, assuming pField is a long ID:

on addSpaceBelowListLines pField,pSpace
set the spaceBelow of line 1 to -1 of pField to pSpace
end addSpaceBelowListLines


--
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: How to get the number of lines of a fld referenced by long ID in a variable.

2017-06-28 Thread Mike Bonner via use-livecode
Change it to "the number of lines in the text of pfield" and it should work.

On Wed, Jun 28, 2017 at 8:59 PM, dunbarx via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi.
>
> You need a "do" construction to, er, deconstruct the "contents" of the
> variable to the object reference of that variable. Do you know how to do
> this?
>
> Craig Neman
>
>
>
> --
> View this message in context: http://runtime-revolution.
> 278305.n4.nabble.com/How-to-get-the-number-of-lines-of-a-
> fld-referenced-by-long-ID-in-a-variable-tp4716341p4716343.html
> Sent from the Revolution - User mailing list archive at Nabble.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: Sharp as a pound (was Array assignment...)

2017-06-28 Thread dunbarx via use-livecode
James,

So do we in the US, though sometimes the word "hash" has been seen to creep
about.

Craig



--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Sharp-as-a-pound-was-Array-assignment-tp4716340p4716344.html
Sent from the Revolution - User mailing list archive at Nabble.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: How to get the number of lines of a fld referenced by long ID in a variable.

2017-06-28 Thread dunbarx via use-livecode
Hi.

You need a "do" construction to, er, deconstruct the "contents" of the
variable to the object reference of that variable. Do you know how to do
this?

Craig Neman



--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/How-to-get-the-number-of-lines-of-a-fld-referenced-by-long-ID-in-a-variable-tp4716341p4716343.html
Sent from the Revolution - User mailing list archive at Nabble.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


touch issues with the surface

2017-06-28 Thread Jeff Reynolds via use-livecode
Has anyone done multiple stacks with a surface under touch?

my app has a video playback substack that the control (master) stack brings up 
to play video full screen over the control app. works fine on mac and pc and 
the surface in pc mode (using mice and trackpads) but in tablet mode or in pc 
mode when you do touch an odd thing happens. When you select a video to play 
the master stack opens the video stack and loads the video into the player on 
this stack and reconfigures everything to play the video full screen. If you 
touch the video it just close the video stack and you are back with just the 
master stack. odd thing is that the first touch back on the master stack does 
not register as mousedown or up in livecode and you have to touch a second time 
to get the mousedown/up event. but when the video stack then is brought back up 
to play the video the first touch on the video stack registers a mousedown/up. 
This is true if the video substack is opened/closed each time used or just 
hidden/show. first thought it was some sort of issue with other windows in the 
development system but i get the same behavior when i build an app that 
contains the two stacks.

i could just change the surface version of this app to open just a player over 
the control stack and ditch the separate video stack (thats part of another 
version that lets the video be on one screen (projector) and control stack on 
the laptop for presentations. surface version of the app is to just have it all 
play full screen on the surface in tablet mode. 

but it bugs me not knowing why something is behaving like this in one 
permutation…

surface is a very quirky system…

cheers,

jeff


___
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

How to get the number of lines of a fld referenced by long ID in a variable.

2017-06-28 Thread Sannyasin Brahmanathaswami via use-livecode
I'm trying to set up a global text only library that includes text handlers for 
formatting text run time.

Typical use case is : clickable list field with titles that wrap. Say you set 
type size to 16, text height to 20, dontWrap is false, first indent -40, left 
margin 20. This looks fine, but the lines are too close together.. Since there 
is no way to apply "spaceBelow" to a field…you have to dynamically run a script 
to "set the type" of each line run time after loading the field.

So far so good until this

# card script

put tTitles into fld "audioList"  # contains 30 lines
addSpaceBelowListLines (the long id of fld "audioList"),10


lib_SivaSivaMedia # a global "backscript" -- one of many

on addSpaceBelowListLines pField,pSpace
put the number of lines of pField
# returns 1 --
# --  of course, that's a prop of the var, not the object it refes to

 repeat with x = 1 to (the number of lines of pField)
  set the spacebelow of line x of pField to pSpace
 end repeat
end addSpaceBelowListLines

# only line 1 gets added space.

In the msg box I can test

put the number of lines of (the long id of fld "audioList")
[return] 30

but

put the number of lines of pField = 1

# ok I get it a var,  single string, 1 line only

of course we can add to the card script

put tTitles into fld "audioList"
put the number of lines of tTitles into pLineCount
addSpaceBelowListLines (the long id of fld "audioList"), pLineCount, 10

LIBRARY:

on addSpaceBelowListLines pField, pLineCount, pSpace
repeat with x = 1 to pLineCount
  set the spacebelow of line x of pField to pSpace
 end repeat
end addSpaceBelowListLines

And this works.. it even has an interesting visual effect as the lines layout 
dynamically in front of the users, spreading out top to bottom.
( though I probably should lock and unlock the screen for small devices speed)

But that it would be nice not be "stuck" with only finding out the properties 
of the variable as a variable.

i.e. pField is a variable with 1 line…

but  to be able to address the properties of the object referred to by a 
variable containing the long ID of an object/

How do we do that?

BR




___
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

Sharp as a pound (was Array assignment...)

2017-06-28 Thread james--- via use-livecode
Alex in a postscript wrote...
> btw - whose bright idea was it to not put a 'sharp' key visible on a 
> British Mac keyboard :-) ?


Of course # is a sharp character.
Being in Australia which had moved to decimal currency by the time PCs were 
available we had the # on our keyboards. But being not such a young man I 
remember our previous currency (my first job was a paperboy which netted me £1 
17s 6p per week) and so I noticed the lack of the £ symbol and that it had been 
replaced by the #.
The thing is I still refer (internally) to it as a 'pound' symbol.

James



___
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: Shell - argv limits

2017-06-28 Thread JB via use-livecode
No I have not but it is certainly
very interesting info.

Thank you,
JB


> On Jun 28, 2017, at 5:43 PM, Richard Gaskin via use-livecode 
>  wrote:
> 
> JB wrote:
> 
> > When using argv it has a character limit. I think it
> > might be different on different systems but you can
> > probably use a few thousand characters for each
> > argument.  You can have as many arguments as
> > memory can handle.  Probably thousands.  You
> > should refer to a file for larger data.
> 
> Have you looked into passing data with pipes (stdin/stdout)?
> 
> If the process will be long-running and used for multiple events, sockets may 
> be another option.
> 
> Reading up on how some folks pass data between processes on Linux servers it 
> seems the shared memory RAM disk automatically mounted at /run/shm can be 
> useful.  In some brief tests here it was about 9 times faster than my fastest 
> SSD, and a lot simpler than sockets.  In LC SHM works great with normal file 
> I/O commands.
> 
> -- 
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> 
> ambassa...@fourthworld.comhttp://www.FourthWorld.com
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 


___
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: Shell - argv limits

2017-06-28 Thread Richard Gaskin via use-livecode

JB wrote:

> When using argv it has a character limit. I think it
> might be different on different systems but you can
> probably use a few thousand characters for each
> argument.  You can have as many arguments as
> memory can handle.  Probably thousands.  You
> should refer to a file for larger data.

Have you looked into passing data with pipes (stdin/stdout)?

If the process will be long-running and used for multiple events, 
sockets may be another option.


Reading up on how some folks pass data between processes on Linux 
servers it seems the shared memory RAM disk automatically mounted at 
/run/shm can be useful.  In some brief tests here it was about 9 times 
faster than my fastest SSD, and a lot simpler than sockets.  In LC SHM 
works great with normal file I/O commands.


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

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


Re: Shell - argv limits

2017-06-28 Thread JB via use-livecode
I am guessing the is a pretty large number.

JB


> On Jun 28, 2017, at 4:45 PM, Mark Wieder via use-livecode 
>  wrote:
> 
> On 06/28/2017 04:06 PM, JB via use-livecode wrote:
>> When using argv it has a character limit.  I think it
>> might be different on different systems but you can
>> probably use a few thousand characters for each
>> argument.  You can have as many arguments as
>> memory can handle.  Probably thousands.  You
>> should refer to a file for larger data.
> 
> It does indeed depend on the OS, but I think the maximum length is for the 
> total command line, not for individual arguments. At any rate, for my linux 
> mint system I see an ARG_MAX value of 2097152.
> 
> https://stackoverflow.com/questions/6846263/maximum-length-of-command-line-argument-that-can-be-passed-to-sqlplus-from-lin
> 
> Note that there is also a limit to the number of arguments that can be passed 
> on a commandline, and as a rule of thumb it is *probably* ARG_MAX/4-1, but if 
> this is something that concerns you, you no doubt have other things to worry 
> about .
> 
> -- 
> Mark Wieder
> ahsoftw...@gmail.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


Shell - Java compile code

2017-06-28 Thread JB via use-livecode
To compile Java code do the following;

1.  Open a text editor and paste the Java code
below:



public class ArgExample {
public static void main(String[] args) {
for(int i = 0; i < args.length; i++) {
System.out.println(args[i] + " is arg " + (i+1));
}
}
}

Save the file on Desktop as ArgExample.java
Make sure you save it as Plain Text.
After you saved it make sure the filename has
the extension ,java such as ArgExample.java

2.  Open the Terminal app and type:

cd ~/desktop
javac ArgExample.java


After it has been compiled it will appear
on the desktop as ArgExample.class.

That is the file you call in Livecode.

JB


___
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: Shell - argv limits

2017-06-28 Thread Mark Wieder via use-livecode

On 06/28/2017 04:06 PM, JB via use-livecode wrote:

When using argv it has a character limit.  I think it
might be different on different systems but you can
probably use a few thousand characters for each
argument.  You can have as many arguments as
memory can handle.  Probably thousands.  You
should refer to a file for larger data.


It does indeed depend on the OS, but I think the maximum length is for 
the total command line, not for individual arguments. At any rate, for 
my linux mint system I see an ARG_MAX value of 2097152.


https://stackoverflow.com/questions/6846263/maximum-length-of-command-line-argument-that-can-be-passed-to-sqlplus-from-lin

Note that there is also a limit to the number of arguments that can be 
passed on a commandline, and as a rule of thumb it is *probably* 
ARG_MAX/4-1, but if this is something that concerns you, you no doubt 
have other things to worry about .


--
 Mark Wieder
 ahsoftw...@gmail.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: Speed comparison with imageData 1920x1080

2017-06-28 Thread hh via use-livecode
The canvas2d dataURL-methods (and LC's base64-methods) are so far optimized that
it is even slower if one directly sends and receives arrays, I tried it.

There could be more gain (what would give a speed-up-factor of up to 500) by
using webGL, but this has issues with some 'black-listed' graphic cards. Also
this is interesting for video-postprocessing/ animations/ 3D-Rendering only.

For image processing canvas2d is fast enough and _very_ comfortable for complex
filtering by internally using Uint8ClampedArrays.
My HTML5/JS template given in the speedCcomparison stack is as simple as 
possible
so that for a LiveCoder who ever worked with imageData, to write the basic image
filters is learned in 15 minutes.
___
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: Creating installers when packaging a Levure application

2017-06-28 Thread William Prothero via use-livecode
Trevor:
Thanks for your support with Levure. It looks like a wonderful resource, but 
for my current needs, it looks like a pretty big investment for me to figure it 
out and the ROI is probably not enough to justify the learning curve. 

Thanks,
Bill

> On Jun 25, 2017, at 12:09 PM, Trevor DeVore via use-livecode 
>  wrote:
> 
> On Sat, Jun 24, 2017 at 12:41 PM William Prothero via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> 
>> Trevore:
>> I looked at the helper video and noted the yml file for each helper.
>> However, I didn’t know where to add those lines to the main app yml file.
>> But, I will take another look at the documentation and see if I have
>> overlooked something.
> 
> 
> Hi Bill,
> 
> Were you able to get the YAML figured out?
> 
> -- Trevor DeVore
> 
>> 
> ___
> 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

Shell - argv limits

2017-06-28 Thread JB via use-livecode
When using argv it has a character limit.  I think it
might be different on different systems but you can
probably use a few thousand characters for each
argument.  You can have as many arguments as
memory can handle.  Probably thousands.  You
should refer to a file for larger data.

If you want to you can put a field in and argument.
Try changing the obj-c example to the following.
You need to use a global variable.


global pFILE1

on mouseUp
   set the defaultFolder to "~/desktop"
   put quote & fld  & quote into pFILE1
   put quote & "My File.txt" & quote into tFILE2
   put shell( "./argv_string" && pFILE1 && tFILE2) into pData
   put pData into fld id 
   beep 2
   put empty into pFILE1
end mouseUp

JB

___
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: Speed comparison with imageData 1920x1080

2017-06-28 Thread Richard Gaskin via use-livecode

hh wrote:

Here is a stack that compares simple grayLevel- and invert-filter
for an image of size 1920x1080, needs LC 8 or 9. It shows the power
of this "external" we have via LC Builder/the browser widget.

go stack url ("http://hh.on-rev.com/xstacks/speedComparison.livecode";)
or download the file
http://hh.on-rev.com/xstacks/speedComparison.livecode.zip (1 MByte)

The LC Script version is, TMHO, rather fast (feel free to improve it).
The HTML5/js version could be optimized but that may be too hard for
the result ...
Thus the first HTML5/JS call is slower than the following (initiates
caching). The average speed improvement depends on your hardware, this
HTML5/JS version will be in average 20-60 times faster than LC Script.

Note. The improvement is mostly due to the fact, that HTML5/JS uses
your graphics hardware. With a decent graphic card the speed factor
is here (for less simple filters) up to 100.


Very interesting.  Thanks for posting that.

I wonder how much speed could be gained if we didn't need to do so much 
type coercion?


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

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


Re: Momentum Scrolling Script

2017-06-28 Thread Jonathan Lynch via use-livecode
Rounding to the nearest whole number could explain the direction bias.

Sent from my iPhone

> On Jun 28, 2017, at 4:31 PM, jonathandly...@gmail.com wrote:
> 
> Are you saying the down scroll has less momentum?
> 
> I have no idea why it would do that, but you can increase the momentum 
> overall by changing tRemainingDistance/15 to a lower divisor, like 
> tRemainingDistance/10.
> 
> Sent from my iPhone
> 
>> On Jun 28, 2017, at 4:23 PM, Alejandro Tejada via use-livecode 
>>  wrote:
>> 
>> Al
>> _

___
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


Speed comparison with imageData 1920x1080

2017-06-28 Thread hh via use-livecode
Here is a stack that compares simple grayLevel- and invert-filter
for an image of size 1920x1080, needs LC 8 or 9. It shows the power
of this "external" we have via LC Builder/the browser widget.

go stack url ("http://hh.on-rev.com/xstacks/speedComparison.livecode";)
or download the file
http://hh.on-rev.com/xstacks/speedComparison.livecode.zip (1 MByte)

The LC Script version is, TMHO, rather fast (feel free to improve it).
The HTML5/js version could be optimized but that may be too hard for
the result ...
Thus the first HTML5/JS call is slower than the following (initiates
caching). The average speed improvement depends on your hardware, this
HTML5/JS version will be in average 20-60 times faster than LC Script.

Note. The improvement is mostly due to the fact, that HTML5/JS uses
your graphics hardware. With a decent graphic card the speed factor
is here (for less simple filters) up to 100.



___
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


Array assignment / initialization [was Re: synonyms]

2017-06-28 Thread Alex Tweedly via use-livecode

On 28/06/2017 16:55, Richard Gaskin via use-livecode wrote:



Fully agreed, as I wrote in my post introducing this arg format to the 
discussion a couple days ago:


And as much as I like it in R, I'm not sure I would advocate it
in an xTalk as any sort of necessity.  It might be ideal for
certain types of commands (oh how I'd love it with "export"),
but is so unusual compared to most other languages that it may
just increase the learning curve for most folks.

I don't accept that named parameters are "unusual" nowadays.
They're in Python, Csharp, R and (if my quick Google got it right) Swift 
- so that 's 5 of the top 20 most "popular" languages now, so I would 
expect that a fairly high proportion of potential LC users would be 
familiar with them.


More with-the-grain would be this fourth option, passing in an array 
as we see with some existing LC commands and functions, but that 
requires a LOT more typing:


  put "my chart" into tA["name"]
  put 100 into tA["width"]
  put "This is a chart" into tA["label"]
  DoSomething tA

Yes, it would be nice if we had an easier (terser) way to assign to an 
array. Maybe something like Python / Perl use to assign to a dictionary.


   put { "name": "my chart", "width": 100, "label": "This is a chart", 
"anarray": sAMine } into tA

   DoSomething tA

-- Alex.
btw - whose bright idea was it to not put a 'sharp' key visible on a 
British Mac keyboard :-) ?


___
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: synonyms

2017-06-28 Thread Alex Tweedly via use-livecode

On 28/06/2017 15:27, Paul Dupuis via use-livecode wrote:


Your solution illustrate more so than mine how easy it is to make handler
and functions that use name/value pairs if someone prefers that model.
The xtalk language really doesn't need any extensions or enhancements to
enable this.

I completely disagree; to me, this discussion shows how much LC would 
benefit from named parameters.


Clearly the examples so far look pretty nice -

(a) myHandler "type=blue","name=fred","something=234"
(b) myhandler "type=blue,name=fred,something=234"

but that's largely an illusion due to the fact that these are very 
simple examples, using constant strings as actual parameters. Try to use 
variables instead, and it doesn't look so pretty.


(a) myHandler "type=" & kConstant,"name=" & myName,"something="& the rect of grp 
"abc"
(b) myhandler "type=" & kConstant,"name=" & myName,"something="& the rect of grp 
"abc"

And in fact, that last one reminds us - as soon as you use a variable or 
property, you need to be concerned about the current value in it; it 
night contain the delimiter characters, in this case comma. So the 
'single parameter string' version fails - you actually need to do


(b) myhandler "type=" & urlencode(kConstant),"name=" & urlencode(myName), \
  "something="& urlencode(the rect of grp "abc")

(you can use a simpler encoding than urlencode - but this is built into 
the engine, so it's probably faster).


And even then, you still have problems 
 - you can't pass arrays as parameters (I'm not going down the 
'arrayencode() route :-)

 - you can't have 'pass by reference' parameters

Richard mentioned a third alternative - but it is basically just using 
whitespace instead of comma to delimit individual key/value pairs in a 
single-string parameter, and so retains all the above problems.


He also mention a fourth method - using arrays - which he describes as 
"more with the grain" which is more appealing, since it solves all the 
above problems except the limitation on not using 'pass-by-reference' 
parameters. But I'll split that off to a separate response, with a 
changed subject/thread header.


-- Alex.


___
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: Momentum Scrolling Script

2017-06-28 Thread Alejandro Tejada via use-livecode
I made this change in the script and now
it reversed the behavior.

Probably everyone interested could test
this script on different mobile devices and
computers to confirm this behavior.

Al

On Wed, Jun 28, 2017 at 4:31 PM,  wrote:

> Are you saying the down scroll has less momentum?
>
> I have no idea why it would do that, but you can increase the momentum
> overall by changing tRemainingDistance/15 to a lower divisor, like
> tRemainingDistance/10.
>
> Sent from my iPhone
>
> > On Jun 28, 2017, at 4:23 PM, Alejandro Tejada via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Al
> > _
>
___
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: Momentum Scrolling Script

2017-06-28 Thread Jonathan Lynch via use-livecode
Are you saying the down scroll has less momentum?

I have no idea why it would do that, but you can increase the momentum overall 
by changing tRemainingDistance/15 to a lower divisor, like 
tRemainingDistance/10.

Sent from my iPhone

> On Jun 28, 2017, at 4:23 PM, Alejandro Tejada via use-livecode 
>  wrote:
> 
> Al
> _

___
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: Momentum Scrolling Script

2017-06-28 Thread Jonathan Lynch via use-livecode
Actually - the problem I just mentioned has to do with some different.

Sent from my iPhone

> On Jun 28, 2017, at 4:20 PM, jonathandly...@gmail.com wrote:
> 
> Thanks Scott
> 
> I also found something else. Mousedown stops the momentum scroll, but then 
> one must lift up the finger and start again to do more scrolling.
> 
> That should be fixable, though.
> 
> Sent from my iPhone
> 
>> On Jun 28, 2017, at 3:00 PM, Scott Rossi via use-livecode 
>>  wrote:
>> 
>> Hi Jonathan:
>> 
>> Just doing some simple tests, your script is great.  Thanks for sharing it 
>> on the list.
>> 
>> Two minor improvements I would suggest:
>> 
>> 1) After the mouseUp handler, add a mouseRelease handler to trigger 
>> deceleration/stop when the mouse is released outside of the target control.
>> 
>> on mouseRelease
>>  mouseUp
>> end mouseRelease
>> 
>> 2) In the mouseMove handler, use the built-in parameters provided by the 
>> handler instead of reading the mouseV. Probably not a huge deal in the 
>> scheme of things, but might add a tiny bit more efficiency to the script.
>> 
>> on mouseMove X,Y
>> if allowDrag <> empty then
>>set the vScroll of me to (allowDrag-Y)
>> end if
>> end mouseMove 
>> 
>> Regards,
>> 
>> Scott Rossi 
>> Creative Director 
>> Tactile Media, UX/UI Design 
>> 
>> 
>> 
>>> On Jun 28, 2017, at 9:05 AM, Jonathan Lynch via use-livecode 
>>>  wrote:
>>> 
>>> I just created and tested a momentum scrolling script on my iPhone, and it
>>> appears to work quite well, so I thought I would share it here.
>> 
>> 
>> ___
>> 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


Momentum Scrolling Script

2017-06-28 Thread Alejandro Tejada via use-livecode
Really nice script, Jonathan!
Thanks a lot for sharing.

Previously Bernd and many LC Developers
have published similar scripts.

By the way, this script seems to works faster
when users drags upward from Line 20 to Line 1
than dragging downwards from Line 1 to 20

Dragging upwards from Line 20 towards Line 1, always
reach Line 1 (without fail), but dragging downwards
from Line 1 towards Line 20 barely reach Line 15,
(rarely Line 17) but never reach Line 20.

Al
___
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: Momentum Scrolling Script

2017-06-28 Thread Jonathan Lynch via use-livecode
Thanks Scott

I also found something else. Mousedown stops the momentum scroll, but then one 
must lift up the finger and start again to do more scrolling.

That should be fixable, though.

Sent from my iPhone

> On Jun 28, 2017, at 3:00 PM, Scott Rossi via use-livecode 
>  wrote:
> 
> Hi Jonathan:
> 
> Just doing some simple tests, your script is great.  Thanks for sharing it on 
> the list.
> 
> Two minor improvements I would suggest:
> 
> 1) After the mouseUp handler, add a mouseRelease handler to trigger 
> deceleration/stop when the mouse is released outside of the target control.
> 
> on mouseRelease
>   mouseUp
> end mouseRelease
> 
> 2) In the mouseMove handler, use the built-in parameters provided by the 
> handler instead of reading the mouseV. Probably not a huge deal in the scheme 
> of things, but might add a tiny bit more efficiency to the script.
> 
> on mouseMove X,Y
>  if allowDrag <> empty then
> set the vScroll of me to (allowDrag-Y)
>  end if
> end mouseMove 
> 
> Regards,
> 
> Scott Rossi 
> Creative Director 
> Tactile Media, UX/UI Design 
> 
> 
> 
>> On Jun 28, 2017, at 9:05 AM, Jonathan Lynch via use-livecode 
>>  wrote:
>> 
>> I just created and tested a momentum scrolling script on my iPhone, and it
>> appears to work quite well, so I thought I would share it here.
> 
> 
> ___
> 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: 8.1.4 Export snapshot

2017-06-28 Thread Paul Hibbert via use-livecode
Hi Panos,

I’ve just come to the same conclusion, when I checked the LC app bundle, the 
test files were in there. A search in the Mac Finder doesn’t reveal files 
inside the app bundle, so this is where I went wrong until the penny dropped!

Setting the default folder first does remedy the problem of knowing where the 
files end up if you don’t specify a file path.

This is an example of, why reading the notes in the dictionary more thoroughly 
could relieve some frustration! :)

Paul


> On Jun 28, 2017, at 12:31 PM, panagiotis merakos via use-livecode 
>  wrote:
> 
> Hi all,
> 
> I have tried in LC 8.1.5 RC-2:
> 
> export snapshot from Field 1 to file "File1.png" as PNG
> 
> This works as expected, and creates a "File1.png" in **the defaultFolder**
> (in my case in /Applications/LiveCode Indy 8.1.5 (rc 2).app)
> 
> @Paul
> Can you "put the defaultFolder", and check if there is a file "abc.png" in
> it?
> 
> @Richmond
> Every bug report on a supported platform (including Mac OS 10.7.8, in LC
> 8.x) "goes down well" in Edinburgh :)
> 
> Best,
> Panos
> --
> 
> 
> On Wed, Jun 28, 2017 at 7:26 PM, Richmond Mathewson via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> 
>> 
>> 
>> On 6/28/17 7:45 pm, Paul Hibbert via use-livecode wrote:
>> 
>>> This looks like it may be a bug on Mac OS, or just a difference in the
>>> way the OS works.
>>> 
>>> I see the same problem using LC 8.1.5(rc1) on Mac OS Sierra 10.12.4, but
>>> if I give the file a more complete path (which I would normally do), then
>>> it does work:
>>> 
>>> export snapshot from group "abc" to file 
>>> "/Users/paulhibbert/Desktop/abc.png"
>>> as PNG
>>> 
>>> However, I would have expected an error or at least something in the
>>> result with your example, but they were both empty when I tried:
>>> 
>>> on mouseUp
>>> 
>>>   try
>>> 
>>>  export snapshot from group "abc" to file "abc.png" as PNG
>>> 
>>>   catch tError
>>> 
>>>   end try
>>> 
>>> put "The Result:" & the result && "Error:" & tError
>>> 
>>> end mouseUp
>>> 
>>> Are you going to file a bug report?
>>> 
>> 
>> No, I don't think I can as I'm not entirely sure how well Mac OS 10.7.8
>> will go down in Edinburgh.
>> 
>> Richmond.
>> 
>> 
>> 
>>> Paul
>>> 
>>> 
>>> On Jun 28, 2017, at 1:58 AM, Richmond Mathewson via use-livecode <
 use-livecode@lists.runrev.com> wrote:
 
 Mac OS 10.7.8
 
 in LC 7.1.4 if I type this sort of thing into the Message box:
 
 export snapshot from group "abc" to file "abc.png" as PNG
 
 it exports a snapshot of my group!
 
 But that doesn't work in 8.1.4.
 
 Richmond.
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode
 
>>> ___
>>> use-livecode mailing list
>>> use-livecode@lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>> 
>> 
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
> ___
> 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



Paul
p...@livecode.org

Mac OS Sierra 10.12.1



___
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: 8.1.4 Export snapshot

2017-06-28 Thread panagiotis merakos via use-livecode
Hi all,

I have tried in LC 8.1.5 RC-2:

export snapshot from Field 1 to file "File1.png" as PNG

This works as expected, and creates a "File1.png" in **the defaultFolder**
(in my case in /Applications/LiveCode Indy 8.1.5 (rc 2).app)

@Paul
Can you "put the defaultFolder", and check if there is a file "abc.png" in
it?

@Richmond
Every bug report on a supported platform (including Mac OS 10.7.8, in LC
8.x) "goes down well" in Edinburgh :)

Best,
Panos
--


On Wed, Jun 28, 2017 at 7:26 PM, Richmond Mathewson via use-livecode <
use-livecode@lists.runrev.com> wrote:

>
>
> On 6/28/17 7:45 pm, Paul Hibbert via use-livecode wrote:
>
>> This looks like it may be a bug on Mac OS, or just a difference in the
>> way the OS works.
>>
>> I see the same problem using LC 8.1.5(rc1) on Mac OS Sierra 10.12.4, but
>> if I give the file a more complete path (which I would normally do), then
>> it does work:
>>
>> export snapshot from group "abc" to file "/Users/paulhibbert/Desktop/abc.png"
>> as PNG
>>
>> However, I would have expected an error or at least something in the
>> result with your example, but they were both empty when I tried:
>>
>> on mouseUp
>>
>> try
>>
>>export snapshot from group "abc" to file "abc.png" as PNG
>>
>> catch tError
>>
>> end try
>>
>> put "The Result:" & the result && "Error:" & tError
>>
>> end mouseUp
>>
>> Are you going to file a bug report?
>>
>
> No, I don't think I can as I'm not entirely sure how well Mac OS 10.7.8
> will go down in Edinburgh.
>
> Richmond.
>
>
>
>> Paul
>>
>>
>> On Jun 28, 2017, at 1:58 AM, Richmond Mathewson via use-livecode <
>>> use-livecode@lists.runrev.com> wrote:
>>>
>>> Mac OS 10.7.8
>>>
>>> in LC 7.1.4 if I type this sort of thing into the Message box:
>>>
>>> export snapshot from group "abc" to file "abc.png" as PNG
>>>
>>> it exports a snapshot of my group!
>>>
>>> But that doesn't work in 8.1.4.
>>>
>>> Richmond.
>>> ___
>>> use-livecode mailing list
>>> use-livecode@lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
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: Momentum Scrolling Script

2017-06-28 Thread Scott Rossi via use-livecode
Hi Jonathan:

Just doing some simple tests, your script is great.  Thanks for sharing it on 
the list.

Two minor improvements I would suggest:

1) After the mouseUp handler, add a mouseRelease handler to trigger 
deceleration/stop when the mouse is released outside of the target control.

on mouseRelease
   mouseUp
end mouseRelease

2) In the mouseMove handler, use the built-in parameters provided by the 
handler instead of reading the mouseV. Probably not a huge deal in the scheme 
of things, but might add a tiny bit more efficiency to the script.

on mouseMove X,Y
  if allowDrag <> empty then
 set the vScroll of me to (allowDrag-Y)
  end if
end mouseMove 

Regards,

Scott Rossi 
Creative Director 
Tactile Media, UX/UI Design 



> On Jun 28, 2017, at 9:05 AM, Jonathan Lynch via use-livecode 
>  wrote:
> 
> I just created and tested a momentum scrolling script on my iPhone, and it
> appears to work quite well, so I thought I would share it here.


___
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: 8.1.4 Export snapshot

2017-06-28 Thread Richmond Mathewson via use-livecode



On 6/28/17 7:45 pm, Paul Hibbert via use-livecode wrote:

This looks like it may be a bug on Mac OS, or just a difference in the way the 
OS works.

I see the same problem using LC 8.1.5(rc1) on Mac OS Sierra 10.12.4, but if I 
give the file a more complete path (which I would normally do), then it does 
work:

export snapshot from group "abc" to file "/Users/paulhibbert/Desktop/abc.png" 
as PNG

However, I would have expected an error or at least something in the result 
with your example, but they were both empty when I tried:

on mouseUp

try

   export snapshot from group "abc" to file "abc.png" as PNG

catch tError

end try

put "The Result:" & the result && "Error:" & tError

end mouseUp

Are you going to file a bug report?


No, I don't think I can as I'm not entirely sure how well Mac OS 10.7.8 
will go down in Edinburgh.


Richmond.



Paul



On Jun 28, 2017, at 1:58 AM, Richmond Mathewson via use-livecode 
 wrote:

Mac OS 10.7.8

in LC 7.1.4 if I type this sort of thing into the Message box:

export snapshot from group "abc" to file "abc.png" as PNG

it exports a snapshot of my group!

But that doesn't work in 8.1.4.

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

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



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


Re: Momentum Scrolling Script

2017-06-28 Thread Tom Glod via use-livecode
nice going to try this out...I had a good scrolling script, but
definitely not momentum based... will give it a shot...thanks.

On Wed, Jun 28, 2017 at 1:04 PM, Jonathan Lynch via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I just realized I had the wrong way of checking to see if scrolling should
> stop. Somehow it still worked, which is kinda weird. Here is the revised
> script, with checking for tCount < 1 rather than tCount > 50
>
> -
>
> Momentum Scrolling Code
>
>
> Local StartDrag
>
> Local AllowDrag
>
> Local StartDragMil
>
> Local CumulativeMomentum
>
>
> on mousedown
>
>focus on nothing
>
>if word 1 of the name of the target = "button" or the isbutton of the
> target = 1 then
>
>   exit mousedown
>
>end if
>
>put (the mouseV)+(the vScroll of me) into AllowDrag
>
>put the milliseconds into StartDragMil
>
>put (the mouseV) into StartDrag
>
>repeat with CM = 1 to 5
>
>   put 0 into CumulativeMomentum[CM]
>
>end repeat
>
>send momentumAccumulate to me in 0 milliseconds
>
> end mousedown
>
>
> on momentumAccumulate
>
>if mouse(1) <> "down" then
>
>   exit momentumAccumulate
>
>end if
>
>
>
>put the milliseconds-StartDragMil into tTimeForLastMove
>
>put (the mouseV) into tCurrentMouseV
>
>put tCurrentMouseV - StartDrag into tLastDistanceCovered
>
>
>
>if tTimeForLastMove = 0 then
>
>   put 1 into tTimeForLastMove
>
>end if
>
>repeat with CM = 5 down to 2
>
>   put CumulativeMomentum[CM-1] into CumulativeMomentum[CM]
>
>end repeat
>
>put (tLastDistanceCovered*10) / tTimeForLastMove into
> CumulativeMomentum[1]
>
>put tCurrentMouseV into StartDrag
>
>put the milliseconds into StartDragMil
>
>send momentumAccumulate to me in 5 milliseconds
>
> end momentumAccumulate
>
>
> on mousemove
>
>if AllowDrag <> empty then
>
>   set the vScroll of me to AllowDrag-(the mouseV)
>
>end if
>
> end mousemove
>
>
> on mouseup
>
>put empty into AllowDrag
>
>put 0 into tCMTotal
>
>Repeat with CM = 1 to 5
>
>   add CumulativeMomentum[CM] to tCMTotal
>
>end Repeat
>
>put tCMTotal/5 into tAverageMomentum
>
>put tAverageMomentum * 30 into tRemainingDistance
>
>doMomentumScrolling tRemainingDistance,50
>
> end mouseup
>
>
> on doMomentumScrolling tRemainingDistance, tCount
>
>if tCount < 1 then
>
>   exit doMomentumScrolling
>
>end if
>
>if mouse(1) is "down" then
>
>   exit doMomentumScrolling
>
>end if
>
>put tRemainingDistance/15 into tDistanceToMove
>
>put the vScroll of me into tVScroll
>
>set the vScroll of me to tVScroll - tDistanceToMove
>
>put tRemainingDistance-tDistanceToMove into tRemainingDistance
>
>put tCount-1 into tCount
>
>send "doMomentumScrolling tRemainingDistance, tCount" to me in 5
> milliseconds
>
> end doMomentumScrolling
>
> On Wed, Jun 28, 2017 at 12:49 PM, Sean Cole (Pi) via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
> > Jonathan,
> > I would also recommend using the var name prefixes as recommended by LC
> in
> > thier Tips for Writing Good Code when sharing publicly. Like this I mean:
> >
> > Local sStartDrag
> > Local sAllowDrag
> > Local sStartDragMil
> > Local sCumulativeMomentum
> >
> > on mousedown
> >focus on nothing
> >if word 1 of the name of the target = "button" or the isbutton of the
> > target = 1 then
> >   exit mousedown
> >end if
> >put (the mouseV)+(the vScroll of me) into sAllowDrag
> >put the milliseconds into sStartDragMil
> >put (the mouseV) into sStartDrag
> >repeat with CM = 1 to 5
> >   put 0 into sCumulativeMomentum[CM]
> >end repeat
> >send momentumAccumulate to me in 0 milliseconds
> > end mousedown
> >
> > on momentumAccumulate
> > local tTimeForLastMove, tCurrentMouseV, tLastDistanceCovered
> >if mouse(1) <> "down" then
> >   exit momentumAccumulate
> >end if
> >put the milliseconds-sStartDragMil into tTimeForLastMove
> >put (the mouseV) into tCurrentMouseV
> >put tCurrentMouseV - sStartDrag into tLastDistanceCovered
> >if tTimeForLastMove = 0 then
> >   put 1 into tTimeForLastMove
> >end if
> >repeat with CM = 5 down to 2
> >   put sCumulativeMomentum[CM-1] into sCumulativeMomentum[CM]
> >end repeat
> >put (tLastDistanceCovered*10) / tTimeForLastMove into
> > sCumulativeMomentum[1]
> >put tCurrentMouseV into sStartDrag
> >put the milliseconds into sStartDragMil
> >send momentumAccumulate to me in 5 milliseconds
> > end momentumAccumulate
> >
> > on mousemove
> >if sAllowDrag <> empty then
> >   set the vScroll of me to sAllowDrag-(the mouseV)
> >end if
> > end mousemove
> >
> > on mouseup
> > local tCMTotal, tAverageMomentum, tRemainingDistance
> >put empty into sAllowDrag
> >put 0 into tCMTotal
> >Repeat with CM = 1 to 5
> >   add sCumulativeMomentum[CM] to tCMTotal
> >end Repeat
> >put tCMTot

Re: Momentum Scrolling Script

2017-06-28 Thread Jonathan Lynch via use-livecode
I just realized I had the wrong way of checking to see if scrolling should
stop. Somehow it still worked, which is kinda weird. Here is the revised
script, with checking for tCount < 1 rather than tCount > 50

-

Momentum Scrolling Code


Local StartDrag

Local AllowDrag

Local StartDragMil

Local CumulativeMomentum


on mousedown

   focus on nothing

   if word 1 of the name of the target = "button" or the isbutton of the
target = 1 then

  exit mousedown

   end if

   put (the mouseV)+(the vScroll of me) into AllowDrag

   put the milliseconds into StartDragMil

   put (the mouseV) into StartDrag

   repeat with CM = 1 to 5

  put 0 into CumulativeMomentum[CM]

   end repeat

   send momentumAccumulate to me in 0 milliseconds

end mousedown


on momentumAccumulate

   if mouse(1) <> "down" then

  exit momentumAccumulate

   end if



   put the milliseconds-StartDragMil into tTimeForLastMove

   put (the mouseV) into tCurrentMouseV

   put tCurrentMouseV - StartDrag into tLastDistanceCovered



   if tTimeForLastMove = 0 then

  put 1 into tTimeForLastMove

   end if

   repeat with CM = 5 down to 2

  put CumulativeMomentum[CM-1] into CumulativeMomentum[CM]

   end repeat

   put (tLastDistanceCovered*10) / tTimeForLastMove into
CumulativeMomentum[1]

   put tCurrentMouseV into StartDrag

   put the milliseconds into StartDragMil

   send momentumAccumulate to me in 5 milliseconds

end momentumAccumulate


on mousemove

   if AllowDrag <> empty then

  set the vScroll of me to AllowDrag-(the mouseV)

   end if

end mousemove


on mouseup

   put empty into AllowDrag

   put 0 into tCMTotal

   Repeat with CM = 1 to 5

  add CumulativeMomentum[CM] to tCMTotal

   end Repeat

   put tCMTotal/5 into tAverageMomentum

   put tAverageMomentum * 30 into tRemainingDistance

   doMomentumScrolling tRemainingDistance,50

end mouseup


on doMomentumScrolling tRemainingDistance, tCount

   if tCount < 1 then

  exit doMomentumScrolling

   end if

   if mouse(1) is "down" then

  exit doMomentumScrolling

   end if

   put tRemainingDistance/15 into tDistanceToMove

   put the vScroll of me into tVScroll

   set the vScroll of me to tVScroll - tDistanceToMove

   put tRemainingDistance-tDistanceToMove into tRemainingDistance

   put tCount-1 into tCount

   send "doMomentumScrolling tRemainingDistance, tCount" to me in 5
milliseconds

end doMomentumScrolling

On Wed, Jun 28, 2017 at 12:49 PM, Sean Cole (Pi) via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Jonathan,
> I would also recommend using the var name prefixes as recommended by LC in
> thier Tips for Writing Good Code when sharing publicly. Like this I mean:
>
> Local sStartDrag
> Local sAllowDrag
> Local sStartDragMil
> Local sCumulativeMomentum
>
> on mousedown
>focus on nothing
>if word 1 of the name of the target = "button" or the isbutton of the
> target = 1 then
>   exit mousedown
>end if
>put (the mouseV)+(the vScroll of me) into sAllowDrag
>put the milliseconds into sStartDragMil
>put (the mouseV) into sStartDrag
>repeat with CM = 1 to 5
>   put 0 into sCumulativeMomentum[CM]
>end repeat
>send momentumAccumulate to me in 0 milliseconds
> end mousedown
>
> on momentumAccumulate
> local tTimeForLastMove, tCurrentMouseV, tLastDistanceCovered
>if mouse(1) <> "down" then
>   exit momentumAccumulate
>end if
>put the milliseconds-sStartDragMil into tTimeForLastMove
>put (the mouseV) into tCurrentMouseV
>put tCurrentMouseV - sStartDrag into tLastDistanceCovered
>if tTimeForLastMove = 0 then
>   put 1 into tTimeForLastMove
>end if
>repeat with CM = 5 down to 2
>   put sCumulativeMomentum[CM-1] into sCumulativeMomentum[CM]
>end repeat
>put (tLastDistanceCovered*10) / tTimeForLastMove into
> sCumulativeMomentum[1]
>put tCurrentMouseV into sStartDrag
>put the milliseconds into sStartDragMil
>send momentumAccumulate to me in 5 milliseconds
> end momentumAccumulate
>
> on mousemove
>if sAllowDrag <> empty then
>   set the vScroll of me to sAllowDrag-(the mouseV)
>end if
> end mousemove
>
> on mouseup
> local tCMTotal, tAverageMomentum, tRemainingDistance
>put empty into sAllowDrag
>put 0 into tCMTotal
>Repeat with CM = 1 to 5
>   add sCumulativeMomentum[CM] to tCMTotal
>end Repeat
>put tCMTotal/5 into tAverageMomentum
>put tAverageMomentum * 30 into tRemainingDistance
>doMomentumScrolling tRemainingDistance,50
> end mouseup
>
> on doMomentumScrolling pRemainingDistance, pCount
> local tDistanceToMove
>if pCount > 50 then
>   exit doMomentumScrolling
>end if
>if mouse(1) is "down" then
>   exit doMomentumScrolling
>end if
>put pRemainingDistance/15 into tDistanceToMove
>put the vScroll of me into tVScroll
>set the vScroll of me to tVScroll - tDistanceToMove
>put pRemainingDistance-tDistanceToMove into pRemainingDistanc

Re: Obtaining the "active" Desktop/Monitor under OSX?

2017-06-28 Thread Paul Dupuis via use-livecode
Thank you all,

the screen of stack is the answer!


On 6/28/2017 12:15 PM, Bob Sneidar via use-livecode wrote:
> confirmed. 
>
> Bob S
>
>
>> On Jun 28, 2017, at 08:41 , Trevor DeVore via use-livecode 
>>  wrote:
>>
>> I am not at my computer to confirm this but I believe the "screen
>> "property of a stack returns the number of the screen that the stack is on.
>> That number represents the line offset of the screen in the screenrects
>> property.
>>
>> -- 
>> Trevor DeVore
>
> ___
> 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: Momentum Scrolling Script

2017-06-28 Thread Sean Cole (Pi) via use-livecode
Jonathan,
I would also recommend using the var name prefixes as recommended by LC in
thier Tips for Writing Good Code when sharing publicly. Like this I mean:

Local sStartDrag
Local sAllowDrag
Local sStartDragMil
Local sCumulativeMomentum

on mousedown
   focus on nothing
   if word 1 of the name of the target = "button" or the isbutton of the
target = 1 then
  exit mousedown
   end if
   put (the mouseV)+(the vScroll of me) into sAllowDrag
   put the milliseconds into sStartDragMil
   put (the mouseV) into sStartDrag
   repeat with CM = 1 to 5
  put 0 into sCumulativeMomentum[CM]
   end repeat
   send momentumAccumulate to me in 0 milliseconds
end mousedown

on momentumAccumulate
local tTimeForLastMove, tCurrentMouseV, tLastDistanceCovered
   if mouse(1) <> "down" then
  exit momentumAccumulate
   end if
   put the milliseconds-sStartDragMil into tTimeForLastMove
   put (the mouseV) into tCurrentMouseV
   put tCurrentMouseV - sStartDrag into tLastDistanceCovered
   if tTimeForLastMove = 0 then
  put 1 into tTimeForLastMove
   end if
   repeat with CM = 5 down to 2
  put sCumulativeMomentum[CM-1] into sCumulativeMomentum[CM]
   end repeat
   put (tLastDistanceCovered*10) / tTimeForLastMove into
sCumulativeMomentum[1]
   put tCurrentMouseV into sStartDrag
   put the milliseconds into sStartDragMil
   send momentumAccumulate to me in 5 milliseconds
end momentumAccumulate

on mousemove
   if sAllowDrag <> empty then
  set the vScroll of me to sAllowDrag-(the mouseV)
   end if
end mousemove

on mouseup
local tCMTotal, tAverageMomentum, tRemainingDistance
   put empty into sAllowDrag
   put 0 into tCMTotal
   Repeat with CM = 1 to 5
  add sCumulativeMomentum[CM] to tCMTotal
   end Repeat
   put tCMTotal/5 into tAverageMomentum
   put tAverageMomentum * 30 into tRemainingDistance
   doMomentumScrolling tRemainingDistance,50
end mouseup

on doMomentumScrolling pRemainingDistance, pCount
local tDistanceToMove
   if pCount > 50 then
  exit doMomentumScrolling
   end if
   if mouse(1) is "down" then
  exit doMomentumScrolling
   end if
   put pRemainingDistance/15 into tDistanceToMove
   put the vScroll of me into tVScroll
   set the vScroll of me to tVScroll - tDistanceToMove
   put pRemainingDistance-tDistanceToMove into pRemainingDistance
   put pCount-1 into pCount
   send "doMomentumScrolling pRemainingDistance, pCount" to me in 5
milliseconds
end doMomentumScrolling


I hope this doesn't come across as patronising. You've obviously got some
years of skill behind you and I don't want to come across as demeaning.

Sean Cole
*Pi Digital Productions Ltd*

eMail Ts & Cs    Pi Digital
Productions Ltd is a UK registered limited company, no. 5255609
___
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: 8.1.4 Export snapshot

2017-06-28 Thread Paul Hibbert via use-livecode
This looks like it may be a bug on Mac OS, or just a difference in the way the 
OS works.

I see the same problem using LC 8.1.5(rc1) on Mac OS Sierra 10.12.4, but if I 
give the file a more complete path (which I would normally do), then it does 
work:

export snapshot from group "abc" to file "/Users/paulhibbert/Desktop/abc.png" 
as PNG

However, I would have expected an error or at least something in the result 
with your example, but they were both empty when I tried:

on mouseUp

   try

  export snapshot from group "abc" to file "abc.png" as PNG

   catch tError

   end try

put "The Result:" & the result && "Error:" & tError

end mouseUp

Are you going to file a bug report?

Paul


> On Jun 28, 2017, at 1:58 AM, Richmond Mathewson via use-livecode 
>  wrote:
> 
> Mac OS 10.7.8
> 
> in LC 7.1.4 if I type this sort of thing into the Message box:
> 
> export snapshot from group "abc" to file "abc.png" as PNG
> 
> it exports a snapshot of my group!
> 
> But that doesn't work in 8.1.4.
> 
> Richmond.
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

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


Re: Did queryRegistry break?

2017-06-28 Thread Richard Gaskin via use-livecode

Thanks for confirming, Mike.  Submitted:



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

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


Re: Momentum Scrolling Script

2017-06-28 Thread Jonathan Lynch via use-livecode
That's a good tip - it actually will affect one of my groups quite a bit - drat.

Thanks Sean

Sent from my iPhone

> On Jun 28, 2017, at 12:29 PM, Sean Cole (Pi) via use-livecode 
>  wrote:
> 
> This is excellent Jonathan, Thanks.
> 
> Another tip is to make sure that the Group object you wish to scroll the
> contents of is not nested in any other groups as the will negate the
> AcceleratedRendering. This is not documented in the API dictionary but is a
> known functionality. The documentation will be changed to include this very
> necessary information and there is word that acceleratedRendering will be
> extended to include nested controls sometime in the future, but not just
> yet.
> 
> Thanks again
> 
> Sean Cole
> *Pi Digital Productions Ltd*
> ___
> 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: Did queryRegistry break?

2017-06-28 Thread Mike Bonner via use-livecode
One can use the shell to do this.. *get* shell("reg query
HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\KeyboardClass")

I used KeyboardClass because SERIALCOMM doesn't exist for me. (windows 10)
 but at least when i tried it I got back a helpful message telling me that
it doesn't exist.

On Wed, Jun 28, 2017 at 10:38 AM, Mike Bonner  wrote:

> listRegistry still seems to work, though when I list HKEY_LOCAL_MACHINE\
> HARDWARE\DEVICEMAP\   SERIALCOMM is there. (seems like it should be)
>
> If I ignore serialcomm and try queryRegistry on one of the subkeys
> returned by listRegistry, its still a no-go.  Does indeed look like its
> broken.
>
> On Wed, Jun 28, 2017 at 10:02 AM, Richard Gaskin via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
>> I ran a test for a user in the forums and was surprise to find I can't
>> get strings back from the queryRegistry function - here's his thread:
>> 
>>
>> Any of you having luck with queryRegistry in recent builds?
>>
>> I searched the bug DB and came up empty.  Given how rarely I use Windows
>> I figured it might be good to check in here so see if others can confirm
>> this before I write a bug report, hoping perhaps I just missed something.
>>
>> The specific key he tested is:
>>
>> HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM
>>
>> In my VM my Win10 install doesn't have that, but even testing values I
>> can confirm in RegEdit like this one from the docs, returns empty with no
>> error info in the result:
>>
>> HKEY_CLASSES_ROOT\.livecode
>>
>> --
>>  Richard Gaskin
>>  Fourth World Systems
>>  Software Design and Development for the Desktop, Mobile, and the Web
>>  
>>  ambassa...@fourthworld.comhttp://www.FourthWorld.com
>>
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>
___
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: Did queryRegistry break?

2017-06-28 Thread Mike Bonner via use-livecode
listRegistry still seems to work, though when I list
HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\   SERIALCOMM is there. (seems like
it should be)

If I ignore serialcomm and try queryRegistry on one of the subkeys returned
by listRegistry, its still a no-go.  Does indeed look like its broken.

On Wed, Jun 28, 2017 at 10:02 AM, Richard Gaskin via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I ran a test for a user in the forums and was surprise to find I can't get
> strings back from the queryRegistry function - here's his thread:
> 
>
> Any of you having luck with queryRegistry in recent builds?
>
> I searched the bug DB and came up empty.  Given how rarely I use Windows I
> figured it might be good to check in here so see if others can confirm this
> before I write a bug report, hoping perhaps I just missed something.
>
> The specific key he tested is:
>
> HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM
>
> In my VM my Win10 install doesn't have that, but even testing values I can
> confirm in RegEdit like this one from the docs, returns empty with no error
> info in the result:
>
> HKEY_CLASSES_ROOT\.livecode
>
> --
>  Richard Gaskin
>  Fourth World Systems
>  Software Design and Development for the Desktop, Mobile, and the Web
>  
>  ambassa...@fourthworld.comhttp://www.FourthWorld.com
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
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: Momentum Scrolling Script

2017-06-28 Thread Sean Cole (Pi) via use-livecode
This is excellent Jonathan, Thanks.

Another tip is to make sure that the Group object you wish to scroll the
contents of is not nested in any other groups as the will negate the
AcceleratedRendering. This is not documented in the API dictionary but is a
known functionality. The documentation will be changed to include this very
necessary information and there is word that acceleratedRendering will be
extended to include nested controls sometime in the future, but not just
yet.

Thanks again

Sean Cole
*Pi Digital Productions Ltd*
___
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: Obtaining the "active" Desktop/Monitor under OSX?

2017-06-28 Thread Bob Sneidar via use-livecode
confirmed. 

Bob S


> On Jun 28, 2017, at 08:41 , Trevor DeVore via use-livecode 
>  wrote:
> 
> I am not at my computer to confirm this but I believe the "screen
> "property of a stack returns the number of the screen that the stack is on.
> That number represents the line offset of the screen in the screenrects
> property.
> 
> -- 
> Trevor DeVore


___
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: synonyms

2017-06-28 Thread Mark Wieder via use-livecode

On 06/28/2017 08:55 AM, Richard Gaskin via use-livecode wrote:

The ability to use single-quotes and double-quotes interchangeably so 
they can be nested.


http://quality.livecode.com/show_bug.cgi?id=16941

--
 Mark Wieder
 ahsoftw...@gmail.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


Momentum Scrolling Script

2017-06-28 Thread Jonathan Lynch via use-livecode
Hi everyone,

I just created and tested a momentum scrolling script on my iPhone, and it
appears to work quite well, so I thought I would share it here. It also
works on desktop with mouse dragging. If you see improvements, please share
them.

1. Make sure to have accelerated rendering on for the stack.
2. Make sure to set the layer mode of the group to "scrolling" for mobile
devices, so it will be fully responsive to the touch.
3. You can adjust the various constants in this script to alter the
duration, speed, and length of momentum scrolling. Just play with it as
needed.

Here is the script:
---


Local StartDrag

Local AllowDrag

Local StartDragMil

Local CumulativeMomentum


on mousedown

   focus on nothing

   if word 1 of the name of the target = "button" or the isbutton of the
target = 1 then

  exit mousedown

   end if

   put (the mouseV)+(the vScroll of me) into AllowDrag

   put the milliseconds into StartDragMil

   put (the mouseV) into StartDrag

   repeat with CM = 1 to 5

  put 0 into CumulativeMomentum[CM]

   end repeat

   send momentumAccumulate to me in 0 milliseconds

end mousedown


on momentumAccumulate

   if mouse(1) <> "down" then

  exit momentumAccumulate

   end if



   put the milliseconds-StartDragMil into tTimeForLastMove

   put (the mouseV) into tCurrentMouseV

   put tCurrentMouseV - StartDrag into tLastDistanceCovered



   if tTimeForLastMove = 0 then

  put 1 into tTimeForLastMove

   end if

   repeat with CM = 5 down to 2

  put CumulativeMomentum[CM-1] into CumulativeMomentum[CM]

   end repeat

   put (tLastDistanceCovered*10) / tTimeForLastMove into
CumulativeMomentum[1]

   put tCurrentMouseV into StartDrag

   put the milliseconds into StartDragMil

   send momentumAccumulate to me in 5 milliseconds

end momentumAccumulate


on mousemove

   if AllowDrag <> empty then

  set the vScroll of me to AllowDrag-(the mouseV)

   end if

end mousemove


on mouseup

   put empty into AllowDrag

   put 0 into tCMTotal

   Repeat with CM = 1 to 5

  add CumulativeMomentum[CM] to tCMTotal

   end Repeat

   put tCMTotal/5 into tAverageMomentum

   put tAverageMomentum * 30 into tRemainingDistance

   doMomentumScrolling tRemainingDistance,50

end mouseup


on doMomentumScrolling tRemainingDistance, tCount

   if tCount > 50 then

  exit doMomentumScrolling

   end if

   if mouse(1) is "down" then

  exit doMomentumScrolling

   end if

   put tRemainingDistance/15 into tDistanceToMove

   put the vScroll of me into tVScroll

   set the vScroll of me to tVScroll - tDistanceToMove

   put tRemainingDistance-tDistanceToMove into tRemainingDistance

   put tCount-1 into tCount

   send "doMomentumScrolling tRemainingDistance, tCount" to me in 5
milliseconds

end doMomentumScrolling

-- 
Do all things with love
___
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


Did queryRegistry break?

2017-06-28 Thread Richard Gaskin via use-livecode
I ran a test for a user in the forums and was surprise to find I can't 
get strings back from the queryRegistry function - here's his thread:



Any of you having luck with queryRegistry in recent builds?

I searched the bug DB and came up empty.  Given how rarely I use Windows 
I figured it might be good to check in here so see if others can confirm 
this before I write a bug report, hoping perhaps I just missed something.


The specific key he tested is:

HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM

In my VM my Win10 install doesn't have that, but even testing values I 
can confirm in RegEdit like this one from the docs, returns empty with 
no error info in the result:


HKEY_CLASSES_ROOT\.livecode

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

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


Re: synonyms

2017-06-28 Thread Richard Gaskin via use-livecode

Paul Dupuis wrote:

> Mike,
>
> Even better.
>
> You solution illustrate more so than mine how easy it is to make
> handler and functions that use name/value pairs if someone prefers
> that model. The xtalk language really doesn't need any extensions
> or enhancements to enable this.

Fully agreed, as I wrote in my post introducing this arg format to the 
discussion a couple days ago:


And as much as I like it in R, I'm not sure I would advocate it
in an xTalk as any sort of necessity.  It might be ideal for
certain types of commands (oh how I'd love it with "export"),
but is so unusual compared to most other languages that it may
just increase the learning curve for most folks.

I bring it up here not as a recommendation, but just as a sort
of "think REALLY different" exercise as we consider alternative
syntax possibilities...


A third option is one I wrote back when I was experimenting with this, 
getting just a bit closer to how those args are handled in R by using a 
single string that doesn't require commas between name-value pairs:


   DoSomething  "name='my chart' width=100 label='This is a chart'"

Still imperfect, a bit cumbersome to have to be mindful of how strings 
are handled with the single-quotes inside and double-quotes outside (see 
below).  But like anything else, you write it once, unit test it, and 
you never have to think about it again.


Though it doesn't kill us to write parsers for things like that, it's 
definitely not for newcomers.  And while the engine is pretty efficient, 
the additional overhead of parsing named args in script makes them 
impractical for commonly-called routines where performance is critical.


More with-the-grain would be this fourth option, passing in an array as 
we see with some existing LC commands and functions, but that requires a 
LOT more typing:


  put "my chart" into tA["name"]
  put 100 into tA["width"]
  put "This is a chart" into tA["label"]
  DoSomething tA

I haven't spent much more time on named args because once I started down 
the road of replicating R functionality in LC (seemed useful at the time 
for some analytics tasks) I found there are a great many conveniences in 
R that would need to be written from scratch to deliver a workflow as 
productive.  Ultimately I decided that rather than try to build R in LC 
it was probably more productive to just learn R. :)  Fun exercise, 
though.  While I rarely end up using such replication experiments in 
production, I don't mind doing them as they help me learn the thing I'm 
translating.  I learned a lot about CSS writing a layout translator, the 
only one likely to find its way into production.  And while I could find 
no practical use-case for a library that rapidly creates objects from 
sparse readable strings I did learn a lot about REBOL Layout playing 
around with the idea back in the day.


All this reminds me of something that actually might be worth 
considering, a real sanity- and time-saver in JavaScript and other 
languages:


The ability to use single-quotes and double-quotes interchangeably so 
they can be nested.


E.g. to get this:

  "Hello", he said. "How are you?"

...we could write:

  put '"Hello", he said, "How are you?"'

...vs today's:

  put quote& "Hello" & quote &", he said. " & quote \
 & "How are you?" & quote

I find having only the "quote" constant with no means of nesting with 
single-quotes often makes concatenated expressions much longer and more 
complicated to type *and read* than their equivalents in JavaScript.


I imagine there are good reasons we don't have this, but I can dream

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

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


Re: Obtaining the "active" Desktop/Monitor under OSX?

2017-06-28 Thread Trevor DeVore via use-livecode
 I am not at my computer to confirm this but I believe the "screen
"property of a stack returns the number of the screen that the stack is on.
That number represents the line offset of the screen in the screenrects
property.

-- 
Trevor DeVore


On Wed, Jun 28, 2017 at 9:59 AM Paul Dupuis via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I remember when the multiple Desktop feature was introduced on OSX
> (Yosemite I think?) there was a very active discussion on this email
> list about how to tell what monitor (in a multiple monitor
> configuration) your application was starting up on.
>
> I have tried searching for this but my search keyword choices (or search
> skills) are failing me.
>
> Does anyone remember how to do this? Or can point me to the
> answer/workaround from the discussion?
>
> OR has anything been added to the LiveCode language in 8.x.x+ that lets
> an app tell what monitor it is starting up on? I check the 8.1.4
> Dictionary, but I could not find anything.
>
> The 1st line of the screenrects is the "primary" monitor, which with the
> OSX feature is not necessarily the monitor the app is launching on
> running on (it has its menubar on)
>
> Thank you in advance for any pointers/guidance.
>
>
> ___
> 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: Obtaining the "active" Desktop/Monitor under OSX?

2017-06-28 Thread Mark Schonewille via use-livecode

If I execute this

put (the loc of this stack is within -1440,-132,0,768)

on my primary screen, I get false in the message box.

Kind regards,

Mark Schonewille
http://economy-x-talk.com
https://www.facebook.com/marksch

Buy the most extensive book on the
LiveCode language:
http://livecodebeginner.economy-x-talk.com

Op 28-Jun-17 om 16:59 schreef Paul Dupuis via use-livecode:

I remember when the multiple Desktop feature was introduced on OSX
(Yosemite I think?) there was a very active discussion on this email
list about how to tell what monitor (in a multiple monitor
configuration) your application was starting up on.

I have tried searching for this but my search keyword choices (or search
skills) are failing me.

Does anyone remember how to do this? Or can point me to the
answer/workaround from the discussion?

OR has anything been added to the LiveCode language in 8.x.x+ that lets
an app tell what monitor it is starting up on? I check the 8.1.4
Dictionary, but I could not find anything.

The 1st line of the screenrects is the "primary" monitor, which with the
OSX feature is not necessarily the monitor the app is launching on
running on (it has its menubar on)

Thank you in advance for any pointers/guidance.


___
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


Obtaining the "active" Desktop/Monitor under OSX?

2017-06-28 Thread Paul Dupuis via use-livecode
I remember when the multiple Desktop feature was introduced on OSX
(Yosemite I think?) there was a very active discussion on this email
list about how to tell what monitor (in a multiple monitor
configuration) your application was starting up on.

I have tried searching for this but my search keyword choices (or search
skills) are failing me.

Does anyone remember how to do this? Or can point me to the
answer/workaround from the discussion?

OR has anything been added to the LiveCode language in 8.x.x+ that lets
an app tell what monitor it is starting up on? I check the 8.1.4
Dictionary, but I could not find anything.

The 1st line of the screenrects is the "primary" monitor, which with the
OSX feature is not necessarily the monitor the app is launching on
running on (it has its menubar on)

Thank you in advance for any pointers/guidance.


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

2017-06-28 Thread Bob Sneidar via use-livecode
+1

> On Jun 27, 2017, at 17:12 , Mike Bonner via use-livecode 
>  wrote:
> 
>>> When I teach I feel it's important to include WHY in addition to HOW.
> 
> This.
> I can't tell you how often I've helped people out (non-paid) and right in
> the middle of an explanation of why, what things can go wrong, and how to
> fix them.. they interrupt and say.. "But that's what i have you for, can't
> you just make it work.."  Well yes i can for $60 an hour.  Here's your bill.


___
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: synonyms

2017-06-28 Thread Paul Dupuis via use-livecode
Mike,

Even better.

You solution illustrate more so than mine how easy it is to make handler
and functions that use name/value pairs if someone prefers that model.
The xtalk language really doesn't need any extensions or enhancements to
enable this.


On 6/28/2017 10:14 AM, Mike Bonner via use-livecode wrote:
> Even easier would be to just pass a single string like so..
>
> myhandler "type=blue,name=fred,something=234"
>
> And use split
>
> split pVar by comma and "="
>
> ending up with an array keyed by name.
>
> On Wed, Jun 28, 2017 at 5:41 AM, Paul Dupuis via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
>> Here is some code to pass params by name - value pairs. It is relatively
>> easy with the paramCount and param functions of livecode.
>>
>> on mouseUp
>>
>>   myHandler "type=blue","name=fred","something=234"
>>
>> end mouseUp
>>
>>
>> on myHandler
>>
>>   repeat with i=1 to the paramCount
>>
>> put param(i)&cr into tArg
>>
>> set itemDel to "="
>>
>> put item 1 of tArg into tName
>>
>> put item 2 of tArg into tValue
>>
>> put "Name:"&&tName&&"= Value:"&&tValue&cr after msg
>>
>>   end repeat
>>
>> end myHandler
>>
>>
>>
>>
>> On 6/28/2017 2:42 AM, FlexibleLearning.com via use-livecode wrote:
>>> This is how ChartMaker (www.flexibleLearning.com/chartmaker ) works,
>> with
>>> only the required name-value pairs and in any order. It does make
>>> implementing modifications to chart displays a lot easier for exactly the
>>> reasons you give!
>>>
>>> Hugh Senior
>>> FLCo
>>>
 -Original Message-
 I don't know when OL will be available or how it'll work.  I only know
 one thing it won't support, based on an earlier conversation with Mark
 Waddingham:  R-style arguments (similar in many respects to CSS values).

 In R, things like the plot command have reasonably-useful defaults, so
 that you can just pass in data with nothing else and get a useful
>> result.
 But if you want to tailor it you pass arguments in as name-value pairs,
 e.g.:

plot(cars, type="o", col="blue", ylim=c(0,12))

 What I like about that is I'm free from having to remember parameter
 order, which also means I don't need to add a hundred commas if I want
 to pass in a value for the 101st param.

 With name-value pairs I can include only the options I want, and in any
 order.

 Extra bonus points that the purpose of any argument is made explicit by
 including its name.  If I see "o" I don't need to count commas and guess
 about what that applies to, I know very clearly looking at the name
 provided with it that it governs the plot type.
>>>
>>> ___
>>> 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: How do we access the clipboard on mobile devices?

2017-06-28 Thread Richard Gaskin via use-livecode

Thierry Douez wrote:

> J. Landman Gay
> ​:
> ​
>
> They can paste text normally if you use a native field. The only
>> restriction is that LC can't manage the clipboard through script
>> alone. But if you create a mobile field the OS handles it as
>> expected.
>>
>> In other words, copy and paste is currently limited to manual user
>> actions.
>>
 It would be very nice to be able to get and set the
 rawClipboardData on mobile but that is only possible on the
 desktop.

>
> On my latest release of sunnYtext2speech, I did add an experimental
> copy and paste commands.
>
> Contact me off-list if any interest.

Is there anything that might interest the readers here?  What were these 
experiments?  Were you able to programmatically alter the mobile OS 
keyboard?


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

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

Re: 8.1.4 Export snapshot

2017-06-28 Thread Richard Gaskin via use-livecode

Richmond Mathewson wrote:

> Mac OS 10.7.8
>
> in LC 7.1.4 if I type this sort of thing into the Message box:
>
> export snapshot from group "abc" to file "abc.png" as PNG
>
> it exports a snapshot of my group!
>
> But that doesn't work in 8.1.4.

FWIW it works for me in 8.1.5rc2 on Ubuntu 14.04.

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

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


Re: synonyms

2017-06-28 Thread Mike Bonner via use-livecode
Even easier would be to just pass a single string like so..

myhandler "type=blue,name=fred,something=234"

And use split

split pVar by comma and "="

ending up with an array keyed by name.

On Wed, Jun 28, 2017 at 5:41 AM, Paul Dupuis via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Here is some code to pass params by name - value pairs. It is relatively
> easy with the paramCount and param functions of livecode.
>
> on mouseUp
>
>   myHandler "type=blue","name=fred","something=234"
>
> end mouseUp
>
>
> on myHandler
>
>   repeat with i=1 to the paramCount
>
> put param(i)&cr into tArg
>
> set itemDel to "="
>
> put item 1 of tArg into tName
>
> put item 2 of tArg into tValue
>
> put "Name:"&&tName&&"= Value:"&&tValue&cr after msg
>
>   end repeat
>
> end myHandler
>
>
>
>
> On 6/28/2017 2:42 AM, FlexibleLearning.com via use-livecode wrote:
> > This is how ChartMaker (www.flexibleLearning.com/chartmaker ) works,
> with
> > only the required name-value pairs and in any order. It does make
> > implementing modifications to chart displays a lot easier for exactly the
> > reasons you give!
> >
> > Hugh Senior
> > FLCo
> >
> >> -Original Message-
> >> I don't know when OL will be available or how it'll work.  I only know
> >> one thing it won't support, based on an earlier conversation with Mark
> >> Waddingham:  R-style arguments (similar in many respects to CSS values).
> >>
> >> In R, things like the plot command have reasonably-useful defaults, so
> >> that you can just pass in data with nothing else and get a useful
> result.
> >>
> >> But if you want to tailor it you pass arguments in as name-value pairs,
> >> e.g.:
> >>
> >>plot(cars, type="o", col="blue", ylim=c(0,12))
> >>
> >> What I like about that is I'm free from having to remember parameter
> >> order, which also means I don't need to add a hundred commas if I want
> >> to pass in a value for the 101st param.
> >>
> >> With name-value pairs I can include only the options I want, and in any
> >> order.
> >>
> >> Extra bonus points that the purpose of any argument is made explicit by
> >> including its name.  If I see "o" I don't need to count commas and guess
> >> about what that applies to, I know very clearly looking at the name
> >> provided with it that it governs the plot type.
> >
> >
> > ___
> > 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: synonyms

2017-06-28 Thread Paul Dupuis via use-livecode
Here is some code to pass params by name - value pairs. It is relatively
easy with the paramCount and param functions of livecode.

on mouseUp

  myHandler "type=blue","name=fred","something=234"

end mouseUp


on myHandler

  repeat with i=1 to the paramCount

put param(i)&cr into tArg

set itemDel to "="

put item 1 of tArg into tName

put item 2 of tArg into tValue

put "Name:"&&tName&&"= Value:"&&tValue&cr after msg

  end repeat

end myHandler




On 6/28/2017 2:42 AM, FlexibleLearning.com via use-livecode wrote:
> This is how ChartMaker (www.flexibleLearning.com/chartmaker ) works, with
> only the required name-value pairs and in any order. It does make
> implementing modifications to chart displays a lot easier for exactly the
> reasons you give!
>
> Hugh Senior
> FLCo
>
>> -Original Message-
>> I don't know when OL will be available or how it'll work.  I only know
>> one thing it won't support, based on an earlier conversation with Mark
>> Waddingham:  R-style arguments (similar in many respects to CSS values).
>>
>> In R, things like the plot command have reasonably-useful defaults, so
>> that you can just pass in data with nothing else and get a useful result.
>>
>> But if you want to tailor it you pass arguments in as name-value pairs,
>> e.g.:
>>
>>plot(cars, type="o", col="blue", ylim=c(0,12))
>>
>> What I like about that is I'm free from having to remember parameter
>> order, which also means I don't need to add a hundred commas if I want
>> to pass in a value for the 101st param.
>>
>> With name-value pairs I can include only the options I want, and in any
>> order.
>>
>> Extra bonus points that the purpose of any argument is made explicit by
>> including its name.  If I see "o" I don't need to count commas and guess
>> about what that applies to, I know very clearly looking at the name
>> provided with it that it governs the plot type.
>
>
> ___
> 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: Petya attack

2017-06-28 Thread Mark Schonewille via use-livecode

Hi Richmond,

Probably not, because the offending file(s) need(s) to be installed in 
the Windows directory to be effective. A Mac doesn't have a Windows 
directory. Any guest OS's running in a virtual machine however may be 
affected.


I could imagine that other Office packages running on Windows machines 
may be vulnerable.


Kind regards,

Mark Schonewille
http://economy-x-talk.com
https://www.facebook.com/marksch

Buy the most extensive book on the
LiveCode language:
http://livecodebeginner.economy-x-talk.com

Op 28-Jun-17 om 08:47 schreef Richmond Mathewson via use-livecode:

" This ransomware is exploiting a vulnerability in Microsoft Office when
handling RTF documents"

Although the article seems to say that this thing only affects Windows I
wonder whether this thing can
do damage to Macs via Microsoft Office for Mac or opening one of these
RTF documents with one of the
other Office suites?

Richmond.



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


Re: Server Installation

2017-06-28 Thread Lagi Pittas via use-livecode
I was just about to suggest the Abyss webserver when I read your post.

I can confirm that after trying about 6 webservers to run ActiveVFP - a
system to run the FoxPro language on the Web ALL other webservers
crashed.either at start or after a few minutes,  Abyss is running without a
problem. https://aprelium.com/abyssws/

Kindest Regards Lagi

On 28 June 2017 at 01:49, Warren Samples via use-livecode <
use-livecode@lists.runrev.com> wrote:

> On 06/27/2017 02:41 PM, Simon Smith via use-livecode wrote:
>
>>   developers need
>> something reliable that they can get up and running quickly and does not
>> require in depth knowledge of Linux to get setup.
>>
>
>
> Perhaps people should be encouraged to consider alternatives to Apache. I
> suspect that for a lot of users wanting to simply run LiveCode scripts or
> serve dynamic content based on LiveCode scripts, most of the capability and
> flexibility of Apache is wasted overhead. If one has control over the
> software, it seems sensible to me to consider options which allow more
> reliably simple configuration.
>
> I use Hiawatha . It's dead simple to
> configure it to work with LC-Server. I have seen someone suggest the Abyss
> web server: . There
> are others. It may be that spending a little time researching alternatives
> will pay you back in time (and aggravation!) in getting things running.
>
> Warren
>
>
> ___
> 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: How do we access the clipboard on mobile devices?

2017-06-28 Thread Thierry Douez via use-livecode
J. Landman Gay
​:
​

They can paste text normally if you use a native field. The only
> restriction is that LC can't manage the clipboard through script alone. But
> if you create a mobile field the OS handles it as expected.
>
> In other words, copy and paste is currently limited to manual user actions.
>
>
>
>>> It would be very nice to be able to get and set the rawClipboardData on
>>> mobile but that is only possible on the desktop.
>>>
>>

On my latest release of sunnYtext2speech, I did add an experimental
copy and paste commands.

Contact me off-list if any interest.

Kind regards,

Thierry

-- 

Thierry Douez - sunny-tdz.com
sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage
___
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

8.1.4 Export snapshot

2017-06-28 Thread Richmond Mathewson via use-livecode

Mac OS 10.7.8

in LC 7.1.4 if I type this sort of thing into the Message box:

export snapshot from group "abc" to file "abc.png" as PNG

it exports a snapshot of my group!

But that doesn't work in 8.1.4.

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