Re: Polygon fill algo?

2021-02-15 Thread Mark Waddingham via use-livecode

On 2021-02-16 05:55, Richard Gaskin via use-livecode wrote:

My expectation was almost beyond anything reasonable, but it would
seem useful if there was some way to make it happen:  imagine if each
segment within a list of discontiguous points was rendered as though
it's a separate object, back to front.

It's not going to kill me to use separate graphics to hide the
portions of the vertices I need covered, but it sure would have been
nifty if I'd found a way to have a single poly object render as though
it were many.


So the even-odd fill rule will not give you what you want - overlapping 
regions alternate.


The non-zero fill rule can give you what you want - but you need to make 
sure that all your sub-polygons go 'in the same direction'. (NB: Fixed 
width font ASCII art follows):


These two overlapping rects both go clock-wise so everything is filled.

  |--->---|
  |...|
  |...|--->---|
  ^...|...|...|
  |...|...|...|
  |-- |---|...v
  |...|
  |---|

The left rect goes anti-clockwise and the right rect goes clockwise:

  |---<---|
  |...|
  |...|--->---|
  v...|   |...|
  |...|   |...|
  |-- |---|...v
  |...|
  |---|

Notionally:
   - the non-zero winding rule works by starting on the left of each 
scanline and scanning to the right

   - there is a winding counter which starts at 0.
   - at any pixel, if the winding counter is non-zero the pixel is 
filled.
   - if an edge is crossed which goes 'down', the winding counter is 
decreased
   - if an edge is crossed which goes 'up', the winding counter is 
increased


Hope this helps!

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Using MySQL on (headless) Linux

2021-02-03 Thread Mark Waddingham via use-livecode

On 2021-02-03 20:07, Richard Gaskin via use-livecode wrote:
LC Server had already been ruled out (for whatever reason) in an 
earlier part of the thread...


That's too bad. LC Server is LiveCode build designed specifically for
command line use.


Interesting - I don't remember that being what I specifically designed 
it for :P


LiveCode Server was *specifically designed* to be used just like PHP - 
allowing you to interpolate code with HTML output for the purposes of 
constructing webpages on the fly, sitting behind a web-server... That's 
why it has unique syntax designed precisely for a CGI environment, and 
operating in that PHP-like manner.


Making it run in command-line mode as well was an obvious thing to do, 
and also made up for the fact (at the time) that bare standalone engines 
would not launch a stack on the command-line (as that was a rather 
gaping licensing hole which was closed between v3 and v4

IIRC). [ It also made it easier to test the general features of it! ]

Since the advent of the community edition, however, and perhaps more 
importantly script-only-stacks - standalone engines running with -ui can 
be just as convenient...


Assuming there isn't a feature-requiring reason to use one over the 
other, then it pretty much comes down to how you want to write your text 
based scripts.


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Using MySQL on (headless) Linux

2021-02-02 Thread Mark Waddingham via use-livecode

On 2021-02-03 00:31, Richard Gaskin via use-livecode wrote:

As for my post, it was a question in reply to Mark Waddingham's note
about how only standalones can be expected to use externals.  That is,
at least as I read it.


Mark said nothing of the sort :)

LC Server had already been ruled out (for whatever reason) in an earlier 
part of the thread so I was just advising on how to solve Ben's issue of 
wanting a non-server engine that can be run in -ui mode which has 
dependencies.


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Using MySQL on (headless) Linux

2021-02-02 Thread Mark Waddingham via use-livecode

On 2021-02-01 22:25, Ben Rubinstein via use-livecode wrote:

Undesirable things found:

1. I've not found how to access externals (in this case the database
library) without explicitly setting the 'externals' property of the
stack to a (generally unreliably) full path before the stack is saved.

3. revSetDatabaseDriverPath is required even when the drivers are in
the standard location inside the app 'bundle'.

I'll report (2) and (3) formally when I've done a bit more
investigation. I'd still love to know what I'm doing wrong, in
relation to (1).


Please don't - as neither are bugs :)

The standalone engine inside the runtime folders in the IDE install is 
just a bare engine.


In community you can certainly run the bare engine without building a 
standalone but as you have discovered it is just what it is - a bare 
engine, it knows nothing of externals, database drivers, widgets, script 
libraries or anything else.


If you want a headless (community) engine which has dependencies then 
all you have to do is deploy a standalone with a launcher stack embedded 
into it.


The launcher stack should have the inclusions you want configured for 
it, and it can just run the stack you pass as an argument on the 
command-line.


Doing it this way, it means the standalone builder will take care to 
ensure all the 'inclusions' you set are present and configured correctly 
(including widgets, externals and script libraries).


You only need to rebuild the standalone if your inclusion requirements 
change, or you want to change engine version.


Warmest Regards,

Mark.

P.S. In regards to (1) the trick is to do this:
```
set the externals of the templateStack to 
create invisible stack "Externals" -- or any name you like
inser the script of it into back
reset the templateStack
```
This allows you to compute the external paths at runtime when the engine 
starts (e.g. by using the engine folder, or the filename of the stack 
and computing the paths).


--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Server error? SOLVED

2020-12-31 Thread Mark Waddingham via use-livecode

On 2020-12-31 11:08, Klaus major-k via use-livecode wrote:

Hi all,

we could finally solve the problem by copying the revsecurity.dll from
LC 9 to the LC 5.x runtime folder! 8-)

I really had no idea that they were compatible!?

Nevertheless I will write to the mothership next week, just to get to
know why everythings works fine in the IDE but not in a runtime.


The IDE loads different DLLs from those it includes in standalones. So 
there is a revsecurity.dll (near/next to) the IDE engine on Windows, and 
also one in the Runtime/Windows... folder. The latter is copied into 
standalones, the former is only used by the IDE.


It suggests that you have previously copied a newer DLL over the one 
near the IDE engine - so it works in the IDE... Then when you copied the 
same DLL into the runtime folder, it then works in standalones too.


The DLLs from newer versions aren't guaranteed to be compatible with 
older versions - in the specific case of revsecurity it depends on 
whether OpenSSL has changed its API in a way which causes an 
incompatibility but it hasn't done this very often (fortunately in this 
case, it would seem!).


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Encrypting Stack Breaks Field References

2020-12-13 Thread Mark Waddingham via use-livecode

On 2020-12-14 06:03, J. Landman Gay via use-livecode wrote:

On 12/13/20 6:02 PM, Richard Gaskin via use-livecode wrote:

Copying objects is disallowed in an encrypted stack, since of course 
once an object is copied it could be pasted into an unencrypted stack, 
and thus expose the source.


Except, copying via script using "copy x to y" doesn't involve the
clipboard. I think this could be categorized as a bug, the original
script should work.


Its not the copy that will be failing - but the create. In general you 
can't do anything to an encrypted stack which might cause a script to 
move from where its encrypted to somewhere else or vice-versa. (The 
reason create is disallowed is that you could create a new script via 
setting props of the template object).


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: export snapshot woverwrites variable?

2020-12-10 Thread Mark Waddingham via use-livecode

On 2020-12-10 13:55, Klaus major-k via use-livecode wrote:

Hi friends,

## Doing this again fixes the inconvenience and I can continue:
put dasObjekt() into tObject
...

Funky, funky!?


Nope - not funky.

Container syntax can be either a variable (with array indices or 
without), or an object chunk which has a notion of 'text' (i.e. button, 
field, image).


If it is a variable then the variable gets modified.

If it is an object chunk then the text of the object gets changed.

Variables are only treated as (potential) object chunks when being 
evaluated as a source, and only then if the thing operating on them 
expects an object. e.g. the blendLevel of tObject (property syntax only 
makes sense when targetting an object chunk, so the contents of tObject 
are parsed as a control chunk).


Indeed, if this wasn't the case then you wouldn't ever be able to change 
tObject in the following script:


  local tObject
  put the long id of field 1 into tObject

  -- If variable containers (targets) resolved as objects first:
  put "foo" into tObject -- this would set the text of the field to 
"foo"


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: filter

2020-11-19 Thread Mark Waddingham via use-livecode

So I thought
...
filter fld 1 with "[*"
...
would do the job, but that EMPTIES the field!?
Obviously this [ interferes with some REGEX mechanism of filter?
So what should I use now?


I think:

  filter fld 1 with "[[]*"

Should do the trick...

Basically, you can use '[...]' to 'escape' the operators in the wildcard 
pattern (i.e. *, [ and ?).


Hope this helps,

Mark.

P.S. Wildcard patterns are a lot simpler than general regexes, but 
'filter' can do both "filter ... with regex pattern ..." interprets the 
pattern the same as matchText/replaceText.


--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: VPN and tsNet

2020-10-27 Thread Mark Waddingham via use-livecode

On 2020-10-27 01:05, Brian Milby via use-livecode wrote:

I have a fairly simple stack that I use to get FedEx tracking data
using tsNetPostSync.  It has worked fine until a new VPN connection
was added.  The only change that I know is that it no longer allows a
split tunnel so everything must go through the VPN.  Assuming that is
the issue, how do I configure tsNet to use the VPN instead of trying
to connect directly?  (I’m pretty sure that proxy is not enabled yet,
but that is probably coming too).  I did try to set the
defaultNetworkInterface but it did not seem to have any impact.  For
now I am just disconnecting the VPN to pull the data.


I *think* the 'interface' setting is what you want:

“interface”: (Introduced in tsNet version 1.4.0) Specify the interface, 
IP address or host name to be used for the outgoing connection.


This should be set to the local ip address of the interface (i.e. VPN) 
you want the socket connection to come from on the local machine.


Warmest Regards,

Mark.

P.S. Hopefully Charles can correct this if I'm wrong!

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: First version of LC that supports httpS?

2020-10-19 Thread Mark Waddingham via use-livecode

On 2020-10-19 17:31, Klaus major-k via use-livecode wrote:

Hi all,

see subject, maybe someone happens to know.
Obviously LC 5.02 does not support httpS yet.


HTTPS has been supported since engine version 2.6 judging by the libURL 
source - so that would be LiveCode 2.x (for some 'x' - I can't remember 
the exact version the engine version and the - what was Revolution - 
version synced up).


However, it is unlikely that https will work anymore from those engines 
with any suitably maintained web-server since the SSL protocol version 
they use will likely be judged insecure by the server and thus not allow 
connection. (Although that can be very unwisely changed on the webserver 
side).


Another facet here will be the 'root certificate bundle' which will 
almost certainly be well out of date for older engines (at some point we 
did make collection of SSL certificates from the OS automatic - that was 
before 6.0 by the look of it).


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: SSL cPanel mySql setup

2020-10-16 Thread Mark Waddingham via use-livecode

On 2020-10-16 10:51, matthias rebbe via use-livecode wrote:

Hi Sean,

there was a discussion a few weeks ago with the topic "Strange
behavior between Mysql, MariaDB and SSL."
I am not sure if the information in that discussion will solve your 
problem.


I had a quick look through that thread and I don't think that is 
necessarily relevant here (unless there was a part I missed) - that 
seemed to be mostly about authentication method rather than SSL 
specifically - it sounds like in this case a connection is being made it 
is just that it does not seem to be secured using SSL encryption.


I checked the mysql client library code and it seems that if the MySQL 
server says it does not support SSL then even if you ask for SSL 
connection (which revDB does is the useSSL flag is true) that request 
will be ignored and you will get a plaintext connection.


So this definitely *sounds* like a MySQL server setup problem rather 
than a client one (there's some useful info for at least testing the 
type of connection using the mysql command-line terminal utility here - 
https://docs.cpanel.net/knowledge-base/security/how-to-configure-mysql-ssl-connections/)



Another approach is the following. For security reasons we do not let
communicat our LC apps directly with MySQL Databases, if the Database
is hosted on a public server.

We using a Livecode Server Script on the Webserver for doing the
complete DB communication.
Our standalones (Mobile and Desktop) send the requests (password
encrypted string) either as POST or GET to the LC Server script. The
script encrypts the  request string and executes it. The return from
the DB is then returned to our standalone.


This is most definitely a better solution - and is the only real option 
if client apps are talking to the server from arbitrary networks.


Whilst a secured (via SSL) connection to MySQL directly should mitigate 
security concerns (as all data flowing between client and server is 
encrypted), there is no guarantee that an arbitrary network will *allow* 
connection to the MySQL database port which is required for that to 
function.


In contrast, you'd be hard pressed to find any network which allows 
access to the internet which blocks port 80 (HTTP) or 443 (HTTPS).


Of course, the other advantage of using a 'gateway API' to access your 
server data is that it allows client and server more flexibility in 
changing and optimizing things - i.e. if you change something 
server-side then you can probably make it so you don't necessarily need 
a client update to match (as you can just adjust what the gateway does).


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: DataGrid 2 swipe actions

2020-08-27 Thread Mark Waddingham via use-livecode
Heh - well I said ‘well structured’ not ‘literary’...

Although that being said, the ‘singular’ noun ‘drag’ has a plural and I believe 
it is ‘drags’... 

e.g. ‘It took several drags of her long fingernails down the blackboard to make 
the class pay attention’ ;)

If your fix works for you - great...

Unfortunately it breaks some functionality for others so isn’t mergeable as it 
stands.

Warmest Regards,

Mark.

Sent from my iPhone

> On 27 Aug 2020, at 20:58, Mike Kerner via use-livecode 
>  wrote:
> 
> Don't be telling me about "well structured commit titles".  There is
> nothing clear in that title, unless British is your first language, and
> English is your second, and in British we add an "s" on the ends of every
> singulars nouns, and peoples speak with a lisps.
> In the meantime(s), setting the delayTouches to false(s) on a DG(s) breaks
> scrolling(s), thus my PR(s), from however-long-ago it(s) was. :-P
> Tag.  You(s)'re it(s)
> 
>> On Thu, Aug 27, 2020 at 2:17 PM Mark Waddingham via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>> 
>>> On 2020-08-27 17:07, Mike Kerner via use-livecode wrote:
>>> name's mikey.  y'all can call me...
>>> mikey
>>> 
>>> howdy.
>>> 
>>> i think it was just one line of code, too, right?  it was just a matter
>>> of
>>> setting the delayTouches to true.  i have no idea why it was originally
>>> "false".
>> 
>> Well, the advantage of generally trying to make sure all substantive
>> changes made to the source have well structured commit titles and decent
>> descriptions in the body means its easy to find out by grokking `git
>> log` :D
>> 
>> It was changed precisely because of the issues Andrew pointed out with
>> DG2, specifically in this commit:
>> 
>> commit ac1beee1dd113e203b6715fe472cf2fa88656bd5
>> Author: Michael McCreary 
>> Date:   Thu Dec 21 12:49:26 2017 +
>> 
>> [[ DataGrid 2 ]] Fix drags to cooperate with the mobile scroller.
>> 
>> Previously, a data grid's mobile scroller was getting in the way of
>> reorder and swipe actions.
>> 
>> To fix for reordering, we disable the scroller whenn the user clicks
>> on a reorder control (and re-enable it when the reorder completes).
>> 
>> Swipes are a little trickier. We track dragging on mouse down, but
>> disabling the scroller at this point will prevent all scrolling.
>> Instead we attempt to determine if the user is trying to drag the
>> row before disabling the scroller.
>> 
>> I'd need to do some more digging to see if the highlight on touch has
>> actually been caused by something else since  as I don't recall it being
>> an issue, or noticed when DG2 debuted - but I could be wrong. Especially
>> more since Android has never had a delayTouches mode.
>> 
>> Either this problem also affects Android, which means turning
>> delayTouches on is not really an option (given the negative consequences
>> to DG2 behavior); or it doesn't affect Android in which case something
>> else has changed (potentially in the iOS scroller control itself).
>> 
>> I suspect we will just need a short timer on mouse down so that it only
>> triggers a highlight *if* a scroll message isn't received within the
>> interval of the timer.
>> 
>> Warmest Regards,
>> 
>> Mark.
>> 
>> --
>> Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
>> LiveCode: Everyone can create apps
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
> 
> 
> -- 
> On the first day, God created the heavens and the Earth
> On the second day, God created the oceans.
> On the third day, God put the animals on hold for a few hours,
>   and did a little diving.
> And God said, "This is good."
> ___
> 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: DataGrid 2 swipe actions

2020-08-27 Thread Mark Waddingham via use-livecode

On 2020-08-27 17:07, Mike Kerner via use-livecode wrote:

name's mikey.  y'all can call me...
mikey

howdy.

i think it was just one line of code, too, right?  it was just a matter 
of

setting the delayTouches to true.  i have no idea why it was originally
"false".


Well, the advantage of generally trying to make sure all substantive 
changes made to the source have well structured commit titles and decent 
descriptions in the body means its easy to find out by grokking `git 
log` :D


It was changed precisely because of the issues Andrew pointed out with 
DG2, specifically in this commit:


commit ac1beee1dd113e203b6715fe472cf2fa88656bd5
Author: Michael McCreary 
Date:   Thu Dec 21 12:49:26 2017 +

[[ DataGrid 2 ]] Fix drags to cooperate with the mobile scroller.

Previously, a data grid's mobile scroller was getting in the way of
reorder and swipe actions.

To fix for reordering, we disable the scroller whenn the user clicks
on a reorder control (and re-enable it when the reorder completes).

Swipes are a little trickier. We track dragging on mouse down, but
disabling the scroller at this point will prevent all scrolling.
Instead we attempt to determine if the user is trying to drag the
row before disabling the scroller.

I'd need to do some more digging to see if the highlight on touch has 
actually been caused by something else since  as I don't recall it being 
an issue, or noticed when DG2 debuted - but I could be wrong. Especially 
more since Android has never had a delayTouches mode.


Either this problem also affects Android, which means turning 
delayTouches on is not really an option (given the negative consequences 
to DG2 behavior); or it doesn't affect Android in which case something 
else has changed (potentially in the iOS scroller control itself).


I suspect we will just need a short timer on mouse down so that it only 
triggers a highlight *if* a scroll message isn't received within the 
interval of the timer.


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Adding items to a group

2020-08-26 Thread Mark Waddingham via use-livecode

On 2020-08-26 10:06, Jimmieson, Phil via use-livecode wrote:

One thing I’m considering is having a set of dummy hidden items
already in the group and making one of those look like the word the
user just dragged in - thus it’s already a member of the group and can
be scrolled etc with the rest. Can anyone think of any better ways of
doing it?


Take a look at the 'relayer' command in the dictionary. It allows you to 
move controls up and down the layer order and in and out of groups 
easily (without any need to ungroup/regroup).


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Cross Platform Font Layout - current workarounds

2020-08-25 Thread Mark Waddingham via use-livecode

On 2020-08-24 21:49, Sean Cole (Pi) via use-livecode wrote:
My client provided the font they needed in line with their tv show 
brand.
They need the app to work both PC and Mac. It seems I have to manually 
go

through each field, button and widget and make sure they are laid out
properly. The left, right, center alignments don't always match and the
vertical position certainly never matches.
https://www.dropbox.com/s/v50aj7uv06bh4d9/MacText.png?dl=0
https://www.dropbox.com/s/pry5teqp89xzbun/PCText.png?dl=0


I suspect the main issue with vertical alignment here is to do with the 
font.


This very readable article contains the relevant information here as 
well as how the problem can be resolved:




TL;DR; version - the custom font probably does not have the correct 
settings/tables for use in programs which use the system text engines on 
*both* Mac and Windows.


FWIW, LiveCode fields try to match the way the running platform displays 
text in OS editable fields.


Specifically, text in a field on macOS will look almost the same as that 
in TextEdit; and text in a field on Windows will look almost the same as 
that in WordPad (DPI differences taken into account - LC assumes 72dpi, 
Win assumes 96dpi).


Unfortunately this means you do need to do some work (i.e. scripting) if 
you want to use LiveCode fields in more 'graphical' situations - e.g. as 
the labels on custom buttons.


Warmest Regards,

Mark.

P.S. It is perfectly possible that fettling with the metrics detailed in 
the article above would mean you could achieve identical vertical layout 
on macOS and Windows but it isn't something I have actually tried.


--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create app

___
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: iOS app denied: AVAudioSession

2020-08-21 Thread Mark Waddingham via use-livecode

On 2020-08-21 16:39, Dan Friedman via use-livecode wrote:

Any thoughts?   Client is waiting for this post!


The only difference between 9.6.1-rc-1 and rc-2 was the removal of some 
no-longer-used references to an Ad SDK on Android. 9.6.1 was the same as 
9.6.1-rc-2 (except for version).


Apple update their review processes all the time, so it is possible they 
changed something between the two app submissions.


The most important question here is: Can you reproduce the request for 
microphone access which Apple observed?


If not, then you need to find out how they did and dispute the rejection 
- it could be human error on their side...


If you can, then it suggests that you might have some code buried 
somewhere setting the audio category - or use of the video camera is 
using a default category Apple doesn't like.


Make sure you aren't asking for a video camera with both audio and video 
- i.e. just audio only.


Failing that, there is mergAVAudioSessionSetCategory - you could try 
explicitly setting the category to "ambient" on startup.


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Browser Widget and Twitter on iOS 13

2020-08-14 Thread Mark Waddingham via use-livecode

On 2020-08-14 14:01, Mark Waddingham via use-livecode wrote:

On 2020-08-14 13:31, Ralph DiMola via use-livecode wrote:
Should I use the userAgent globally for all browser widget http(s) 
requests

on platform = iphone?


Isn't the issue on iPad?


Hah - ignore this - I forgot to edit it when I realized 'the platform' 
returns iPhone (its the machine which distinguishes between iPad and 
iPhone).


Whether to do it for all web-requests then I'm not sure - this is 
twitter.com related thing as far as I can see.


It shouldn't do any harm to use the same useragent for all requests 
though (although you might want to check if iPad latest iOS from Safari 
is different from iPhone latest from Safari and switch on the machine if 
so).


I'd recommend removing this mitigation if/when twitter.com starts 
behaving normally again though as you don't want to have to keep that up 
to date lest it cause problems for other websites.


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Browser Widget and Twitter on iOS 13

2020-08-14 Thread Mark Waddingham via use-livecode

On 2020-08-14 13:31, Ralph DiMola via use-livecode wrote:

Thanks Panos and Mark!

So... to recap..
1) get the userAgent in Safari on my 10.14.6 Mac
2) in App (If the platform="iphone" then set userAgent to this value).


Pretty much - although I recommend not using the userAgent string from a 
mac. Instead, get the userAgent string from an iPad which allows you to 
access twitter.com through the browser widget. Just in case anything 
mac-ish in the user agent string causes twitter.com to do something 
different (e.g. specialize for desktop rather than mobile).


Should I use the userAgent globally for all browser widget http(s) 
requests

on platform = iphone?


Isn't the issue on iPad?


Will this affect any other tsNet functions?


The browser widget uses WKWebView which uses system HTTP functionality 
so tsNet isn't involved.



Should it be reset back to empty for any reason?


I can't think of one.


Should I file a bug report?


No - this isn't anything we can do anything about. I strongly suspect 
the iPad issue your client is having is one of;
  - it isn't running the very latest iOS version, and Twitter is 
blocking the default userAgent string for that version and older ones 
which come from WKWebView
  - Twitter's (new?) block-list isn't actually correct and not taking 
into account enough variations (e.g. those coming from WKWebView).


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Browser Widget and Twitter on iOS 13

2020-08-13 Thread Mark Waddingham via use-livecode

On 2020-08-13 18:30, Ralph DiMola via use-livecode wrote:
That tester has both iPhone and iPad and I know there both running the 
same
version of iOS. iPhone doesn't get the message but the iPad does. I 
will

find out if there both up to the latest 13.x.x. (it flew out of my head
after I heard they were running the same version)


So I'm pretty sure this has to be the userAgent string which any HTTP 
client sends up as a header (User-Agent:?) as I don't think any other 
browser-specific/OS-specific/device-specific information is transmitted.


If you can send the user an app with just a browser widget in it where 
they can visit:


   https://www.whatismybrowser.com/detect/what-is-my-user-agent

On both the iPad and iPhone they have then at least it will show if 
there *is* a difference between the two devices in terms of what 
WKWebView is sending (can also compare with Safari on the devices too 
which would either confirm or deny my suspicion about Safari not being a 
wrapped WKWebView).


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Browser Widget and Twitter on iOS 13

2020-08-13 Thread Mark Waddingham via use-livecode

On 2020-08-13 17:06, Ralph DiMola via use-livecode wrote:

Thanks Mark.

I searched all stacks for "userAgent" and it did not exist. After I got 
some
more feedback it is working on iOS 13 iPhones but not on an iOS 13 
iPad. So
far this iPad is the only one with this issue. The user tried in Safari 
on

the iPad and did not get the message.


So that is just odd - it might be worth checking that said iPad has the 
latest version of iOS13...


There's a small chance that Apple has fixed something in WKWebView on 
iOS13 in some .x increment, and Twitter has blocked the versions before 
(via userAgent).


Safari and WKWebView are not the same thing (I think Safari might use 
its own private version of WebKit under the hood - although I'm not 100% 
sure about that) so the Safari comparison might not be relevant in this 
case.


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Browser Widget and Twitter on iOS 13

2020-08-13 Thread Mark Waddingham via use-livecode

On 2020-08-13 13:46, Ralph DiMola via use-livecode wrote:

When accessing Twitter via the Browser Widget on iOS 13 I get this
error message==> "This browser is no longer supported. Please switch
to a supported browser or disable the extension which masks you
browser to continue using twitter.com". Is there a widget setting I
can change to eliminate this? It works on Android and iOS 12. This is
from the first tester. Could there be a iOS devices setting that this
user inadvertently changed that caused this? I'm waiting for other
testers but wanted to get on top of this. Any ideas?


Hmmm - the wording "This browser is no longer supported. Please switch 
to a supported browser or disable the extension which masks you browser 
to continue using twitter.com" suggests that twitter.com is using the 
userAgent string to determine access.


I'm pretty sure the old UIWebView (which we replaced with WKWebView in 
9.6) didn't support a custom user agent string - but the new WKWebView 
one does.


Are you setting `the userAgent` property of the browser widget anywhere?

Of course, this wouldn't explain why it works in iOS12 / Android if this 
is the problem...


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Secure Socket

2020-08-07 Thread Mark Waddingham via use-livecode

On 2020-08-06 19:28, Tom Glod via use-livecode wrote:

Do you think it is overkill to still encrypt it before I send it?


Yes :)

Applying industrial strength encryption twice does not increase security 
- it just wastes processor cycles.


Indeed, if you are encrypting data to send over an encrypted stream then 
you must have a secret for this secondary encryption somewhere.


If this secret is transmitted over the wire - then your second set of 
encryption is only as secure as the original connection (if someone 
could sniff the latter, then they can sniff out your secret for the 
extra encryption).


If this secret is not transmitted over the wire and is just 'known' to 
both sides - then it means you must have a secret buried somewhere on 
both sides, probably less securely then the mechanisms used by SSL to 
establish the secret it uses to encrypt the stream.


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Google Play SDK problem

2020-07-31 Thread Mark Waddingham via use-livecode

On 2020-07-31 16:25, Mark Wieder via use-livecode wrote:

On 7/30/20 10:32 PM, JeeJeeStudio via use-livecode wrote:
Looks like the fix is on the way for 9.6.1. Quick response from the 
team.


https://github.com/livecode/livecode/pull/7412


Yes - sorry - I meant to either post (or get someone to post) that we 
think we
found the culprit. There was still some Inneractive SDK related stuff 
being

included in the commercial Android engine's Java class bundle.

All being well 9.6.1-rc-2 will appear early next week, and should 
hopefully

solve the submission issue occurring here.

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: fixed textheight affects scrolling?

2020-07-09 Thread Mark Waddingham via use-livecode

On 2020-07-09 09:54, Klaus major-k via use-livecode wrote:

Hi all,

Am 08.07.2020 um 17:51 schrieb Klaus major-k via use-livecode 
:


Hi friends,

strange phenomenon, maybe I am missing something!?
LC 9.6 on macOS 10.14.6

I have two fields with all available fonts and each line is formatted 
directly

in the appropriate font it reads.

I set the FixedLineHeight for ONE field to 28, doesn't matter 
actually.


Now I want to select a specific line in the fields with this script:
---
on mouseUp pMouseButton
 set the wholematches to TRUE
 put lineoffset("Lucida Grande",fld "fonts") into tLine
 ## Which is 366 in my fields!

 put the effective textheight of fld "fonts" into tTH
 set the scroll of fld "fonts" to tLine*tTH + the height of fld 
"fonts"

 set the hilitedlines of fld "fonts" to tLine
end mouseUp
---

Works fine for the field WITHOUT fixedlineheigt and selects the line 
-> Lucida Grande
However the same script used with the field WITH fixedlineheight, it 
selects -> Lucida Grande Bold

which is the line AFTER "Lucida Grande" and actually line 367!?

What am I overlooking?
Thanks for any hints!


I suspect the fact it works in the non-fixedline height case is 
serendipity in this specific case - if line height isn't fixed then each 
line will have a different height based on the fonts (although most will 
be the same if the fontSize is the same)...


LineOffset is 1-based - so the first line has scroll 0ish (ish because 
of field margins etc.) - that's probably the issue with your existing 
code.


There's an easier way I think though which should be independent of any 
field styling (size, font, wrapping)...


You can get the formattedTop of a line - which gives you the 
card-relative y co-ordinate of the top of the including the fields top 
and scroll. So this should do the trick:


   set the scroll of field "fonts" to the scroll of field "fonts" + \
  the formattedTop of line tLine of 
field "fonts" - \

  the top of field "fonts"

The adjustment is necessary because the scroll value is relative to the 
top-left of the 'content' of the field.


Hope this helps!

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: AR in LiveCode Browser?

2020-06-30 Thread Mark Waddingham via use-livecode

On 2020-06-30 15:46, Dan Friedman via use-livecode wrote:

Klaus,

No, mobile.  If I open the link (https://nexen.ehpec.com/usdz.html) in
Safari on my iPhone, I get total interaction with the AR (Augmented
Reality) object.  If I open the same URL in a LiveCode browser (native
or widget) it doesn't open the object at all.


It seems that WKWebView (which is the embeddable browser framework on 
iOS, and the only one*) does not support AR files - 
https://stackoverflow.com/questions/60685400/ar-images-not-working-inside-the-wkwebview.


Warmest Regards,

Mark.

* On iOS there is only allowed to be one browser framework - the one 
Apple provides. Chrome and Firefox (and all other 'alternative' 
browsers) are just 'familiar' UI wrappers around WKWebView.


--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: AR in LiveCode Browser?

2020-06-30 Thread Mark Waddingham via use-livecode

On 2020-06-30 12:38, KOOB via use-livecode wrote:

That should be in the documentation. I looked at the dictionary for
Browser Widget and it didn't mention the browser engine it was using.
I just assumed it was native to the platform it was being used on.


It is on Mac, Android and iOS... Windows and Linux use CEF (which is 
derived from Chromium - which Chrome is also derived from, albeit 
separately).


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Unicode and languages

2020-06-05 Thread Mark Waddingham via use-livecode

On 2020-06-05 18:15, Paul Dupuis via use-livecode wrote:

I don't even know if language exists in the IBM Unicode engine as some
exportable property a future version of LiveCode could expose.

Any clever ideas or thoughts on this problem are welcome.


Unicode doesn't deal in languages but 'scripts' e.g. English and French 
are both written in the Latin script, whereas Ukrainian can be written 
in either the Latin or Cyrillic script.


LiveCode gives you access to the unicode properties of all codepoints 
(as held by ICU) via the 'codepointProperty(codepoint, property)' 
function.


e.g. codepointProperty("A", "Script") => "Latin"
 codepointProperty(numToCodepoint(0x03B1), "Script") => "Greek"

This might at least help to cut out trying to spellcheck things which 
are definitely not the languages you do have dictionaries for.


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: SHELL command works in Terminal but not via SHELL in LC

2020-06-03 Thread Mark Waddingham via use-livecode

On 2020-06-03 12:13, Klaus major-k via use-livecode wrote:

However if he fires this in LC:
on mouseUp
 put shell("ffmpeg -i Desktop/ffmpegMac/TiffSequence/Test_%5d.tif 
test3.mp4")

end mouseUp

He gets:
/bin/sh: line 1: ffmpeg: command not found

But this is working in the Terminal!?
What is going on here and how can this be fixed?
Does some environment or PATH variable need to be set additonally?

Thanks a lot in advance!


Yes - when you launch an app from Finder it has a minimal set of 
environment variables.


Moreover, Terminal will run scripts when a session is started which can 
add to them (I suspect homebrew adds something to .bashrc or similar 
which sets up the PATH appropriately).


You can easily see what the differences are though by using the 'export' 
shell command...


If you run 'export' from Terminal it will give you the list of all 
environment variables; then if you do 'answer shell("export")' in LC you 
will see what ones are defined there - its then a simple case of 'spot 
the difference' :)


Hope this helps!

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: LC9.6 Android EXIF image data issue

2020-05-14 Thread Mark Waddingham via use-livecode

On 2020-05-13 23:54, Alan Stenhouse via use-livecode wrote:

Hi Monte

Thanks for the info, though that is bad news. It had previously come
through on iOS ok - when picking a photo from the library, and also on
Android AFAIK.

Do we have any way of getting EXIF data from an image picked from an
image library using MobilePickPhoto?

Thanks again for the info!


iOS definitely strips EXIF data in some cases - perhaps it is just from 
photos taken with the camera or maybe it varies slightly with OS 
version.


The Android case you are observing is probably because the EXIF data is 
being stripped also.


Assuming you don't use a width/height argument on mobilePickPhoto then 
we just return the data which we are given with no processing at all - 
so you are getting what the OS wants you to get.


It might be that Samsung's camera app is a little more security 
conscious than other Android variants :(


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: [ANN] Release 9.6.0 RC-1

2020-05-12 Thread Mark Waddingham via use-livecode

On 2020-05-12 13:45, Ralph DiMola via use-livecode wrote:

Monte/LC Team,

I understand that you have limited resources. Could there be a
comprise here to share the workload? Instead of LC having to support
and change the iOS standalone options every time there is a new iOS
device format we(LC USERS) could pickup this pain. If there could be 2
options for splash screens this could work out for all.
1) Users can use the present 9.6 rc1 storyboard options.
2) Users could supply a file of resolutions and associated image names
for each specific resolution the user wanted to supply a custom image
for. If there is not a match then the images in the current 9.6 rc1
standalone splash screen implementation would be used.

This would put the splash screen implementation of current and new
screen specs squarely in hands of the LC user while retaining the
current seamless transition from splash to card 1. (if the LC user
wanted to put in the effort).


Unfortunately I'm not sure this is possible.

Apple are (soon) going to require all apps to use a launch storyboard - 
specifying launch images is no longer viable if you want your app in the 
AppStore.


When we started adding storyboards I asked Monte to see if there was a 
way to allow current settings to work (i.e. build a storyboard which 
uses the same images currently specified in the same way), and also 
offer a simplified option (which is what has transpired in 9.6)...


Unfortunately it would seem that storyboards do not allow images to be 
chosen based on screen size - just device type (iPhone vs iPad) and 
generalized layout types (normal vs compact) - this means there appears 
to be no way to replicate what you could do with simple launch images.


Apple HIG for this is a great ideal - but in reality (as far as I can 
see) the only apps which can do that are those which use only iOS native 
controls (the idea is that you have a launch storyboard which contains 
skeleton controls from your first screen). Any app which relies on 
customized controls (even intermingled with iOS ones) cannot achieve 
what Apple suggests.


What we have wasn't something we just quickly did at the last minute 
there was a concerted effort (as there always is) to preserve what we 
already had, but we did not manage to find a way :(


That being said, it is possible that we have missed a storyboard 
capability somewhere, so if someone can figure out how to create a 
launch storyboard which *does* select images based on screen size (in a 
similar way to launch images work), then I can be pretty confident we 
will be able to generalize it to provide similar settings to the current 
ones in the S/B.


Currently the plan is to (in 9.7 hopefully!) to try and allow a custom 
storyboard - so you can design one in Xcode and then provide it along 
with the assets it needs to the standalone builder to build into your 
app. We think we can do this (there are some technical details with 
referencing the assets and such) but for the reason outlined above, this 
still won't bring back the much simpler 'provide many launch images' 
capability.


Warmest Regards,

Mark.


--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Small and strange problem

2020-05-11 Thread Mark Waddingham via use-livecode

On 2020-05-11 18:18, Graham Samuel via use-livecode wrote:

As I tiny bit of background, the script tries to parse a string that
represents a longitude, copied from a web site. It certainly has some
weird characters in it, but I thought I’d got round then. FWIW, the
string is

004° 31′ 50″ W

I am going to report it to the mother ship


I agree there is something odd going on if in the debugger tMins has 31 
as the value but when run the script outside of the debugger you get an 
error.


What is the code before it in the handler? (Indeed what is the code for 
the whole handler!)


The tMins var is presumably local, and so must be being initialized with 
a value somewhere when running in the debugger; outside of the debugger 
the error you are getting is because tMins has value "tMins" which is 
not a number until it is initialized (as its an unquoted literal at that 
point - as I'm guessing you have explicitVariables/VariableChecking 
turned off).


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: HTML Platform

2020-05-06 Thread Mark Waddingham via use-livecode

On 2020-05-06 18:40, Richard Gaskin via use-livecode wrote:

And mySQL from LC in the browser is tonnes faster than on the desktop
- massively! Because they’re both on the same server. Even though the
message path is LC>JS>(AJAX)>PHP>JS>LC!


I suspect there's something going on there that can be remedied.  As
you noted, compiled object code should be faster than interpreted
JavaScript.  In every other respect the calls should be the same, so
throughput should be faster in the OS-native implementation.  If it's
not let's review that to bring it up to speed.


This isn't true - any thing which involves communication to a remove 
server is dominated by transit time of the data - code on either end 
doing the marshalling will make little difference (regardless of how it 
is implemented).


The only thing I can think of is that the data being sent both ways is 
being compressed - as there are HTTP facilities to make that 
transparent. In contrast, the standard socket protocol of MySQL does not 
compress data so more is transferred. (This is assuming the comparison 
here is direct-socket-connnection-in-LC against 
HTTP-based-requests-from-HTML5-LC-in-browser).


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: I need some DataGrid performance help

2020-05-06 Thread Mark Waddingham via use-livecode

On 2020-05-06 17:36, Richard Gaskin via use-livecode wrote:

A while back Mark Waddingham reviewed the situation and decided that
getProp and setProp were indeed more rightly in the category of custom
messages rather than system messages, and as such should ideally be
immune to the effects of "lock messages".


If by a 'while back' you mean the thread from 2013 in the engine forum 
(http://forums.livecode.com/viewtopic.php?f=66=18048) then that's a 
long time ago! If I have commented more recently on this, then a 
reference to what I said would help :)


In reality if you want encapsulated custom controls which cannot be 
broken by user scripting around them, then it is not just property 
handlers which should be immune to lock messages, all engine messages to 
such a custom control should be immune.


Even discounting the 'life-cycle' events which behaviors on groups get 
(e.g. openControl, closeControl, resizeControl) as being similarly 
special (to property messages), custom controls can rely on reliable 
receipt of normal engine messages too.


e.g. You have a nice button custom control, it manages a hover state. It 
requires mouseEnter / mouseLeave events for that to function. If 
messages are locked then in certain cases, it might get into an 
inconsistent state because it does not get a matching pair.


Regardless of what I said 7 years ago, now (being older, and maybe a 
little wiser) I don't think I really see how changing lock messages (and 
breaking a lot of code as a result!) would get us any further towards 
better custom controls would it?


In reality, 'lock messages' is a sledge-hammer and like a sledge-hammer 
it can cause fallout if not wielded carefully.


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Has anyone experience of GPS on iPhone?

2020-05-06 Thread Mark Waddingham via use-livecode

On 2020-05-06 14:09, Graham Samuel via use-livecode wrote:

Bill, I think you are confirming that there is some mystery here.
There are a lot of apps that seem to get location, and measures
derived from location, almost completely right, whereas I am having
trouble doing so with what must be the same essential data.

How then to avoid either under- or over-estimating the trip distance?
Plenty of apps have done it but I just can’t see how, although I keep
tinkering with the parameters. Of course I can never forget that my
scripting might just be plain wrong, but so far my incremental method
hasn’t worked sufficiently well, in the sense that if run the app and
choose to walk in an exact straight line, I can compare a single
measure of distance from the starting point with my integral approach.
So far the result is not even close. As you say, intensive Internet
searches are called for.


I'm pretty sure that the data you are getting is precisely what all 
other apps will get - we are just returning the location data as 
provided by CoreLocation. The difference will be the analysis which 
these apps are doing on the data to derive an accurate assessment of the 
route taken I'd imagine. Indeed, it could be they also take into account 
other senses (compass and accelerometer) to help - but I don't know that 
for sure.


There are two functions which might help you with your endeavour:

  mobileSetLocationHistoryLimit
  mobileGetLocationHistory()

The details are in the docs, but basically the engine can collect and 
keep a list of locations which you can collect periodically.


I suspect the way to think about this is not to think about it as an 
incremental thing at all as any outliers will completely destroy the 
accuracy. Instead imagine it as a 'curve-fitting' exercise (piece-wise 
linear approximation is probably sufficient!) - i.e. taking sets of 
(slightly) overlapping samples and derive a 'best-guess' path which fits 
the data.


It is likely that some cleaning of the data would be needed first to 
eliminate outliers also. e.g. You can compute speed needed to get 
between individual points, if any given point is outside of a reasonable 
range of 'current' speed with approximated acceleration/deceleration 
taken into account then it should be discarded.


Doing a google search for "deriving a approximate path from gps data" 
turns up quite a lot of literature on the subject, so this is definitely 
something which has/is studied in depth...


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Can a stack know which standalone engine it's running on?

2020-04-27 Thread Mark Waddingham via use-livecode

On 2020-04-27 23:08, Devin Asay via use-livecode wrote:

But doesn’t the processor just report on the host operating system? I
wan’t to know which LiveCode engine is running.


No 'the processor' reports what architecture the engine was built for. 
From the dictionary:



Use the processor function to determine the system architecture. The 
system architecture may either be emulated or the architecture of the 
host CPU. For example, when running the application in an android 
emulator the processor will return the emulated architecture rather than 
the architecture of the host CPU.


Note: Some operating systems have emulators built in. For example, 
Windows has WOW64 which allows x86 executables to run under x86_64 
versions of Windows.



Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Can a stack know which standalone engine it's running on?

2020-04-27 Thread Mark Waddingham via use-livecode
The version almost uniquely identifies every public engine build - the 
buildNumber always does.

The platform together with the processor uniquely identify the target it was 
built for.

Warmest Regards,

Mark.

Sent from my iPhone

> On 27 Apr 2020, at 22:43, Devin Asay via use-livecode 
>  wrote:
> 
> The subject line says it. Is there a way for my stack to know which Windows 
> standalone engine it is running on? For diagnostic purposes I would like to 
> be able to report the current LiveCode standalone engine. I’m probably 
> missing something obvious.
> 
> Devin
> 
> Devin Asay
> Director
> Office of Digital Humanities
> Brigham Young University
> 
> ___
> 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 to make a mobile app stay alive in the background?

2020-04-27 Thread Mark Waddingham via use-livecode

On 2020-04-27 07:25, J. Landman Gay via use-livecode wrote:

On 4/26/20 4:43 PM, Graham Samuel via use-livecode wrote:
I notice in the Standalone Settings for iOS in LC 9.5.1, a button 
‘Background Execution’. If I click it, I get a warning that I don’t 
really understand which suggests that LC doesn’t officially support 
the feature. I’m not even sure if this feature is what I need.


Basically you have to save the user state repeatedly whenever anything
significant changes, in case the app goes dormant.


You actually need to do this regardless of having suspend/resume 
messages as there's no guarantee that (1) you will get them and (2) you 
will be able to execute them long enough to save all current state.


Both mergBgTask and mergNotify provide features to enable managing the 
background task feature of iOS, and the suspend/resume notifications 
though.


Warmest Regards

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: What is a real?

2020-04-25 Thread Mark Waddingham via use-livecode
The ‘is strictly’ operators allow you to detect what the actual internal 
storage type of a value is. Some things generate numbers which are stored as 
int32s but most will store them as doubles - arithmetic operators included.

I don’t know what the docs say about ‘is strictly an integer’ but the operators 
themselves are definitely doing as they should so the docs might need some 
refinement :)

Mark

P.S. The ‘is strictly’ operators were not really added for general use as they 
are tied to internal mechanisms. They were added to help with doing faithful 
export of values (lcVCS way back IIRC).

Sent from my iPhone

> On 25 Apr 2020, at 17:44, Brian Milby via use-livecode 
>  wrote:
> 
> In your initial example, they are all strings.  1.1+0 would be strictly a 
> real.  What is troubling is that I’m seeing that 1+200 is not strictly an 
> integer yet the docs say it should be.
> 
> Thanks,
> Brian
>> On Apr 25, 2020, 12:06 PM -0400, Mark Wieder via use-livecode 
>> , wrote:
>>> On 4/25/20 7:40 AM, Bob Sneidar via use-livecode wrote:
>>> Apparently nothing is a real. Neither is anything strictly a real.
>>> 
>>> put 1 is strictly a real — false
>>> put 1.1 is strictly a real — false
>>> put 1.1 is a real — compilation error
>> 
>> If it helps any (hint: it doesn't) it's the currency of Brazil.
>> You're welcome.
>> 
>> --
>> 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


___
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: Mobile text input mystery

2020-04-22 Thread Mark Waddingham via use-livecode

On 2020-04-22 17:00, Graham Samuel via use-livecode wrote:

As usual, the problem will be my fault, but I can’t get a mobile input
field to appear on a card. I’m debugging it at present, which explains
the answer statement:

on opencard -- we dynamically create a field for the user to key in
 global sinputID -- this is all from the LC lesson. It’s a global
because I need to refer to it in a button later
 if environment() = "mobile" then
 mobileControlCreate "input", "FMyText" -- so the user can type 
in

 put the result into sinputID — the Dictionary doesn’t mention
‘the result’ but it does seem to be right
 answer "opening text field for input. ID created is:" && 
sinputID

mobileControlSet sinputID, "rect", “114,135,163,158” — this is
a real location on the card
mobileControlSet sinputID, "visible", "true"
mobileControlSet sinputID, "opaque", "true"
  end if
end opencard


I'm pretty sure if you give your mobileControl a name (FMyText) in this 
case, then that is the only way you can refer to it. You can only use 
'the result' of the Create function *if* you didn't give it a name.


So you need to do either:

  mobileControlCreate "input", "FMyText"
  mobileControlSet "FMyText", ...

OR

  mobileControlCreate "input"
  put the result into sinputID
  mobileControlSet sinputID, ...

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Keyhole effect?

2020-04-15 Thread Mark Waddingham via use-livecode

On 2020-04-15 02:30, Richard Gaskin via use-livecode wrote:

Monte Goulding wrote:


If I understand what you want correctly then:

Create image
Create mask object
Group both
Set the ink of the mask object to blendDstIn
Set the ink of the group to blendSrcOver


Super, Monte. That works well.

I was up late with a tool I'd made to let me walk through all sorts of
combinations, but I hadn't thought to group them.


Oh look, clearly the 'useful' inks haven't really been removed - they've 
just been replaced with the modern equivalents which give much better 
fidelity results ;)


Just to explain why the group is necessary - if a group has the 
'blendSrcOver' ink applied then it becomes a 'transparency group'.


This means it has its own alpha channel which can be affected by the 
'destination alpha modifying' porter-duff operations. So in this case:


  1) The group is a transparency group so allocates its own transparent 
buffer

  2) The image is composited into the buffer
  3) The mask is then composited into the buffer with the DstIn ink. 
This means that the destination buffer alpha is adjusted so it is only 
'in' the mask (an analog of ANDing the buffers alpha channel with the 
mask's alpha channel - indeed, previously I'm guessing you would have 
done this using some sort of AND bitwise ink and being careful with 
colors used).

  4) The buffer is then composited with the background.

The transparency group thing is needed partly for efficiency and partly 
because you can't remove alpha from an opaque destination - which a 
window provides.


Hope this helps!

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Go to card has become slow

2020-04-13 Thread Mark Waddingham via use-livecode

On 2020-04-13 07:06, Trevor DeVore via use-livecode wrote:

Will this caching of the DPI setting affect accessing the styledtext
property in general on Windows or will it only affect calls to it 
during

saves?


I did a quick test:

  - 'the styledText of' is unaffected

  - 'the effective styledText if' is about 25% faster

This was using the sample text on card 1 of Neville's test data stack - 
each fetched 1000 times.


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Go to card has become slow

2020-04-12 Thread Mark Waddingham via use-livecode

On 2020-04-13 02:23, Neville Smythe via use-livecode wrote:

But no, it shaved only 1 second off a 7 second save for styled text
(elderly MacPro running Windows 10 VM) So your engine modifications
must be having a much wider effect, not just on reducing the 3 API
calls for styled as opposed to plain text ??


Each paragraph has at least one style run - even if no styles are 
applied so this is a general thing.


Most of the text in your generated test (data) stack was unstyled anyway 
(as it uses 'the text of' to replicate the data) so minimizing those API 
calls should affect all stacks with a reasonable amount of field data in 
them.


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Video format for mobile

2020-04-12 Thread Mark Waddingham via use-livecode

On 2020-04-10 21:39, J. Landman Gay via use-livecode wrote:

@Mark is there a bug number for this? I couldn't find anything.


Not specifically as yet I don't think - Monte noticed some issues late 
last week, and is the progress of fixing them. I've asked him to chime 
in when he's back to work :)


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: What is a token

2020-04-12 Thread Mark Waddingham via use-livecode

On 2020-04-11 22:22, Bob Sneidar via use-livecode wrote:

So the question is, should I submit this as a bug, or no?


No you shouldn't as it isn't a bug :)

The 'token' chunk is a wrapper around the internal routine the engine 
uses to divide a script text up into tokens which are then parsed. This 
routine also does the 'skipping' over of whitespace and comments. As 
'/*' is part of a comment it is ignored, just like any spaces in between 
actual tokens.


For example:

   put token 2 of "/* this is a comment */ put x into y"

Will put 'x' because the only 'tokens' in that string are 'put', 'x', 
'into' and 'y'.


If you want to see if a line starts with a multi-line comment then you 
should do:


  if word 1 of tLine begins with "/*" then ...

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Go to card has become slow

2020-04-11 Thread Mark Waddingham via use-livecode

On 2020-04-11 16:41, Mark Waddingham via use-livecode wrote:

Anyway, the patches I've made are quite rough at the moment, but I'll
endeavour to submit them as PRs in the next few days :)


I've pushed a WIP PR with the changes I made to get the results 
mentioned in my last email - it is here for anyone who is interested in 
such things:


<https://github.com/livecode/livecode/pull/7319>

The thing which makes the biggest difference is definitely the caching 
of the system metrics used (the first commit in that patch) - with that 
removed and just the write buffer you get what you'd expect - it takes 
9s (rather than 10s).


I'm always highly dubious about rushing anything to do with I/O of any 
sort - so the write buffer might not appear in a build for a while.


The caching of system metrics though should be absolutely fine once I've 
hooked it up to the system message which gets sent when they change - so 
that will hopefully appear much sooner.


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Go to card has become slow

2020-04-11 Thread Mark Waddingham via use-livecode

On 2020-04-11 13:54, Neville Smythe via use-livecode wrote:

Sorry Brian, I uploaded from the wrong folder. Here is the update test
set. But the only difference is that you don’t need to hold down the
shift key to see the binary save timing.

https://www.dropbox.com/sh/cb2r9jbohxqv6bp/AAAQ1weLLlzrKYQ21yn1apf9a?dl=0


Colin, the test set here shows the timing of saving of stacks; the
times for Windows 10 are a large multiple of Mac/Unix and we
discussing possible reasons before updating the bug report  bug 21305
  for Quality
Control


So I also had a look at this today - using Visual Studio's builtin CPU 
profiling diagnostic when running the engine in release mode.


There appear to be two reasons for the difference:

  1) When saving each style run (block) in a field the engine is making 
three Win32 API calls.


  2) The saving method uses (and always has used) direct Win32 system 
calls to manipulate files without any buffering (on other platforms we 
wrap the standard C library stdio FILE which has its own buffer).


I tested your very neat little stack with 1323 cards (about 36Mb of 
data).


On my machine with the engine as it is it takes:

  - Windows 10 (VM) [ Community 'develop' ] - 10s

  - macOS Catalina (Native) [ Business 9.5.0 ] - 0.45s

After doing a hacky patch to the sites using the Win32 API calls (i.e. 
caching the results and only calling them once) I got:


  - Windows 10 (VM) [ Community 'develop' ] - 1.8s

After adding a very simple write buffer to the Win32 implementation of 
the system file stream class we have. I got:


  - Windows 10 (VM) [ Community 'develop' ] - 0.4s

Anyway, the patches I've made are quite rough at the moment, but I'll 
endeavour to submit them as PRs in the next few days :)


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Video format for mobile

2020-04-09 Thread Mark Waddingham via use-livecode
This sounds like a bug we are currently fixing (hopefully in time for 9.6-DP-4) 
- the android player doesn’t currently play nicely with accelerated 
rendering... Turning that off should mean things play properly.

We use the system player object so MP4 should be fine.

Warmest Regards,

Mark.

Sent from my iPhone

> On 9 Apr 2020, at 20:31, J. Landman Gay via use-livecode 
>  wrote:
> 
> I tried the browser widget: no audio, no video, white screen, no browser 
> outline on Android.
> 
> I tried a mobile browser (mobileControlCreate): audio plays, no video, white 
> screen.
> 
> So yeah, it looks like there's no codec. The widget on desktop doesn't play 
> it either. If I ask the client to re-do the videos, what codec should I ask 
> for? I was told that we had to use their existing videos, so I'm not even 
> sure they will re-do them.
> 
>> On 4/9/20 1:01 PM, Tom Glod via use-livecode wrote:
>>  I'm sorry to be the bearer of bad news here.  :(
>> if its h264 the browser widget won't play it. If you saw video but no audio
>> then thats one thing.but no video means the video codec is also absent.
>>> On Thu, Apr 9, 2020 at 1:57 PM J. Landman Gay via use-livecode <
>>> use-livecode@lists.runrev.com> wrote:
>>> They're kind of huge (like 400 MB) so I didn't copy them to my phone, but
>>> they play okay on Mac
>>> using Firefox and on Android using Chrome browser. I guess that doesn't
>>> tell us much.
>>> 
>>> Swami suggested to me privately that he uses a browser widget to play
>>> videos so I will try that
>>> next.
>>> 
>>> On 4/9/20 9:20 AM, Mark Talluto via use-livecode wrote:
 What happens if you play the file locally on each device?
 
 -Mark
 
 On Wed, Apr 8, 2020 at 10:22 PM J. Landman Gay via use-livecode <
 use-livecode@lists.runrev.com> wrote:
 
> Not sure what you mean by "an existing app" but my test app uses
> mobileControlCreate to set up
> a mobile player. When it accesses the video from my server, it's all
>>> black
> with no video or
> audio, and the nonexistent playback quits a few seconds in.
> 
> I'm not sure whether these videos were created with streaming in mind. I
> vaguely remember we
> used to need to set a "streaming" checkbox when creating a video. Is
>>> that
> still required?
> 
>>> --
>>> 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
 
>>> 
>>> 
>>> --
>>> 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
>>> 
> 
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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


Re: Go to card has become slow

2020-04-03 Thread Mark Waddingham via use-livecode

On 2020-04-03 09:25, Terence Heaford via use-livecode wrote:

Fortunately I have Time Machine running on my mac.

I have gone back to a previous copy from the 01 April 2020 and this
project is running at full speed.

I have made no modifications to the underlying functionality of this
project other than some modifications to SQLite
scripts to improve performance.

I will make those adjustments again and report on the outcome.

I do not believe it’s anything I have done.


I'd humbly  suggest that modifications to SQLite scripts constitute 
modifications ;)


Have you modified the SQLite database in any way?

Like most db's SQLite is heavily dependent on indices to prevent 
operations being slow - if some have been removed which existing queries 
relied upon, or one hasn't been added to support a new/modified query 
then that could cause a heavy performance loss.


Similarly, SQLite is transactional, so if you do lots of mutation 
queries outside of one each individual query will take a lot longer (as 
each will be under its own transaction requiring a OS disk flush/sync 
after each) - if you've tweaked how you are doing such queries and not 
taken into account transactions that could also cause a heavy 
performance loss.


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: specialFolderPath, Microsoft Window, and 64 bits

2020-03-31 Thread Mark Waddingham via use-livecode

On 2020-03-31 18:13, Trevor DeVore via use-livecode wrote:

I had a similar situation recently where I needed to get some DPI
information about the monitors that wasn't available through my LC main
application. I ended up writing a simple command line tool in Visual 
Studio
that used the Windows APIs and returned the proper information. I 
included
that exe with my app and called it from within LC. In your case you 
would

create a 64-bit command line app and I'm guessing you could find sample
code for such a common API call.


Another thought occurs (along these lines)... I'm pretty sure if you run 
shell commands on windows then the program files are present as env vars 
(at least for the shell's bitness). So it might be possible to run the 
32-bit cmd.exe from shell() and give it a bat script which echos out the 
relevant var?


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: specialFolderPath, Microsoft Window, and 64 bits

2020-03-31 Thread Mark Waddingham via use-livecode

On 2020-03-31 17:07, Paul Dupuis via use-livecode wrote:

On 3/31/2020 8:37 AM, Paul Dupuis via use-livecode wrote:
Under LiveCode 9.x.x (up to 9.6.0dp3) I can see no way to obtain the 
64bit application installation folder using SpecialFolderPath? Does 
anyone know if this is correct or am I missing something?


So answering my own question, as of LC9.6.0dp3 here are all the
Windows paths for any given CSIDL number between 0 and 255). None
return the 64-bit applications folder path. I will file an enhancement
request.


Is your app running as 32-bit?

Just to note (looking at the MSDN reference you mentioned):

FOLDERID_ProgramFilesX64
This value is not supported on 32-bit operating systems. It also is not 
supported for 32-bit applications running on 64-bit operating systems. 
Attempting to use FOLDERID_ProgramFilesX64 in either situation results 
in an error. See Remarks for more information.


So even if we did move to FOLDERIDs it wouldn't make much difference if 
the app is 32-bit as 32-bit apps won't return 64-bit related OS paths 
(it seems).


If the app is running as 64-bit then I think the relevant CSIDLs return 
the right thing?


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Determining a scroll based on code unit offsets

2020-03-27 Thread Mark Waddingham via use-livecode
Maybe (the formattedHeight of codeunit 1 to OFFSET of FIELD - the 
formattedHeight of codeunit OFFSET of FIELD)?

Sent from my iPhone

> On 27 Mar 2020, at 17:59, J. Landman Gay via use-livecode 
>  wrote:
> 
> In our last episode, our heroine was trapped by the selection of a line 
> containing metadata. The heroes of this group saved her. In all cases, 
> scrolling the field was accomplished by using the "select" command to bring 
> the line into view.
> 
> Alas, escape from one danger has led to another. The field itself must be 
> inside an enclosing group so that it will scroll smoothly on mobile. She 
> needs to translate the data from codeunits to a scroll position in order to 
> set the group's scroll rather than the field scroll.
> 
> Each line of the data looks something like this:
> 
> 1,103,7
> 
> While 7 is a line number, multiplying that by the textheight doesn't give 
> consistent results due to line wrap. The first two items are codeunit offsets 
> but there doesn't seem to be a way to translate those into pixel positions.
> 
> Our heroine is once again in distress, though as mentioned here, some of that 
> may be due to the inability to reach the keyboard from 6 feet away, which 
> presents its own positioning problems.
> 
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
> 
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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


Re: Getting HTML5 going

2020-03-26 Thread Mark Waddingham via use-livecode

On 2020-03-25 21:07, Mark Waddingham via use-livecode wrote:

I will make a note to double-check the macOS AppStore rules in the
next day or so (this is assuming you are thinking about macOS AppStore
submission), but from memory they are very much aligned with the iOS
AppStore ones in this regard (so my previous posts comments apply
there too).


The relevant macOS AppStore guideline is this:

2.5.2. Apps should be self-contained in their bundles, and may not read 
or write data outside the designated container area, nor may they 
download, install, or execute code which introduces or changes features 
or functionality of the app, including other apps.


So this is less restrictive of the form of executable code which can 
downloaded compared to iOS; but the same in terms of what such downloads 
are allowed to do.


Basically:

If you are producing Desktop software and *not* interested in submitting 
to the macOS AppStore then you can do whatever you want - i.e. you are 
free to live update your app whenever you want by downloading updated 
stackfiles which can do whatever you want them to do.


If you are producing Desktop software and *do* want to submit to the 
macOS AppStore then you can still download live updates, but you need to 
be wary of what those updates are doing as mentioned in my previously 
post.


There is a tendency, I think, to vastly overthink this.

The reality is that you lose nothing by being slightly restricted in 
terms of what live updates are allowed to do in an AppStore context!


Part of the point of AppStores is to make it easier for users to find, 
install and keep their apps up to date. From a user perspective, 
updating an app is as easy as clicking a button when they are told there 
is an update and a little while later they will have an updated app.


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Unicode mysteries

2020-03-26 Thread Mark Waddingham via use-livecode

On 2020-03-26 06:53, Neville Smythe via use-livecode wrote:

Which should correspond to codepoints
   1F3F4 E0067 E0062 E0073 E0063 E0074 E007F
And indeed if I manually build a UTF-16 string with these code points
it does display as the flag of Scotland. So the lesson is that the
reported chunks are not to be naively trusted  --- tho not exactly a
bug given the documentation warning.


Well this would be a bug! If you try codepoint 1..14 - then you will see 
that they alternate between a codepoint and zero - the codepoints appear 
to correspond to the relevant surrogate pair codeunits. i.e. codepoint 
is misinterpreting the index as a codeunit index, rather than a 
codepoint index :|


If you file a bug then I suspect this can be fixed quite quickly (famous 
last words of course!).



Another question (which I think has been raised before but I don’t
think there was an answer?). When a character (codepoint) in a string
is displayed, if the requested font does not have that codepoint the
OS substitutes a glyph from another font (or the missing character
glyph if no font supports the codepoint). So for example if you change
the font of the above flag of Scotland to Arial, it still displays as
the flag of Scotland, even though this glyph is not in Arial. LC will
still report that the font of this character is Arial: from what I can
gather this is not the fault of LC, the OS is doing this substitution
behind its back (TextEdit does the same). But is there any way to find
out (programatically) the actual font being used?


Unfortunately not easily - fallback mechanisms of this sort occur quite 
low down in the text layout / rendering code. What do you need to know 
what font is actually being used for?


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Getting HTML5 going

2020-03-25 Thread Mark Waddingham via use-livecode

On 2020-03-25 20:52, William Prothero via use-livecode wrote:

But, what I really would need to verify before I go that way, is
whether Catalina allows livecode script to be downloaded and executed
by the engine. Richard, it looks like you say it will, but Sean says
no.


Catalina in general does not restrict the ability for a desktop app to 
download and run LiveCode script.


I will make a note to double-check the macOS AppStore rules in the next 
day or so (this is assuming you are thinking about macOS AppStore 
submission), but from memory they are very much aligned with the iOS 
AppStore ones in this regard (so my previous posts comments apply there 
too).


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Getting HTML5 going

2020-03-25 Thread Mark Waddingham via use-livecode

On 2020-03-25 19:31, Pi Digital via use-livecode wrote:

In an app on the AppStore this is definitely a security risk from
Apple’s point of view. Devs could insert any nefarious code into their
app. This has been true from iOS2.  Only content like video and
images, maybe some animation data and so on is deemed ok and
encouraged.


This was once very much the case for the iOS AppStore - as those of you 
who were with us around 2010/11 will probably remember...


However now it isn't any longer true (I did post relatively recent about 
the most recent app store agreements for both Google and Apple but I 
couldn't find it when searching just now).


Essentially both Google and Apple's restrictions on what you can do in 
terms of downloadable code are essentially the same these days in both.


Obviously both explicitly disallow any sort or malware or nefarious code 
of *any* sort.


However, you are allowed to download code which runs in some sort of 
interpreter - i.e. the binary/text being downloaded which you are going 
to run is not in any way related to the actual instructions which run on 
the local CPU (so classic interpreters are fine, as are JITs - 
downloading machine code blobs is not).


However there are two rules which must be followed:

  1) Downloaded code must not allow the app to access any more system 
provided APIs that it could before.


  2) Downloaded code must not allow the app to 'morph' (as Richard put 
it) into something even slightly unrelated to what it was at the point 
of review; nor should it add significantly different features 
(particularly in terms of UI).


In practice conforming to (1) is easy - you aren't allowed to download 
LCB extensions, loading them at runtime, which use FFI to access system 
functions.


Conforming to (2) might sound like it is too fuzzy to really know what 
you are allowed to do, but it isn't really. It is one of those cases 
where if you really have to ask yourself whether the bit of script or 
stack you want to download might be seen as extending the app 
significantly or morphing the app into something other than what it was 
when it was reviewed - then it probably is!


Some examples:

Additional game levels (which often have 'code' in them of some sort) in 
the spirit of those already offered are fine; 'levels' which turn s 
puzzle game into a first-person shooter probably are not; adding a 
level-editor to your game probably would not be.


Additional music-related interactive content in a sheet music related 
app would be fine; interactive recipe-related interactive content being 
downloaded into a sheet music related app would probably not be fine; 
adding the ability for a user to add and share comments with others on 
the original content probably would not be.


Replacement business rules required to provide new and updated tax rules 
in an accounting app would be fine; a module which turns an accounting 
app into a point-of-sale system would probably not be fine.


These two rules are there for very different reasons.

Rule (1) is there so both Google and Apple 'know' the surface area of 
attack on their OSes will not increase. Its important to remember that 
OSes have bugs too, and bugs sometimes enable exploits - these always 
come about due to bugs in system APIs enabling something to be done 
which shouldn't be allowed.


Rule (2) is there for more social/business/marketing reasons - they 
don't want consumers duped, they want to have some idea of what the app 
is meant to be and they want to try to (at least minimally) provide a 
reasonably cohesive 'store' environment.


At the end of the day, these two rules are really easy to keep within. 
If you need to make substantial functional changes to your app then you 
need to get it re-reviewed, but if you are merely extending what was 
already there before in any sort of 'reasonable' way (particularly by 
providing extra content incremental to what was there) then you will 
have no problem at all.


Hope this helps!

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: IMAP Search skipping results

2020-03-23 Thread Mark Waddingham via use-livecode

On 2020-03-23 18:02, Bob Sneidar via use-livecode wrote:

Ahh hah hah! That’s funny. I can’t even write a snippet without
debugging it! :-)


Debugging is just a means to discover the assumptions you made which 
were invalid! ;)


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: IMAP Search skipping results

2020-03-23 Thread Mark Waddingham via use-livecode

On 2020-03-23 17:49, Pi Digital via use-livecode wrote:

Hey, are you insinuating my code is flawed!?! :-o
The cheek of it! ;)


Lol - well we all write flawed code from time to time...

More often though we write code which is perfect but based on 
assumptions we didn't realize could be invalid (that's usually much 
harder to discern!)


Anyway, something here is bugging me - I do wonder if it is the manner 
in which cURL (via tsNet) is being used (in this instance) is actually 
causing the bug to manifest. IMAP is a session-based protocol, so unless 
cURL does something magic with its 'custom URL' support (which is how 
cURL implements IMAP), I'm puzzled how issuing two separate URL requests 
can actually work (unless it isn't actually meant to, but just seems 
to).


I'll experiment later on before I finish for the day.

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: IMAP Search skipping results

2020-03-23 Thread Mark Waddingham via use-livecode

On 2020-03-23 17:14, Pi Digital via use-livecode wrote:

Finding the first unseen UID though seems to be the next issue I’m
going to have to overcome. A never ending stream of workarounds.


Well, unfortunately, this is a bug in cURL as far as we can see - its 
been there for 6 years and no-one has fixed it.


This is kind of surprising as cURL is generally a very well supported 
and widely used open-source library (that being said, we should probably 
take note of the whole OpenSSL Heartbleed issue a while back...)


Given that cURL is used in a lot of places, by a lot of products, that 
suggests that either


  (a) no-one uses cURL IMAP very much so there isn't any interest in 
fixing it


*or*

  (b) fixing that bug doesn't actually solve the problem (it just shifts 
it). i.e. The bug makes quick-and-dirty approaches to certain tasks 
fail; but when people come across it they realize that if they don't do 
things 'en-masse' (which is basically what the IMAP RFC suggests you 
shouldn't) then it doesn't have an effect.


Of course, I'm hypothesizing here: (a) could be the reason as much as 
(b).


I'd perhaps suggest that something isn't a workaround if the original 
approach was flawed (however irksome the more code it requires might 
be!) ;)


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: IMAP Search skipping results

2020-03-23 Thread Mark Waddingham via use-livecode

On 2020-03-23 15:21, Pi Digital via use-livecode wrote:

Thanks Mark, your input here is appreciated.

This reply in that forum wasn’t helpful, was it


> Known bug #90 was reported in 2014. However it still occurs in 2019. Does
> anybody know how to overcome this situation?

Yes: by fixing the code!


In the thread it talks of pagination (as do you) but doesn’t give an
example of how to do it. How would we implement this in LC? If it is
not giving us the correct count how do we know how many pages we will
have to allow for and so on.


That's where I got the reference to pagination from - as I said it's not 
a particularly useful post there. I suspect the person replying assumed 
the person asking the question had a detailed understanding of IMAP 
queries (my knowledge of interacting with IMAP servers is more than it 
was earlier on, but still not really sufficient to give any detailed 
advice).


The tsNet support for IMAP comes entirely from cURL - so it works pretty 
much the same as the 'curl' shell command.


I found this with a quick search which might help:

  

The queries listed there at least appear to give ways to query the count 
of things in a mailbox.


This page also looks like it might be helpful:

  

Also this has some more info on using CURL to talk to IMAP:

  



Having pondered this a bit, I'm not sure that even if cURL guys fixed 
the above bug it would actually make a difference to what you need to do 
to have 100% correct code. The method of fetching all UIDs of messages 
in a mailbox at once is completely unscalable - imagine an INBOX with 
100,000s of messages for example over a slow/flaky connection; or an 
INBOX which has a lot of traffic and changes exceptionally frequently; 
or sits on a heavily loaded server (you can imagine that no server would 
like to be polled for complete message lists all the time by lots of 
clients).


The IMAP protocol appears to be designed to be treated as something to 
use to synchronize local and remote state. Indeed, there is quite an 
extensive description of how to 'synchronize with an IMAP server' in an 
RFC:


  

Indeed, it states in one place:


  The following is an example of the first FETCH:

   C: A011 UID fetch 131:* (FLAGS BODYSTRUCTURE INTERNALDATE
   RFC822.SIZE)

   Note 1: The first FETCH may result in the server's sending a huge
   volume of data.  A smart disconnected client should use message
   ranges (see also Section 3.2.1.2 of [RFC2683]), so that the user is
   able to execute a different operation between fetching information
   for a group of new messages.


The unique id used to perform the sync operation is the UID; you can 
fetch ranges of those as they are 'guaranteed' to always increase and 
never be re-used. (The only caveat is the UIDVALIDITY, which is 
basically a cache-generation number - i.e. if the UIDVALIDITY changes 
you have to dump your local cache and start from scratch as it means the 
meaning of individual UIDs has changed).


Not sure how much the above helps...

Warmest Regards,

Mark.

P.S. I've been chatting to Seb about the issue (he reported the bug 
originally) - he has confirmed that the problem affects Kognition's IMAP 
code too (that component is still in development at this stage which is 
why it hadn't been noticed until I asked him to check). I had hoped the 
approach there might have been slightly different and so provided a 
viable workaround, but it would appear that it is not the case :(


--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: IMAP Search skipping results

2020-03-23 Thread Mark Waddingham via use-livecode

On 2020-03-23 11:39, Pi Digital via use-livecode wrote:

No, same thing unfortunately. Even ALL has the issue. According to an
old bug report that has sat for an age untouched it is a known issue
in the ood curl lib they are using. At the rate they are currently
dealing with bugs for fundamental operations we might see a fix in
about a year or two (or four). [dig]


In this case the bug is in CURL - it is 'known bug #90':



There's a few threads around about it - this is the most recent I could 
find:


https://curl.haxx.se/mail/archive-2019-07/0029.html

The only real suggestion (although it is vague) there is using some for 
of pagination (as the UIDs should be eternal, rather than related to the 
position in the mailbox requested).


I couldn't find any explicit bug in their bug tracker which is still 
open for this, but its still listed as a known issue so it sounds like 
there has been no change in it unforunately :(


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: [ANN] Release 9.6.0 DP-3

2020-03-22 Thread Mark Waddingham via use-livecode
Oops sorry - that’s my fault - it should have said Xcode 11.3.x

Mark.

Sent from my iPhone

> On 22 Mar 2020, at 13:53, Sannyasin Brahmanathaswami via use-livecode 
>  wrote:
> 
> FWIW
> 
> Xcode 11.3 not easily available on Apple site,
> 
> I tried with Xcode 11.3.1.
> 
> Everything “appears”  fine, at least for now….
> 
> 
> BR
> 
> iOS Support
>  - Building with Xcode 11.3 using the iOS 13.2 SDK is now supported
> ___
> 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: Guessing the encoding of a test file...

2020-03-22 Thread Mark Waddingham via use-livecode

On 2020-03-21 14:09, Paul Dupuis via use-livecode wrote:

So far the only person who has read my post and replied with what I
was looking for was Peter - and although the routine was written in
Rebol rather than LiveCode, he kindly provided a link to information
about it.


It might have got lost in amongst other replies but I did suggest:



It even comes with a command-line script (chardetect) which would allow 
to compare your detector with that one.


However, on further digging it appears that this does not (as it stands) 
detect MacRoman which is obviously a key requirement here.


There is a stale PR for that though 
 so the method used here is 
obviously possible to extend to that.


From what I have read the Python one is a python reimplementation of 
Mozilla's 'Universal Charset Detector' which, from what I have read, 
is/was pretty much state of the art - reading through the chardet docs 
(https://chardet.readthedocs.io/en/latest/how-it-works.html#single-byte-encodings 
is perhaps the most pertinent) it sounds like its single-byte detectors 
use 2-byte sequences to try and distinguish.


There is a special case for Latin-1 (1252) which is needed because 
English text looks the same in a large number of encodings - this works 
by looking for curly quotes and other special symbols by the look of it. 
(The MacRoman addition in the stale PR above, is also a Latin-1 like 
special-case - which makes sense as Latin-1 and MacRoman are almost just 
permutations of each other).


My general feeling is that if you already have a process which works to 
detect the differences between MacRoman and Latin-1, then it is likely 
largely equivalent to any other means which exists (the accepted answer 
here 
 
sounds like it pretty much sums up the situation!) so beyond fixing the 
bug(s) you found recently, you might find that there is nothing more you 
can do.


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Guessing the encoding of a test file...

2020-03-20 Thread Mark Waddingham via use-livecode

On 2020-03-20 15:34, Paul Dupuis via use-livecode wrote:

Why did I ask this? Because I am interested in comparing the accuracy
of our current handler to any other that may be available as, users
being users, we recently have a user reveal a bug (mis named variable)
in our current function that meant it was missing certain edge cases (
and this user has hundreds of text files that need this edge case to
be properly recognized as MAcRoman encoding. So that bug has been
fixed, but I am still interested in comparing any other giessEncoding
routines to our current one to see if we can do better that we current
are.


Perhaps:

https://pypi.org/project/chardet/

Sounds like it uses similar statistical (perhaps even an ML) model to 
detect charsets as Mozilla's 'UCD' (as mentioned by someone else in this 
thread).



As always, thank for reading and responding Mark. We're actually doing
what you suggest. We had a set of QA test cases (text files in many
different line endings and encodings), some intended to fail (such as
Windows Code Page's we don't support). We're expanding these and doing
a review on macOS and Windows with our app. Ones that fail, that we
think shouldn't fail, we will step through the code to see why they
fail and if our algorithm can be further enhanced. I can's foresee any
algorithm tweaks we can't code ourselves that we'd need LC or USE-LIST
assistance for.


My main reason for asking was to see if it seemed a reasonable 
assumption (to me, at least) that there would be any algorithm which 
would be able to determine the char encoding correctly. e.g. MacRoman 
and Windows-1252, are very very similar, and so telling the difference 
would come with a reasonably high degree of error.



Back around LiveCode 7, Fraiser said, in response to some
correspondence I had with him, that he would consider creating a
"guessEncoding" to go along with the Unicode Everywhere work and the
new textEncode/textDecode functions. I do understand the reluctance,
as a business, to do so, as inevitably there will be some instances
where it guesses wrong.


I can't recall exactly - but I think Fraser was thinking along the lines 
of being able to tell the difference between the utf-8, utf-16, utf-32 
and native encodings. That can be done with a high-degree of confidence, 
and indeed is straightforward enough to code in LiveCode Script. (e.g. 
You can be almost 100% sure something is utf-8 if it roundtrips 
identically).


As I'm sure you are acutely aware, the difficult problem is telling the 
difference between very dense shift-sequence encodings (those which 
don't have some redundancy in their encodings to help with validation), 
and single-char encodings (e.g. between MacRoman and Latin-1). There is 
no algorithm for that per-se, just lots of heuristics (based on 
statistical models) and potential dictionary lookup to help distinguish 
edge cases. Implementing something such as that is no small endeavour...



I am under the, perhaps false, impression that isoToMac and macToIso
are sort of viewed as functions that may become deprecated and no
longer updated in the future. However, they are still essential for us
until I can textDecode(someData,"MacRoman") on a Windows system and
vice versa.


They've not been deprecated yet so they aren't going anywhere - the 
internal functions those wrap are actually used to charset-swap strings 
in pre-v7 binary stackfiles (from v7, strings are serialized as utf-8 in 
stackfiles).


We probably will deprecate them when we make textDecode/Encode accept 
more encodings (as suggested in the enhancement request) - but only 
because the latter is a much neater way to do things... I believe the 
code you use at the moment gives identical results as textDecode/Encode 
native support would do doesn't it?


Warmest Regards,

Mark

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Guessing the encoding of a test file...

2020-03-20 Thread Mark Waddingham via use-livecode
Rather than throwing ‘the baby out with the bath water’ so to speak... What are 
the precise cases in which the method you have fails? And why do you expect it 
to work in those cases?

Warmest Regards,

Mark

Sent from my iPhone

> On 19 Mar 2020, at 20:32, Paul Dupuis via use-livecode 
>  wrote:
> 
> This has come up many times before, but I'll ask once again in case 
> something has changed or someone new sees this.
> 
> 
> Does anyone have a routine that will take a filespec to a text file and 
> return the guessed encoding of the text file?
> 
> 
> First, please don't respond with your should know the encoding or the users 
> should know the encoding of their files. Not possible in the widely 
> uncontrolled real world.
> 
> I do already have a routine to guess file encodings. It was written by 
> someone else. There are instances where it should work and does not. I fear 
> there may be errors in the algorithm and I do not have the original algorithm 
> to check it against. Hence, I am looking for an alternative that is either 
> free to use or to be licensed for a modest fee.
> 
> My current routine attempts to return the encoding as a string that can be 
> directly passed to textDecode(binaryData,encoding)
> 
> "ASCII"
> "UTF-16"
> "UTF-16BE"
> "UTF-16LE"
> "UTF-32"
> "UTF-32BE"
> "UTF-32LE"
> "UTF-8"
> "CP1252" *
> "MacRoman" *
> 
> * for these last 2, if the file is MacRoman on a Windows system, you actually 
> have to textDecode(macToISO(data),"CP1252") and if you have CP1252 on the 
> Mac, you need to do textDecode(isoToMac(data),"MacRoman"). There is an 
> enhancement request to support MacRoman decoding under WIndows and vice versa 
> at https://quality.livecode.com/show_bug.cgi?id=22391 if you want to CC 
> yourself to show interest.
> 
> 
> ___
> 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


Interruption to LiveCode services

2020-03-16 Thread Mark Waddingham via use-livecode
Hi all,

As some of you will have noticed a number of LiveCode services are currently 
down - notably, the main LiveCode webserver, the forums and bugzilla.

We are currently working to restore these services as quickly as possible.

The mailing list server is currently unaffected it seems so hopefully this 
email will get through!

Warmest Regards,

Mark

Sent from my iPhone

___
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: POST on mobile apps

2020-03-15 Thread Mark Waddingham via use-livecode

On 2020-03-15 05:55, J. Landman Gay via use-livecode wrote:

"Cross-platform note: On iOS and Android, the post command is
implemented in the engine. Therefore the Internet library is not
needed to ensure the command works in a mobile standalone application.
If included, the Internet library implementation will be used instead
of the engine implementation. Note: The Android and iOS engines do not
support 'libUrl' but do allow you to use post in the background."

This seems contradictory. The internet library is not required since
POST is implemented in the engine. But if it's included, it will be
used. But mobile doesn't support it.


I believe that bit of advice might be a little out of date. If you 
include the internet library (and tsNet) then the 'post' command will 
use tsNet.


LibUrl has been an option on mobile since we added socket support, and 
tsNet has a liburl driver which replaces the (script) socket-based 
version of liburl with tsNet's internal operations.


So include libUrl and you get normal libUrl; include libUrl and tsNet 
and you get libUrl driven by tsNet; include neither and you get the 
in-engine implementation.


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Where is Andr? ? Andr? says "goodbye"

2020-03-15 Thread Mark Waddingham via use-livecode

On 2020-03-15 10:29, OLIVER GMAIL via use-livecode wrote:

It s revXMLText (idID) that converts high ASCII characters to HTML
entities, so I don't think file vs binfile will make much difference.


I noticed a similar issue with revXMLPutIntoNode. The forum post is
here: https://forums.livecode.com/viewtopic.php?f=9=33726

Not many answers since February 4 unfortunately...  perhaps the list 
can help?


Something like this should solve the issue (beware of wrapped lines!):

on mouseUp
   local tInitialXML, tXmlId
   put "encoding='UTF-8'?>" into tInitialXML

   put revXMLCreateTree(tInitialXML,false,true,false) into tXmlId
   revXMLPutIntoNode tXmlId, "/identity/name",  textEncode("André", 
"utf-8")
   put revXMLText(tXmlId) into URL 
("binfile:"("desktop")&"myFile.xml")

end mouseUp

You have to create the XML tree with an initial `libxml2 knows what encoding you want - utf-8 will give what the 
use-cases here have requested.


Then, you have to textEncode any text you use as utf-8 before passing it 
to the command/function (usually just content, but also attributes, 
element names or attribute values - if any may contain non-ascii text).


Finally, revXMLText will return an already encoded bit of binary data 
you can put into a file - hence binfile.


Hope this helps!

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Philosophical questions about the fontNames

2020-03-12 Thread Mark Waddingham via use-livecode

On 2020-03-12 17:23, Paul Dupuis via use-livecode wrote:

Yes, it does. Lacking a detailed technical understanding of the
ridiculous complexity of the macOS (or Windows for that matter), is
one reason we used/use HyperCard, SuperCard, MetaCard, Revolution,
LiveCode for the past 25+ years for our app development.

It *SEEMED* like a reasonable attempt at HIG compliance to set the
fonts of our objects to the special names and also *SEEMED* like it
was then reasonable to want to show what font was selected in a menu,
but it is absolutely true that I was assuming that "(Text) became
Segui UI on Windows and Calibri (or whatever) on macOS and NOT
something like .AppleSystemUIFont!


Heh - its been an interesting learning exercise for us both - both 
technically and process-wise :)


I would stress here that this is just a reminder where failing to 
provide an adequate use-case when asking for something, or indeed 
posting a bug report about long-standing behavior which you believe 
should be changed is critically important.


The thing is if you focus on a very specific technical detail as being 
the problem, and describe it as just that it 'robs' the person reading 
of it any context in which to make any sort of judgement from a wider 
point of view and perhaps short-circuit digressions into rabbit holes :)


The main thing is that your code is going to be simpler as a result of 
this!


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Philosophical questions about the fontNames

2020-03-12 Thread Mark Waddingham via use-livecode

On 2020-03-12 15:53, Paul Dupuis via use-livecode wrote:

So here is the simple use-case I ran into. We have a field with an
editor toolbar for rich content editing in an app. The field is set to
(Text) upon start up, as in:

set the textFont of fld "X" to "(Text)"

So that the font is initially in the appropriate default font for the
platform the app is running on. In the toolbar we also have a Font pup
menu with the available fonts listed for the user to change the font
they want in the field. It is the UI standard that such a menu SHOW
the user the currently selected font.

...

If there is a good work-around for this apparent conflict, I'm
definitely open to giving it a try or if I simply missed something
obvious, I'm happy to be educated.


I think the conflict comes from the assumption that having the default 
be '(Text)' (or the font underlying them) is the correct thing to do.


If the field allows user-settable styling (even just font), then I'd 
suggest that it doesn't need to use the 'default system font for the 
platform' and you can just choose a sensible default - i.e. it isn't a 
UI text area from a HIG perspective, it is a user styled text 
area/document area.


As a comparison, TextEdit defaults to Helvetica and WordPad defaults to 
Calibri or Times New Roman (depending on version I think) [ I can't 
remember what Notepad uses on Windows 10, something horrendously ugly 
and bitmap based still, probably! ]


My point of view here is mainly motivated by the following...

A couple of weeks ago (or maybe longer?) Klaus noticed a really strange 
problem with text extraction from a PDF printed using LiveCode on macOS 
- specifically digits did not extract as digits (they looked absolutely 
fine). [ He seemed to get quite hot-under-the-collar-about-it, but they 
may have just been his Germanic enthusiasm ;) ].


Changing the font to Courier or Arial solved the problem - digits could 
be copied as digits again.


It wasn't until I ran an internal tool I wrote for Kognition many moons 
ago on the generated PDF that I figured out what the cause was. The 
effective font of the offending field was '(System)' - this came out in 
the PDF as '.SFNSText'.


(Note: I still don't quite know why it munges digits - my guess is that 
it doesn't have a traditional CMAP table).


This is a font you won't find listed in the fontNames, nor (I don't 
think) In FontBook or anywhere else. It is a seemingly highly 
specialized and custom crafted font designed only for screen display in 
the macOS UI.


Indeed, if I interrogate the NSFont object we get internally when 
requesting the font for (Text), I get '.AppleSystemUIFont' - which is 
similarly not appropriate for what you want.


TL;DR version: Theme fonts '(...)' should only be used for 'fixed' UI 
display - they won't print in the same way and cannot be chosen in the 
same way by name. For text that might be printed, or where the font can 
be chosen by the user, you should choose sensible default fonts similar 
to those of the basic apps for styled text entry on the platform the 
program is running on.


Hope this helps,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Philosophical questions about the fontNames

2020-03-12 Thread Mark Waddingham via use-livecode

On 2020-03-11 22:36, Richard Gaskin via use-livecode wrote:

Querying the fontNames includes:

(Default)
(Styled Text)
(Menu)
(Text)
(Message)
(Tooltip)
(System)

These are not font names, but constants the engine accepts so that we
can have good-looking, HIG-savvy UIs on multiple platforms.

But they're not font names.  They're not fonts at all.  They're engine
directives.

So should they be included in the fontNames?

(Yes, I know I can exclude them. I've been doing this a while, I can
do lots of things.  But if a newcomer wants to make a Fonts menu or
list she also needs to know the filter command, and why she needs to
use it to filter out things that aren't fonts. #learnability)


Haha - I noticed that at the top of Richmond's screenshot on the forums 
and I had the same thought... I also had a sneaky suspicion you would 
also comment on it!


I am inclined to agree with you - those font names are added explicitly 
after fetching the list of font names from the system - so there isn't a 
deeply technical reason why they are there.


I'll need to dig back to see if there is any internal discussion about 
it from when the theme support was added. After all, it is useful for 
the IDE to have those in the list, but it is also easy for it to add 
them in its own code!


For all intents and purposes, they should never appear in a 
'user-settable' font list in any non-UI editing type application - so 
the impact of changing it is probably next to zero.


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Philosophical questions about the fontNames

2020-03-12 Thread Mark Waddingham via use-livecode

On 2020-03-11 23:38, Paul Dupuis via use-livecode wrote:

I filled a bug report on this back in February:
https://quality.livecode.com/show_bug.cgi?id=22564

Mark Waddingham declared it was not a bug but a documentation issue,
so I filed and enhancement request:
https://quality.livecode.com/show_bug.cgi?id=22569

Personally, I think the following code SHOULD work:

set the textFont of fld "X" to "(Text)"
put the effective textFont of fld "X"

And return the actual font used for (Text) on the current platform
(for example Segue UI on Windows 10.

My goal was to be able to read somewhere like in the dictionary or
user guide or run some code to find out what the actual font is for
each of the "specials" on Windows and macOS.


To be accurate, your request / report is entirely different from 
Richard's

philosophical question.

You want 'the effective fontName' of a chunk / object to return the 
actual

name of the font which the system is using to render the glyphs - which
would be huge departure from its current (very LC-specific) meaning.

Also I did not declare it a documentation issue (because it is not). My
exact wording was:

"I suspect it is possible to get the names of the actual system-provided
fonts - but there is no facility in LiveCode for this at present. Please
file an enhancement request for this ability."

This is precisely because the mapping is not fixed. Both Windows and 
Linux
allow the user to change the relevant fonts used at the system level, 
and

macOS uses highly-specialized UI fonts for the purpose (as Klaus and I
recently discovered when he was having a problem with text extraction 
from

PDFs printed from LC!).

My current point of view is that this need represents an edge-case, and 
it
is more than likely that changing your approach to whatever it is you 
believe

you need it for means you won't...

So, an important question is here why do you need to know the actual 
font

being used when an object is set to render with one of the meta-(theme)-
fonts?

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: New Apple Developer iOS requirements beginning April 30

2020-03-04 Thread Mark Waddingham via use-livecode
We replaced UIWebView with WKWebView in 9.6-DP-1.

Sent from my iPhone

> On 5 Mar 2020, at 02:11, J. Landman Gay via use-livecode 
>  wrote:
> 
> I got a warning today, building with LC 9.5.1.
> 
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
>> On March 4, 2020 7:14:43 PM Ralph DiMola via use-livecode 
>>  wrote:
>> 
>> UIWebView is being replaced by WKWebView. I think LC uses WKWebView or we
>> would have been getting warnings on submissions since at least last August.
>> 
>> 
>> Ralph DiMola
>> IT Director
>> Evergreen Information Services
>> rdim...@evergreeninfo.net
>> 
>> -Original Message-
>> From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf
>> Of Richard Gaskin via use-livecode
>> Sent: Wednesday, March 04, 2020 7:35 PM
>> To: use-livecode@lists.runrev.com
>> Cc: Richard Gaskin
>> Subject: Re: New Apple Developer iOS requirements beginning April 30
>> 
>> Jacque wrote:
>> 
>>> TMS-90809: Deprecated API Usage - Apple will stop accepting
>>> submissions of apps that use UIWebView APIs starting from April 2020 .
>> 
>> I'm not sure I understand the implications there.  Are they offering an
>> alternative to  , or flat out forbidding anything that renders HTML?
>> 
>> --
>> Richard Gaskin
>> Fourth World Systems
>> 
>> ___
>> 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: mobileGetDeviceToken

2020-03-03 Thread Mark Waddingham via use-livecode

On 2020-03-03 18:18, Dan Friedman via use-livecode wrote:

Greeting!   On iOS, prior to LC 9.6, mobileGetDeviceToken() would
return something like this:

	<965b251c 6cb1926d e3cb366f dfb16ddd e6b9086a 8a3cac9e 5f857679 
376eab7C>


However, with LC 9.6, I'm getting this:

{length=32,bytes=0xd923cbf42faacfae79b44e252fc64fc3...6c57203f87b56e10}

Anyone know how to extract a valid token from this??


Unfortunately you cannot. The problem occurred because we are now 
building against
the iOS13 SDK... Apple decided to change the return value of an internal 
call used

to turn the binary id into a string :|

A fix for this has already been merged, and will appear in 9.6-DP-3:

  QCC Report: 

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: iOS background behavior

2020-03-03 Thread Mark Waddingham via use-livecode

On 2020-03-03 16:30, J. Landman Gay via use-livecode wrote:

You can test, the app runs fine. You just can't submit to the App
Store with that key in the plist.

I have the same problem. All our users who can't update to iOS 13 will
be stuck back at the login screen after every phone call. Apple is
being very short sighted about this.


Brief google searches seem to suggest that since a-not-yet-determined
version of iOS the lack of the relevant plist key (exits-on-suspend)
means that the app will not exit on suspend... I found a reference to
saying this change happened in iOS11 onwards - but couldn't find an
explicit reference to it.

So, in theory, that means that not having the key will mean your app
should work the same on iOS11+ (again, this isn't anything I've tested
myself, just info gleaned from google).

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Translate metadata to field content

2020-02-21 Thread Mark Waddingham via use-livecode

On 2020-02-21 17:22, Richard Gaskin via use-livecode wrote:

This is an interesting detail.  Is it safe to surmise from this that
in cases where speed is important we should consider using codeunits
instead of chars?


Yes - especially if searching for non-letter chars as delimiters (e.g. 
return, space, ':' etc.).



How might we use codeunits with offset()?


You wouldn't - you would use codeunitOffset instead.

Note: The dictionary entry for codeunitOffset is heinously wrong! The 
needle string can be any length, and the return value is *always* 
relative to the start of the string (its not quite the same as offset):


e.g. codeunitOffset("foo", "barfoo", 2) = 4 (not 2 - as would be the 
case with offset).


Another Note: In the general case codeunit counts <> codepoint counts <> 
character counts - although for native strings they are all the same, 
though.


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Translate metadata to field content

2020-02-21 Thread Mark Waddingham via use-livecode

On 2020-02-21 00:29, J. Landman Gay via use-livecode wrote:

So glad you chimed in, Mark. This is pretty impressive. I'll need to
use the "for each element" structure because my tags are not unique,
but it still is much faster. When clicking a tag at the top of the
document that links to the last anchor at the bottom of the text, I
get a timing of about 25ms. If I omit the timing for loading the
htmltext and the selection of the text at the end of the handler it
brings the timing to almost 0. The test text is long, but not nearly
as long as Bernd's sample.


Glad I could help - although to be fair, all I did was optimize what
Bernd (and Richard) had already proposed.

One thing I did notice through testing was that the actual styled 
content
makes a great deal of difference to performance. I also tried against 
the

DataGrid behavior (replicated several times), and then also against some
styled 'Lorem Ipsum' (https://loripsum.net/) of about the same length 
(around

8Mb of htmlText, with the anchor being search for on the last word). The
difference is that the DG has many more style runs (unsurprisingly) and
almost all are single words. So timings need to be taken against a
representative sample of the data you are actually working with.


I need to select the entire range of text covered by the metadata
span, not just a single word. I've got that working, but since we're
on a roll here, I wonder if there's a more optimal way to do it.


I did wonder if that would be the case...


I'm using chars instead of codepoints because when I tried it, they
both gave the same number. Should I change that?


Both characters and codepoints run the risk of requiring a linear scan 
of

the string to calculate the length - strictly speaking his will occur if
the engine is not sure whether character / codepoint have a 1-1 map to
codeunits (for example if your string has Unicode chars and it hasn't
analysed it). Therefore you should definitely use codeunits.


Also, I had to add 3 to tStartChar to get the right starting point but
I can't figure out why. Otherwise it selects the last character before
the metadata span as the starting point.


Was the anchor in the third paragraph by any chance?

The styledText representation makes the paragraph separator (return 
char)

implicit (as it is in the field object internally) - so you need to bump
the tTotalChars by one before the final end repeat to account for that 
(as the

codeunit ranges the field uses *include* the implicit return char)

So I couldn't help but fettle with this a little more. You mention that 
your

'anchors' are not unique in a document. This raises the question of what
happens if there is more than one match...

This handler finds all occurrences of a given anchor in the text. As we 
are
searching for all of them, it can use repeat for each key iteration in 
both

loops:

function FindAllAnchors pStyledText, pAnchor
   /* Return-delimited list of results, each line is of the form:
   * start,finish,line
   * Each of these corresponds to a chunk of the form:
   *  CODEUNIT start TO finish OF LINE line OF field
   */
   local tResults

   /* Iterate over the lines of the text in arbitrary order - the order 
doesn't

   * matter as we keep the reference to the line any match is in. */
   repeat for each key tLineIndex in pStyledText
  /* Fetch the runs in the line, so we don't have to keep looking it 
up */

  local tRuns
  put pStyledText[tLineIndex]["runs"] into tRuns

  /* Iterate over the runs in arbitrary order - assuming that the 
number
  * of potentially matching runs is miniscule compared to the number 
of

  * non-matching runs, it is faster to iterate in hash-order. */
  repeat for each key tRunIndex in tRuns
 /* If we find a match, work out its offset in the line */
 if tRuns[tRunIndex]["metadata"] is pAnchor then
/* Calculate the number of codeunits before this run */
local tCodeunitCount
put 0 into tCodeunitCount
repeat with tPreviousRunIndex = 1 to tRunIndex - 1
   add the number of codeunits in 
tRuns[tPreviousRunIndex]["text"] to tCodeunitCount

end repeat

/* Append the result to the results list. */
put tCodeunitCount + 1, \
  tCodeunitCount + the number of codeunits in 
tRuns[tRunIndex]["text"], \

  tLineIndex & \
  return after tResults
 end if
  end repeat
   end repeat

   /* We want the results sorted first by line index, then by starting 
codeunit
   * within the line (so we get a top-to-bottom, left-to-right order). 
As the
   * 'sort' command is stable, we can do this by first sorting by the 
secondary
   * factor (codeunit start), then sorting again by the primary factor 
(line

   * index). */
   sort lines of tResults ascending numeric by item 1 of each
   sort lines of tResults ascending numeric by item 3 of each

   /* 

Re: text copied form LC generated PDF, WTF?

2020-02-20 Thread Mark Waddingham via use-livecode

On 2020-02-18 18:40, Klaus major-k via use-livecode wrote:

Hi friends,

I know that copying text form a PDF file may result in unexspected 
results,

but this is really ridicoulous!?

I created a PDF from LC (selected "Save as PDF" in the macOS Print 
dialog)
and when I copy some text and past it into TextEdit, this is what i 
get:


Where on earth are my numbers and where is my text?

Any insights very appreciated!


As requested by Klaus on the forum thread 
(http://forums.livecode.com/viewtopic.php?f=9=33683=15) this 
isn't a bug.


TL;DR version - extracting text from PDFs is hard, and viewers all do it 
differently with different levels of 'correctness'.


The fonts used and the layout can affect what they can produce.

In this case, the stack in question was being printed with the default 
system theme fonts (on macOS this is .SFNSText it would seem) - and for 
whatever reason that font generates glyphs for numbers in the PDF which 
PDF viewers don't seem to be able to map back to actual digits.


Upshot - make sure the controls you are printing have an explicit font 
setting to a 'normal' font if you want to be able to copy text from any 
PDF you might generate as a result :)


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Translate metadata to field content

2020-02-20 Thread Mark Waddingham via use-livecode
Of course *all* three of my suggested approaches are wrong - I messed up 
the inner loop in each...


On 2020-02-20 07:56, Mark Waddingham via use-livecode wrote:

NON-UNIQUE ANCHORS
repeat with i = 1 to the number of elements in tDataA
  local tRunsA
  put tDataA[i]["runs"] into tRunsA
  repeat with j = 1 to the number of elements in tRunsA
if tRunsA[j]["metadata"] is tSearchText then
  repeat with m = 1 to j
add the number of words of tRunsA[m]["text"] to tNumWords
put true into tFlagExit
exit repeat
  end repeat
end if
  end repeat
  if tFlagExit then
exit repeat
  end if
end repeat
select word tNumWords of line i of field "x"


Should be:

 repeat with i = 1 to the number of elements in tDataA
   local tRunsA
   put tDataA[i]["runs"] into tRunsA
   repeat with j = 1 to the number of elements in tRunsA
 if tRunsA[j]["metadata"] is tSearchText then
   repeat with m = 1 to j
 add the number of words of tRunsA[m]["text"] to tNumWords
   end repeat
   put true into tFlagExit
   exit repeat
 end if
   end repeat
   if tFlagExit then
 exit repeat
   end if
 end repeat
 select word tNumWords of line i of field "x"


UNIQUE ANCHORS



repeat for each key i in tDataA
  local tRunsA
  put tDataA[i]["runs"] into tRunsA
  repeat for each key j in tRunsA
if tRunsA[j]["metadata"] is tSearchText then
  repeat with m = 1 to j
add the number of words of tRunsA[m]["text"] to tNumWords
put true into tFlagExit
exit repeat
  end repeat
end if
  end repeat
  if tFlagExit then
exit repeat
  end if
end repeat
select word tNumWords of line i of field "x"


Should be:

 repeat for each key i in tDataA
   local tRunsA
   put tDataA[i]["runs"] into tRunsA
   repeat for each key j in tRunsA
 if tRunsA[j]["metadata"] is tSearchText then
   repeat with m = 1 to j
 add the number of words of tRunsA[m]["text"] to tNumWords
   end repeat
   put true into tFlagExit
   exit repeat
 end if
   end repeat
   if tFlagExit then
 exit repeat
   end if
 end repeat
 select word tNumWords of line i of field "x"


RUN WITH METADATA DEFINES SELECTION - NON-UNIQUE SEARCH

repeat with i = 1 to the number of elements in tDataA
  local tRunsA
  put tDataA[i]["runs"] into tRunsA
  repeat with j = 1 to the number of elements in tRunsA
local tRunA
put tRunsA[j] into tRunA
if tRunA["metadata"] is tSearchText then
  repeat with m = 1 to j - 1
add the number of codeunits of tRunsA[m]["text"] to 
tNumCodeunitsBefore

put the number of codeunits in tRunA["text"] into tNumCodeunits
put true into tFlagExit
exit repeat
  end repeat
end if
  end repeat
  if tFlagExit then
exit repeat
  end if
end repeat
select codeunit tNumCodeunitsBefore to tNumCodeunitsBefore +
tNumCodeunits - 1 of line i of field "x"


Should be:

 repeat with i = 1 to the number of elements in tDataA
   local tRunsA
   put tDataA[i]["runs"] into tRunsA
   repeat with j = 1 to the number of elements in tRunsA
 local tRunA
 put tRunsA[j] into tRunA
 if tRunA["metadata"] is tSearchText then
   repeat with m = 1 to j - 1
 add the number of codeunits of tRunsA[m]["text"] to 
tNumCodeunitsBefore

   end repeat
   put the number of codeunits in tRunA["text"] into tNumCodeunits
   put true into tFlagExit
   exit repeat
 end if
   end repeat
   if tFlagExit then
 exit repeat
   end if
 end repeat
 select codeunit tNumCodeunitsBefore to tNumCodeunitsBefore + 
tNumCodeunits - 1 of line i of field "x"


Oops!

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Translate metadata to field content

2020-02-19 Thread Mark Waddingham via use-livecode

On 2020-02-19 21:40, Niggemann, Bernd via use-livecode wrote:

here is Richard's script which I changed to get the number of words of
the line with the tagged word, the number of lines are taken from the
array.

The tagged word is then: word tNumWords of line (current array key)

-
put item 2 of the extents of tDataA into tExtents
   repeat with i = 1 to tExtents
  put item 2 of the extents of tDataA[i]["runs"] into tCounter
  repeat with j = 1 to tCounter
 if tDataA[i]["runs"][j]["metadata"] is tSearchText then
repeat with m = 1 to j
   add the number of words of tDataA[i]["runs"][m]["text"]
to tNumWords
end repeat
put true into tFlagExit
exit repeat
 end if
  end repeat
  if tFlagExit then exit repeat
   end repeat
-

select word tNumWords of line i of field "x"


That approach is much better than my suggested one, and is independent 
of the soft breaks of the text as well :)


It can be made a little more efficient though...

[ DISCLAIMER: I don't have any test data to run these on - so the 
following code snippets have not been tested in any way - or 
syntax/error checked :D ]


NON-UNIQUE ANCHORS

If the anchors used are non-unique and you want the first matching 
anchor in the page from top to bottom / left to right then...


1. Using 'the number of elements of' rather than 'the extents' saves 
some time. As the arrays in question are known to be sequences, the 
number of elements of SEQUENCE == item 2 of the extents of SEQUENCE


2. Factoring out the common array lookups will save some time.

With these two changes you'd have:

repeat with i = 1 to the number of elements in tDataA
  local tRunsA
  put tDataA[i]["runs"] into tRunsA
  repeat with j = 1 to the number of elements in tRunsA
if tRunsA[j]["metadata"] is tSearchText then
  repeat with m = 1 to j
add the number of words of tRunsA[m]["text"] to tNumWords
put true into tFlagExit
exit repeat
  end repeat
end if
  end repeat
  if tFlagExit then
exit repeat
  end if
end repeat
select word tNumWords of line i of field "x"

UNIQUE ANCHORS

If the anchors being searched for are unique in a document, then using 
repeat for each key in both loops will save some time. Although the 
search order in the runs and lines will be arbitrary (hash-order), as 
the thing being searched for is unique this doesn't matter.


[ The reason this should be faster is that the engine doesn't need to 
process the index vars (i / j) before looking up in the array. ]


repeat for each key i in tDataA
  local tRunsA
  put tDataA[i]["runs"] into tRunsA
  repeat for each key j in tRunsA
if tRunsA[j]["metadata"] is tSearchText then
  repeat with m = 1 to j
add the number of words of tRunsA[m]["text"] to tNumWords
put true into tFlagExit
exit repeat
  end repeat
end if
  end repeat
  if tFlagExit then
exit repeat
  end if
end repeat
select word tNumWords of line i of field "x"

RUN WITH METADATA DEFINES SELECTION - NON-UNIQUE SEARCH

If the area you want to select is defined by the run with metadata being 
searched for, then you can avoid words altogether and just count 
codeunits. Codeunits are the fastest chunk to count as they don't need 
any iteration of the content of the string being queried:


repeat with i = 1 to the number of elements in tDataA
  local tRunsA
  put tDataA[i]["runs"] into tRunsA
  repeat with j = 1 to the number of elements in tRunsA
local tRunA
put tRunsA[j] into tRunA
if tRunA["metadata"] is tSearchText then
  repeat with m = 1 to j - 1
add the number of codeunits of tRunsA[m]["text"] to 
tNumCodeunitsBefore

put the number of codeunits in tRunA["text"] into tNumCodeunits
put true into tFlagExit
exit repeat
  end repeat
end if
  end repeat
  if tFlagExit then
exit repeat
  end if
end repeat
select codeunit tNumCodeunitsBefore to tNumCodeunitsBefore + 
tNumCodeunits - 1 of line i of field "x"


Mutatis mutandis for the unique case using repeat for each key.

Again - none of these methods require formattedStyledText, just 
styledText (indeed formattedStyledText wouldn't work with this approach 
as that adds extra codeunits - the VTABs - for the soft-breaks which 
aren't actually there!).


Hope this helps!

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Does any one know what Player "intervals" actually are?

2020-02-19 Thread Mark Waddingham via use-livecode

On 2020-02-18 21:40, Paul Dupuis via use-livecode wrote:

Lastly, my inquiry was also looking to actually understand what
"intervals" really are, mostly out of curiosity and interest.  I am
still curious as to what exactly "intervals" are. LC support just says
that they get them from the media frameworks and pass them along.


Heh - I guess we could have done a little better than the answer we gave 
(mostly my fault, Elanor asked internally, and I hadn't thought about 
such things in a long while so couldn't really remember the exact 
details / didn't read your question that deeply)...


Martin's post has the exact details - to summarize that - the 
'timeScale' is the scaling provided to map units used to reference 
points in a media to seconds. Each second is divided up into timeScale 
units - so a timeScale of 600 means that there are 600 units in every 
second.


The reason this is done, rather than use seconds (or milliseconds, 
microseconds...) is to prevent error accumulating and also so that most 
arithmetic done internally by the frameworks can be done using integers 
- not floating point (which is faster, and much easier to predict and 
account for numerical error with).


QT allows multiple tracks to be present in a single MOV - each which 
have their own framerate, for example. So by using 600 in many cases, it 
means that you could overlay video tracks recorded at 24, 25 or 30fps 
precisely.


Audio formats tend not to have an inherent notion of timeScale - raw 
formats, for example, have N samples per second; whereas MP3 has 
'packets' of compressed audio which expand to cover a given time period. 
So frameworks will tend to make their own up by the look of it to suit 
whatever seemed reasonable at the time - or use some other metric from 
the file (I notice that some audio files listed have a timeScale of 
44100 - which probably means that audio file is 44.1kHz - the standard 
CD quality audio sample rate).


Given the problem you have at hand, the best thing to do is to perhaps 
create a small utility which you ask users of your tool to run which 
fetches the timeScale for all their files using QT - then you should be 
able to analyse that data (en masse) to see what possible timeScales 
exist for different formats. That should mean you can, at least, create 
a heuristic for guessing the timeScale of any given (existing) file.


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Translate metadata to field content

2020-02-18 Thread Mark Waddingham via use-livecode

On 2020-02-18 19:14, J. Landman Gay via use-livecode wrote:

Thanks for the reply guys, both Hermann and Mark, and Bernd who sent
me materials offline. I'll be going over these suggestions to see what
works best. The file content can be very long especially when
separated into runs (more than 200,000 runs for an average file) so
speed will matter since this is headed for a mobile app.

I was surprised to see two things:

1. FormattedStyledText appears nowhere in the dictionary. I didn't
know it existed.


Heh - I'd actually forgotten about it until a couple of weeks ago when I 
had to write some code to independently process the each soft-wrapped 
line of styled text in a field.


I half wrote some code to do what I wanted in a different way while 
wishing 'if only I had implemented the formatted variant for styledText 
wayback when' - then I happily remembered that I had!


If you have a moment to file an report in the QC, we can get it added.


2. FormattedStyledText treats some punctuation as a new run, even if
it has not changed text style. For example, semi-colons are
independent runs. Very odd.


Hmmm - there's no code to do that explicitly (a semi-colon is no 
different from any other char!). Non-merged style runs can occur through 
some script operations on a field though (the engine uses 0 length runs 
sometimes as markers - they would probably cause that effect). It could 
also be due to the structure of the htmlText being imported 
(potentially). If you have a simple example, then I can probably say one 
way or the other.


The formattedStyledText, like the styledText, is just a array version of 
the data-structure the engine holds inside (although it never emits 0 
length runs).


In this case that shouldn't matter though as it will be the text that 
you want to count, not the runs.


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Translate metadata to field content

2020-02-17 Thread Mark Waddingham via use-livecode
There’s the formattedStyledText property which is like the formattedText but in 
the form of a style array. If you sum the number of chars in each run up until 
you find your tag, then you can should be able to use the formattedheight of 
char 1 up to the summed index to get the vscroll you need.

Warmest Regards,

Mark.

Sent from my iPhone

> On 17 Feb 2020, at 22:50, J. Landman Gay via use-livecode 
>  wrote:
> 
> Thanks, I'll save that for someday. In this case though, the text is wrapped 
> and there are anchors scattered around inside paragraphs. Unless someone else 
> has an idea it looks like I'm going to have to extract lookup tables. That's 
> going to be quite a job.
> 
>> On 2/17/20 3:59 PM, Richard Gaskin via use-livecode wrote:
>> J. Landman Gay wrote:
>>> I'm still working on htmltext in a field. There are anchors that indicate 
>>> positions elsewhere in the file. A browser will automatically find and 
>>> scroll to the right place in the text. I need to reproduce that.
>>> 
>>> Is there a way to translate an anchor like "#12345" to the location in the 
>>> visible field text it links to?
>>> 
>>> I've thought of a couple of alternate ways to do it involving lookup files, 
>>> but it would be better to do a direct translation to avoid the extra 
>>> overhead.
>> The closest I have doesn't account for softwraps, but FWIW:
>> function fwAnchorTagLine pFldObj, pTag
>>local tA
>>local tLastLine
>>local tNumRuns
>>put the styledText of pFldObj into tA
>>put item 2 of extents(tA) into tLastLine
>>repeat with i = 1 to tLastLine
>>   put item 2 of extents(tA[i]["runs"]) into tNumRuns
>>   repeat with j = 1 to tNumRuns
>>  if pTag is in tA[i]["runs"][j]["style"]["linkText"] \
>>AND "link" is not in \
>>   tA[i]["runs"][j]["style"]["textStyle"] then
>> return i
>>  end if
>>   end repeat
>>end repeat
>> end fwAnchorTagLine
> 
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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


Re: revprintfield and RIGHT tabalign?

2020-02-14 Thread Mark Waddingham via use-livecode

On 2020-02-14 18:27, Klaus major-k via use-livecode wrote:

Hm, did take all the above mentioned stape but there are still parts
that are not printed
and the TOTAL lines are still wrapped.


Odd - I modified your test stack button to be:

on mouseUp pMouseButton
   revshowprintdialog false, true
   set the printMargins to 20,20,20,20
   set the printPaperSize to 595,842
   revprintfield the name of fld "drucken"
end mouseUp

And the PDF generated seems to be an exact replica of the field on the 
screen.


What script did you use?

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: revprintfield and RIGHT tabalign?

2020-02-14 Thread Mark Waddingham via use-livecode

On 2020-02-14 17:32, Klaus major-k via use-livecode wrote:
revPrintField formats the content of the field you specify to fill a 
new field

which fits within the printMargins of the page.

'print this card' starts printing the card *as it is* with the 
top-corner at

the left-print-margin,top-print-margin.

Try choosing 'A4 Borderless' as the page size (this has 0 print 
margins).


As I wrote, then it works as exspected, but this is not practical,
who has a marginless printer?


Most people these days in fact! Most (even cheap) inkjets can print to 
the edge of an A4 page :D


[ Of course, the need for margins when printing is not actually really 
related to what could be printed, but what is comfortable for the user 
to hold and read! ]


The revPrintField command is written to make it easy to print the 
contents of a field, over multiple pages to fit to the page setup and 
printer options provided by the user. This means it computes the width 
of the field based on those options.


The issue here is that your field layout is width sensitive - as are 
most documents which use tabStops. If you'd typed your content into 
word, and then changed the page setup / margin options from the settings 
in effect when you set the tabStops then you'd get exactly the same 
effect as you are seeing with revPrintField.


Your stack appears to already be laid out assuming an A4 page size - 
which is why you get the effect you want when using 'print this card'.


Assuming you don't need to accommodate user-chosen page sizes, then all 
you should need to do is:

  1) use revShowPrintDialog to turn off showing the page setup dialog
  2) set the printMargins to those you already have in your stack (the 
distance of each edge of the field from the card boundary)
  3) set the printPaperSize to the width and height of your stack (which 
is A4 size in points - I think at least)

  4) call (modified) revPrintField

This should mean that revPrintField will use a field of the same width 
and height of that in the stack, but do the pagination for you.


If you do need to account for different (user chosen) page widths, then 
you will need to adjust the tabStops appropriately:

  1) answer page setup to get the user's chosen options
  2) use revShowPrintDialog to turn off showing the page setup dialog
  3) interrogate the printPaperSize and printMargins to work out the 
printable width (pageWidth - leftMargin - rightMargin)
  4) adjust the tabStops of your field so that the right tabStop is at 
the printable width

  5) call (modified) revPrintField

Hope this helps!

Warmest Regards,

Mark

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: revprintfield and RIGHT tabalign?

2020-02-14 Thread Mark Waddingham via use-livecode

On 2020-02-14 17:03, Klaus major-k via use-livecode wrote:=

I have a workaround with "print this cd", so lets wait and see what
the mothership says...


I think 'the mothership' is likely to say exactly the same as Richard...

Your right aligned column isn't missing - its off the side of the page 
(well,

being wrapped actually).

revPrintField formats the content of the field you specify to fill a new 
field

which fits within the printMargins of the page.

'print this card' starts printing the card *as it is* with the 
top-corner at

the left-print-margin,top-print-margin.

Try choosing 'A4 Borderless' as the page size (this has 0 print 
margins).


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: OMG text processing performance 6.7 - 9.5

2020-01-31 Thread Mark Waddingham via use-livecode
I don’t think you read too much into differences of as little as 10ticks - the 
error in time measurement for a single run would be too high.

It’s seems to make sense that vms would do the same task slower than the 
machine that they run on so I don’t think that’s a very interesting comparison.

Your windows workstation is an i3 - I suspect it only has two cores - SSDs 
whilst fast can only do one thing at a time. When you are running the database 
and client on the same machine I suspect there’s more contention there then 
when client and server are separate machines... 

The code on the LC side is the same (engine and client drivers) so it’s almost 
certainly hardware / OS causing the difference.

Warmest Regards,

Mark


Sent from my iPhone

> On 31 Jan 2020, at 15:54, Bob Sneidar via use-livecode 
>  wrote:
> 
> I take that back it's a 32 bit Windows OS (dunno why I even still have this 
> PC). But bitness is not going to affect a single network thread. Also the 
> processor is an i3 running at 3.1. My mac is an i7 running at 2.3. Also my 
> Mac is clamped to 100mb networking due to the nature of our VIOP phones. The 
> Standalone Workstation is gigabit and as I mentioned IS the SQL server 
> itself. 
> 
> Bob S
> 
> 
>> On Jan 31, 2020, at 07:47 , Bob Sneidar via use-livecode 
>>  wrote:
>> 
>> Not so fast. On a standalone workstation Windows 7 64bit 16gig memory and an 
>> SSD: 64 ticks. Compared with 14 ticks on my Mac OS X. My Parallels VM is 
>> outperforming a workstation. Oh, and the Windows workstation? It's the 
>> workstation running the mySQL instance!!!
>> 
>> That's exactly my point. It is decidedly NOT like-with-like, but it has 
>> nothing to do with virtualization. The Windows LC is running very much 
>> slower than the Mac OS, and I'm not blaming LC. It may be Windows itself. I 
>> disabled my Antivirus. Got it down to 57 ticks. 
>> 
>> Bob S
>> 
>> 
>>>> On Jan 31, 2020, at 03:06 , Mark Waddingham via use-livecode 
>>>>  wrote:
>>> 
>>> That’s not comparing like-with-like though - you are comparing VMs running 
>>> Windows on your Mac with your Mac by the sound of it... VMs introduce a 
>>> fair bit of overhead for all I/O (and also for some code - depending on the 
>>> age of your CPU and the virtualisation support it has).
>>> 
>>> Mark
>>> 
>>> Sent from my iPhone
> 
> ___
> 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: OMG text processing performance 6.7 - 9.5

2020-01-31 Thread Mark Waddingham via use-livecode
That’s not comparing like-with-like though - you are comparing VMs running 
Windows on your Mac with your Mac by the sound of it... VMs introduce a fair 
bit of overhead for all I/O (and also for some code - depending on the age of 
your CPU and the virtualisation support it has).

Mark

Sent from my iPhone

> On 31 Jan 2020, at 01:02, Bob Sneidar via use-livecode 
>  wrote:
> 
> Hi Mark. 
> 
> I have to chime in here that the difference between OS X apps accessing a sql 
> database and Windows doing the same thing in the same app is substantial, and 
> I cannot think why, unless it is Windows itself causing the problem. Querying 
> my customer database for all my customer records takes 14 ticks on OSX. On 
> Windows running in my Parallels it takes 59. On a server 2012 running in 
> VMWare it takes 71! 
> 
> This has made my port to Windows almost unviable. If I had some kind of real 
> answer as to what was causing this kind of lag, it would help. 
> 
> Bob S
> 
> 
> 
>> On Jan 30, 2020, at 06:04 , Mark Waddingham via use-livecode 
>>  wrote:
>> 
>> 
>> Warmest Regards,
>> 
>> Mark.
>> 
>> -- 
>> Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
>> LiveCode: Everyone can create apps
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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


Re: OMG text processing performance 6.7 - 9.5

2020-01-30 Thread Mark Waddingham via use-livecode

On 2020-01-30 14:38, Ben Rubinstein via use-livecode wrote:

Hi Mark,

Thanks for taking the time to reply!

I'm indeed currently in the process of seeing whether I can persuade
the client's IT department to install the 32-bit drivers on the new
VM. I'm optimistic that will buy me some time, but it won't be a
complete solution because they outsource support to a third company,
which has warned that it doesn't intend to support the 32-bit drivers
much longer (apparently they're just waiting for Crystal Reports to be
updated!).


Ah! From that I'm guessing you are using the ODBC revdb driver - which 
needs

a third-party ODBC connector :)


And if that fails, one of my options is as you suggest to use the LC
9.5-built app to retrieve the data through the 64-bit drivers, and the
the LC 6.7-built app to process and (probably) build it. It will be
shonky.


It doesn't have to be 'shonky' - if the fetch-from-database part is 
already

separated from the data-processing-part through cache-files (i.e. fetch
writes to files on disk, data-process reads said files and processes) 
then

you could build a 64-bit win standalone which is the fetch-from-database
part, which is then called by the data-process part using shell (or open
process).

Of course, it would be slightly cleaner to all be one app :)


However, what you say certainly makes me feel more optimistic that
something should be possible. There's really very little going on in
the way of binary<->text conversion; there probably is a fair amount
of word chunking - although half the work is about tracing
cross-references etc, there's also a fair amount of processing of
'prose' and prose-like text. However, the nature of the text is that
although 99% of it is probably ASCII, in any given table of text there
will be just a few 'extended' characters - does that mean it all gets
treated as four-byte data?


Binary<->text can be quite subtle - as it isn't something you had to 
think
about before 6.7. For example, if you are fetching using *b via revDB 
from
the database, then *that* will now be binary data - not text. (Indeed, 
what

accessors are you using to get the data?)

Also, things like binfile and reading for binary (from a file) will also
produce binary rather than text.

You can test for binary data using 'is strictly a binary string'.

Native encoding means (on Windows at least) anything which fits into 
Latin-1
so any text you are getting out of revDB from the database should come 
through

as native strings.

Native strings get converted to unicode internally when they are 
combined with

a string which contains unicode and in two other places:
  1) Using matchText / replaceText (because we use the utf-16 variant of 
PCRE)
  2) When put into a field (because all text layout APIs on all 
platforms use UTF-16)


What sort of text operations are you using for 'tracing cross-references 
etc' and

'processing of 'prose' and prose-like text'?


I'll see how the negotiations with IT get on...


Good luck!

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: OMG text processing performance 6.7 - 9.5

2020-01-30 Thread Mark Waddingham via use-livecode

On 2020-01-30 13:20, Ben Rubinstein via use-livecode wrote:

The context is that I'm finally forced to replace an app that's been
processing data for a client for well over a decade. To date the
standalone has been built on LC 6.7.11; but now we need to put it on a
new platform with 64-bit database drivers. The performance has gone
through the floor, through the floors below, through the foundations,
and is on its way to the centre of the earth.


What's the need for 64-bit database drivers? i.e. What are you currently
using to talk to the database and why can you not continue to use a 
32-bit

Windows standalone?


The first stage of the app - which retrieves a load of data from
various databases and online sources, does minimal processing on it,
and dumps it to cache files - is approx 2x slower. The main core of
the app, which loads this data in and does a vast amount of processing
on it to generate various output data and reports, has gone from 12
minutes to over *six hours*.


I suspect it is probably a couple of things which are being done 
uniformly

causing the problem rather than lots of things all over the place...

Where exactly is the data coming from? (at a high-level) what sorts
of operations are being performed on it? what sort of I/O is being 
performed?


The main one I can think of is implicit binary<->text conversions. In 
6.7
and below binary data and text were the same thing - in 7+ they are 
distinct
types which require a conversion operation. The functions which were 
always

really returning/taking binary data now actually do.

e.g. textEncode / Decode, compress / decompress, binaryEncode / 
binaryDecode,

the byte chunk, repeat for each byte, numToByte

Given the app is coming from 6.7 vintage, it is unlikely that any of the 
new
unicode text codepaths would be hit (unless there's something odd going 
on
somewhere) as binary data converts to native encoded text - unless of 
course
the means by which the data is getting into the app is being taken as 
unicode
strings (without knowing the exact I/O going on I can't really see how 
this

could happen, but I can't rule it out).

In general, native text processing (item detection, comparison, 
containment
and such) is all as fast if not faster in the post-7 engines than 6.7 as 
I
spent quite a while specializing a lot of lower level routines to make 
sure

it was.

I do know the word chunk has been somewhat adversely affected, however, 
as

that was never optimized in the same way.


The coding is gnarly - the oldest parts are probably at least 15 years
old - and I've no doubt it could be made more efficient; but we don't
have time or budget to rewrite it all. So, are there known gotchas,
functions which have taken a much greater hit than others, that I
could concentrate on to get the most ROI in speeding this up?


Given that you don't have time nor budget to really touch the code at 
all

in any depth then it would best to not have to touch it at all and keep
it in 6.7.11? i.e. Do you really need to move to 6?

Could you split the app into the bit which does the database 
communication
and caching (assuming that *really* needs to be 64-bit) and the bit 
which

does the data processing (which could remain as 32-bit in 6.7.11).

Note I should say that the reason I ask the above is not because of a 
lack

of confidence in getting your code to run as fast as it did before but
because of pure business reasoning - why spend time and money on 
something

which isn't necessarily really needed?

There's a difference between needing to update user-facing apps and true
back-office server apps after all - banks and insurance companies still 
have
software written on and running on machines which are decades old 
because
they work and the cost of keeping them running is vastly less than the 
cost

to rewrite and replace!).

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Do Mac OS apps stop working if your Mac Developer ID Application cert expires?

2020-01-24 Thread Mark Waddingham via use-livecode

On 2020-01-24 17:41, Tony Trivia via use-livecode wrote:
Thanks to all who replied. The scope of my concern is strictly for 
MacOS

standalone builds that are distributed outside of the App Store.
Such builds are blissfully simple compared to mobile device builds. For
years, I've been able to sign such apps without any provisioning certs.
(Since Apple has virtually no role in the distribution, it is not 
involved

in the beta testing or updating of the app.) All I've needed to build
releases is the standard Developer ID Application cert, and those are
typically good for five year spans.  But, eventually I won't be here to
renew the thing and I'd like any apps I make to carry on. So I hope 
JLG's

prediction is correct!


I believe that as long as you sign, notarize and then staple the results
of the notarization to your app (or DMG - if you distribute using that
method) then expiry of your developer id / certificate (should that 
occur)

will have no effect on them.

Just signing is no longer sufficient for the OS to verify an app on 
Catalina

(and it seems, to a certain degree, on recent versions of Mojave!).

Notarizing but not stapling means the OS will always do a 'callback' to
Apple's servers to check integrity.

Stapling after notarization means the app is verifiable as it is.

At least that is my interpretation of the recent changes...

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: iOS app crashes on launch

2020-01-24 Thread Mark Waddingham via use-livecode

On 2020-01-24 02:07, Ralph DiMola via use-livecode wrote:

J,

High Sierra
Xcode 10.1 build tools
LC 9.6.0 dp2

Confirm crash on 9.3.6
Works fine on 12.4.2

LC 9.5.1 works OK on 9.3.6

I don't have an iOS 11 device to test but we now know that 9 and 10 
CTD.


Unfortunately both iOS 8 and iOS 9 builds will crash if a browser widget 
is
included - these very old versions of iOS (whilst they have WKWebView) 
don't
seem to like modern uses of it (they also have problems with the 
replacement

player implementation!).

We kept the min version to allow as low as 8 as apps not using the 
browser
widget work fine (although I wonder if that actually provides false 
information
in a way so might have been an error - perhaps we should just remove 
those

options from the S/B).

It could be that iOS 10 is suffering the same problem - @Jacque can you 
attach
any crash logs you can get to a bug report so we can check? (And indeed 
try
building and running an app which doesn't include the browser widget on 
the

old device you have access to?).

If it is confirmed that iOS 10 also has a problem with the new browser
implementation on iOS then there isn't really much we can do there.

Its probably worth mentioning that based on looking at few different 
stats

sites on the matter - devices running iOS 10 and still attempting to run
apps / fetch websites now makes up < 2% of all iOS OS usage and that's
dropping by about 0.3% a month. iOS 9 usage is already < 0.5%, and iOS 8
is almost non-existent.

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: TIFF support in the past?

2020-01-24 Thread Mark Waddingham via use-livecode
I think the player object would show tiff files back when it was QT driven - 
the engine itself has never natively supported tiff.

Warmest Regards,

Mark

Sent from my iPhone

> On 24 Jan 2020, at 08:01, Phil Davis via use-livecode 
>  wrote:
> 
> I'm trying to find out if there was a time in the distant past when LC 
> supported the TIFF image format. I found some TIFF image assets in some 
> subfolders of a project from back then (maybe 10 or more years ago?) but 
> can't run a copy of LC from that era to find out.
> 
> Any memories?
> 
> Thanks -
> Phil Davis
> 
> -- 
> Phil Davis
> 503-307-4363
> 
> 
> ___
> 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: No support for 24bit/96kHz audio file?

2020-01-23 Thread Mark Waddingham via use-livecode

On 2020-01-23 10:00, Stephen Barncard via use-livecode wrote:

Mark,
My experience with the built in player in the past has been difficult 
and

it never served files greater than 16 bit up to 48k. In 2006 I reverse
engineered (hacked) the player object to EXPORT audio files and 
required a
lot of convoluted code to reassemble as a wav or aiff file, building 
the

binary jump table was a trip.  I gave up after that.


Well it probably would have been easier just to use QT APIs direct and 
write
an external to export the audio data from the file (not that that was 
ever
necessarily easy, media frameworks tend to be skewed towards playback 
rather
than authoring - and QT was never particularly well documented for 
anything

other than playback!).


Has it ever really been improved? Player vs "Player control"  ?
It used to depend on Quicktime which is now doornail.


Audioclips have always been restricted in what they can do - they are 
essentially

just simple raw audio storage/playback things.

Players used QT on Mac/Win until QT died - now they use 
AVFoundation/DirectShow
(for at least the last 2-3 years). The formats they support are what 
those

frameworks support.

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: No support for 24bit/96kHz audio file?

2020-01-23 Thread Mark Waddingham via use-livecode

On 2020-01-22 19:17, JJS via use-livecode wrote:

Hi,

i imprted some short audiofiles 24bit/96kHz but it seems LC does some
kind of downsampling or changes the frequency.


When you say 'import' do you mean as audioclips?

I don't think audioclips (nor the APIs used to playback their sounds) 
support

24-bit audio.

Have you tried using a player?

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Apple Mac menubar?

2020-01-21 Thread Mark Waddingham via use-livecode

On 2020-01-21 17:22, dunbarx--- via use-livecode wrote:

@Sean
What are the "system menu extensions" on the right side of the menubar?
@Mark W.
What is a "Mac Status Menu"?


They are the little icons which appear on the right hand-side of the mac
menubar - things like the keyboard selector, bluetooth status,
battery life indicator, wifi status etc.

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: Apple Mac menubar?

2020-01-21 Thread Mark Waddingham via use-livecode

On 2020-01-21 16:41, Colin Kelly via use-livecode wrote:

Thanks Sean, that's exactly the info I was looking for.


Search for 'Mac Status Menu' in the dictionary - I think that is what 
you
are looking for (Cocoa calls those little widgets NSStatusMenu's, hence 
the

name of the extension).

Warmest Regards,

Mark.

P.S. @FourthWorld - it is indeed an LCB library:


--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: FYI: Cause found for LC crashing to desktop when Browser widget opens PDF

2020-01-20 Thread Mark Waddingham via use-livecode

On 2020-01-20 15:20, Matthias Rebbe via use-livecode wrote:
Just want to let you know that Livecode Dev Team confirmed that this is 
a bug


https://quality.livecode.com/show_bug.cgi?id=22534


Well, we confirmed it crashed ;) Whether it is a bug in LC or Adobe DC 
or not

is another matter.

There was a similar issue a very long time ago with Adobe's PDF plugin - 
it would
cause the browser external to crash if used (we used the system webview 
back then
as we do now)... The Adobe plugin was doing things it shouldn't (I can't 
recall
if we managed to come up with a hack in the browser external to stop it 
or not; or

whether Adobe eventually cleaned up their plugin!)

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: strange problems with SEND

2020-01-17 Thread Mark Waddingham via use-livecode

On 2020-01-17 17:24, Klaus major-k via use-livecode wrote:

ouch, sorry, TRUE! :-/

However the other message "onlinekursinfo" is also from me and I have
no idea why it should be delivered on:
Sunday, February 2, 2070, I did not script that!?


I think you did ... Accidentally...


THAT script also looked fine in the debugger.
Will check again, but 2070 is definitevely WRONG in whatever pending 
message!


Remember that pending messages are not deleted by the engine until they 
fire

or you issue a cancel command.

This code essentially computes the 'future time' the message you were 
sending

would fire:

put the date into tDatum
convert tDatum from date to dateitems
add 1 to item 3 of tDatum
put 8 into item 4 of tDatum
convert tDatum from dateitems to seconds
put tDatum - the seconds into tNeuesDatum
add the seconds to tNeuesDatum -- essentially what 'in time' does
convert tNeuesDatum from seconds to long system date
put tNeuesDatum

Now try removing `- the seconds` from the 6th line and see what date you 
get...


(My theory is in some iteration of your code, you missed that out but 
ran the

script leaving you with a far future pending message!)

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


Re: strange problems with SEND

2020-01-17 Thread Mark Waddingham via use-livecode
Double check your pending messages after the send - the line you quoted doesn’t 
match the name of the handler in send...

Warmest Regards,

Mark.

Sent from my iPhone

> On 17 Jan 2020, at 15:46, Klaus major-k via use-livecode 
>  wrote:
> 
> HI all,
> 
> I want to execute a handler in the future -> tomorrow at 8:00 AM
> So I scripted:
> ...
> put the date into tDatum
> convert tDatum from date to dateitems
> add 1 to item 3 of tDatum
> put 8 into item 4 of tDatum
> 
>   ## dateitems:
>   # 1. the year
>   # 2. the month number
>   # 3. the day of the month
>   # 4. the hour in 24-hour time
>   # 5. the minute
>   # 6. the second
>   # 7. the numeric day of the week where Sunday is day 1, Monday is day 2, 
> and so forth 
> 
> convert tDatum from dateitems to seconds
> put tDatum - the seconds into tNeuesDatum
> send "checkabfrage" to me in tNeuesDatum secs
> put the result into checkabfrage_id   
> ...
> Looks OK in the debugger, tNeuesdatum is something like 58000, which is 
> correct.
> 
> However, when I query "the pendingmessages" this message shows up as:
> 39440,3158550744.943945,onlinekursinfo,stack "/xxx.livecode"
> 
> But 3158550744.943945 as "delivery" time resolves (convert) to: 
> long system date -> Sonntag, 2. Februar 2070
> long date -> Sunday, february 2, 2070?
> date -> 2/2/70
> 
> Is this broken somehow or am I missing something?
> Any insight appreciated!
> 
> 
> Best
> 
> Klaus
> --
> Klaus Major
> https://www.major-k.de
> kl...@major-k.de
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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


Re: LiveCode won't recognize my stack

2019-12-30 Thread Mark Waddingham via use-livecode

On 2019-12-27 22:51, Bill Vlahos via use-livecode wrote:

List,

Version 9.x of LiveCode doesn’t recognize stacks unless the file name
ends with either .rev or .livecode. Previous versions (I don’t know
when this changed) were able to.


Nothing has changed here in any recent version.


I use a stack file as the Preferences file for InfoWallet but the file
name is “LicenseKey.IW”. When I execute the following command to read
custom properties in the stack it fails with an error. Type: Chunk:
can't find stack

put the uDefaultWallet of stack "LicenseKey.IW" into vDefault


This is most likely because you haven't got the stackFiles property set 
up, or the defaultFolder is not what you are expecting it to be - i.e. 
the engine cannot find the stack with filename "LicenseKey.IW" relative 
to the current folder.



I can also see this when opening a stack from LiveCode. the
LicenseKey.IW file is greyed out unless I look for All Files when then
opens it correctly.


The IDE still uses the form of 'answer file' which specifies a 
creator/filetype and an extension. I suspect either one of:


  A) the creator/filetype is actually recognised by more recent versions 
of macOS (i.e. they are ignored completely - I don't recall a report 
against Mojave, but it is entirely possible Catalina no longer supports 
them)


  B) The file has just lost its creator/filetype and thus is being 
filtered out (this can happen if a file is archived via a format which 
doesn't support these attributes, or has transmitted through an FS which 
doesn't).



How can I open the stack file in LiveCode 9.5.1 without changing the
name of the file?


Use All Files and select it that way, as you have been doing :)

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

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


  1   2   3   4   5   6   7   8   9   >