Apple Push Notifications update

2021-03-04 Thread Andrew at MidWest Coast Media via use-livecode
I feel blindsided by an email I received today from Apple indicating they are 
deprecating the binary  push notification method at the end of the month. I’ve 
dealt enough with trying to keep up with Android push changes over the years, 
but this seems to be the first major Apple update. 

This binary they speak of is the put tBinary into 
URL("binfile:Notification.bin") in the lesson @ 
https://lessons.livecode.com/m/4069/l/53405-how-do-i-use-push-notifications-with-ios
 correct?


Dear Andrew, 

The HTTP/2‑based Apple Push Notification service (APNs) provider API lets you 
take advantage of great features, such as authentication with a JSON Web Token, 
improved error messaging, and per‑notification feedback. If you still send push 
notifications with the legacy binary protocol, make sure to upgrade to the APNs 
provider API as soon as possible. APNs will no longer support the legacy binary 
protocol after March 31, 2021. 

Learn about the APNs provider API. 

 

If you have any questions, contact us 
.
 

Best regards,
Apple Developer Relations



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


Re: LC Roadmap

2021-02-17 Thread Andrew at MidWest Coast Media via use-livecode
This is an excellent idea. Provide the basic skeleton, but then demo a couple 
completed concepts as well to show what could be done. I would be willing to 
collaborate to make a finished example and document the process.

LiveCode is extremely powerful, but as others have noted some of these advanced 
features tend to roam from the “simple English” syntax. A little sample content 
goes a long way. You still need a paid version of LC to get iOS deployment, at 
least Community Plus: it seems like a starter stub project could pay for itself 
in subscription fees.

—Andrew Bell

> Date: Tue, 16 Feb 2021 15:26:49 +
> From: Alex Tweedly 
> To: use-livecode@lists.runrev.com
> Subject: Re: LC Roadmap
> 
> On 15/02/2021 12:55, Andre Garzia via use-livecode wrote:
>> It is with this in mind, that I decided to create content for our 
>> community. Books are an easy value proposition. Most of our community 
>> is beyond their thirties and have a fondness (and experience) for the 
>> written word and documentation. It is easy to sell books here, way 
>> easier than in other communities which are younger and prefer videos. 
>> That doesn?t mean that I can?t provide videos as well, damn I?ve 
>> graduated with a BA in filmmaking, I?m geared to start filming too. 
>> Books were the first step. I see myself more as a storyteller than a 
>> developer, that is why I want to focus on content for my own career 
>> moving forward. But that is only my own personal journey, other people 
>> here have a different path. I just wish that more people here decide 
>> to share their knowledge (and code) so that we can become a more 
>> vibrant community. 
> 
> Then I have a concrete suggestion for what would, I think, be a very 
> useful e-book + stack.
> 
> A sample 'skeleton' app - i.e. complete but not fleshed-out. Initially 
> it would be for a desktop app (the first sequel will cover mobile). It 
> would implement "good practices" for many of the common features, with 
> enough code being there to do something - but the focus should be on the 
> architecture rather than on doing anything useful.
> 
> It should include (most of):
> 
> ?- splash stack, with checks for updated versions, background 
> downloading & installing them, etc.
> 
> ?- proper locations for libraries, prefs files, other config data, 
> other data, etc. as well as loading the libraries.
> 
> ?- simple preferences handling (i.e. library which will store, retrieve 
> and allow basic user interaction to view/update preferences - given some 
> description of the preferences)
> 
> ?- a menu, ready to extend or remove, with abstraction of the functionality
> 
> ?- maybe a status bar
> 
> ?- some groups that handle resizing well
> 
> ?- multiple cards should be involved
> 
> ?- probably simple SQL (i.e. sqlite + your DBLib)
> 
> And of course the most difficult part will be writing the e-book that 
> describes the app, what it does, and maybe why those particular methods 
> were chosen over some of the alternatives.
> 
> Then the sequel would cover mobile, so adding features like a Header 
> Bar, segmented control, using library to overlay controls with native 
> controls as needed, ... as well as describing the hoops one needs to 
> jump through to actually do mobile developments.
> 
> Further sequels could then cover additional features - again for 
> architecture and example, not just to make it a more complicated app. 
> For example: toolbar, pane splitter, data grid, ...
> 
> Alex.
> 
> P.S. I'd be happy to collaborate on doing the development part - but I 
> suspect you'd be quicker without me :-)
> 
> P.P.S title suggestion "The Soul of a New 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: Text field in Windows standalone not receiving keyboard focus

2021-01-31 Thread Andrew at MidWest Coast Media via use-livecode
It turns out that this bug was actually another bug manifesting itself. There 
was a rogue browser widget (not visible) hiding in another group on the card 
gobbling up keystrokes on Windows platform. 
https://quality.livecode.com/show_bug.cgi?id=19023 
<https://quality.livecode.com/show_bug.cgi?id=19023>

What’s worse is that the same bug bit me in the ass a year ago too. Fool me 
once, shame on you. 

-Andrew Bell


> 
> Try comparing the properties of a group that works with the one that 
> doesn't. Also compare individual field properties, in particular check the 
> traversalOn, autoHilite, and lockText. That alone wouldn't explain why it 
> appears to fix itself occasionally, but could point to a script that 
> changes one of these properties.
> 
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
> On January 28, 2021 3:33:39 PM Andrew at MidWest Coast Media via 
> use-livecode  wrote:
> 
>> I have an app with a group of fields who are struggling to accept keyboard 
>> input. It seems to just be 1 group of 4 fields on a single card (that has 
>> been noticed). You can click in the field and the blinking I-bar is 
>> inserted, but typing on the keyboard does nothing. Pasting text into any of 
>> these fields seems to unlock the ability to type, as does switching to 
>> another application and switching back, but only until you leave the card 
>> and come back again.
>> 
>> This ONLY happens in executable on Windows, not in IDE and never on Mac 
>> (where I am developing which is why I missed the bug in testing). Once you 
>> unlock 1 of the 4 fields in the group they all unlock until you leave the 
>> card and come back where the problem manifests again.There is another group 
>> of text files (hidden so not on screen the same time as the offending 
>> group) that accepts keyboard input fine without any hacks which points to a 
>> problem with the group. There are no scripts on the field or group itself. 
>> I have already tried a ?focus on nothing? without any luck.
>> 
>> -Andrew Bell
>> ___
>> use-livecode mailing list
>> use-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: Text field in Windows standalone not receiving keyboard focus

2021-01-29 Thread Andrew at MidWest Coast Media via use-livecode

> - add a keydown handler in the field. Is it received?
This is received under the same circumstances described before. I can’t add a 
breakpoint because the Remote Debugger will take focus from the standalone, 
which is one of the known workarounds. If I add an answer “foo” the focus is 
properly shifted to the field after the modal.

> - add a keydown handler in the card. Who's the target?
The card also doesn’t receive this message until the focus issue is resolved as 
described before… interesting. 

> - any front script or other library intercepting keystrokes?
Nope

> - any behaviors?
Datagrid, but not on this field or parent group.

> And if the normal culprits are exonerated, don't forget the more obscure 
> and exotic possibilities:
> 
> - white text, or textshift?
Nope, standard text that displays as soon as focus is properly received.

> - text added but clipped by a tabstop?
No tabs

> - does all your startup code get executed? (And preopencard/stack code?)
No errors thrown

> - is this a real Windows machine or virtualized setup?
Win10 Boot Camp install running through Parallels, but the client who 
complained is on native Win10 box.




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


Text field in Windows standalone not receiving keyboard focus

2021-01-28 Thread Andrew at MidWest Coast Media via use-livecode
I have an app with a group of fields who are struggling to accept keyboard 
input. It seems to just be 1 group of 4 fields on a single card (that has been 
noticed). You can click in the field and the blinking I-bar is inserted, but 
typing on the keyboard does nothing. Pasting text into any of these fields 
seems to unlock the ability to type, as does switching to another application 
and switching back, but only until you leave the card and come back again.

This ONLY happens in executable on Windows, not in IDE and never on Mac (where 
I am developing which is why I missed the bug in testing). Once you unlock 1 of 
the 4 fields in the group they all unlock until you leave the card and come 
back where the problem manifests again.There is another group of text files 
(hidden so not on screen the same time as the offending group) that accepts 
keyboard input fine without any hacks which points to a problem with the group. 
There are no scripts on the field or group itself. I have already tried a 
“focus on nothing” without any luck.

-Andrew Bell
___
use-livecode mailing list
use-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: Considering work with livecode server

2021-01-20 Thread Andrew at MidWest Coast Media via use-livecode

> Thanks Kee, but I am a bit puzzled by the restriction.
> 
> That would require complicity from the businesses, which if reputable would 
> be a stretch, no? For example, if I had an app that linked to course 
> selections on University websites, are they going to suggest that these could 
> be portals to pedophile shopping sites by entering a secret pass phrase? By 
> the sounds of it, please correct me if I am wrong, no iStore app can link to 
> a website for content regardless of the status of the organization that 
> stands behind the site? H, I still have a lot to learn in this space. 
> 
> Are there any links available to guidelines that describe these limitations?

The guidelines don’t matter much because you’re at the mercy of whatever tester 
get’s your build to approve: it seems to be very subjective by reviewer. What I 
have found is that you can have some website stuff, but you need some mobile 
app specific features as well (push notifications, location services, etc.). It 
has also been my experience that “leading” with the web content isn’t as 
successful as opening with some static content. YMMV

Last week I got a brand new app approved (for TestFlight, not fully released 
yet but is the same approval process) for a University that contains a web 
viewer. This is only 1 of half a dozen cards in the app, and goes directly to a 
mobile landing page for a particular department. You are free to click around 
and visit the site, but you can’t manually enter a URL into a field and visit 
that site you are “stuck” with whatever links we provide. Since this isn’t the 
main focus, and is fairly contained, I had no worries about this being an issue 
(and it wasn’t). If you message me off-list with your AppleID, I’d be happy to 
add to TestFlight so you can see what I’m talking about.

But I have had apps with services that were “coming soon” so to start there was 
some bare bones content and a few browser widgets going to specific pages on a 
business website: this got rejected due to Apple’s 4.2 Minimum Functionality 
clause. After rushing to add a feature or two, and make sure those cards were 
the first to appear rather than the browser widget, got the barebones project 
approved. (A year later, the client still hasn’t paid to finish the project so 
it’s still sitting in the App Store at v0.4.03)

—Andrew Bell
___
use-livecode mailing list
use-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: Building a Standalone MacOS App in 9.6.1

2021-01-06 Thread Andrew at MidWest Coast Media via use-livecode
So far I have been able to explain to my limited client base that this can be 
side stepped, and they are ok with that for now (AKA don’t want to pay for the 
necessary upgrade that will be needed). 

If you double-click to open the app you will get a notice that the app isn’t 
notarized and you can’t launch. If you right-click (ctrl-click) on the app and 
select Open rather than double-clicking to open, your user will be given notice 
that the app isn’t notarized but will allow them to launch anyway. 

I don’t see the notice when developing personal apps for use on my own machine. 
I’m assuming this is because the Developer key (or certificate?) is on my 
keychain so the app is somewhat verified.

—Andrew Bell

> 
> Date: Wed, 6 Jan 2021 16:17:23 +0100
> From: Tore Nilsen 
> To: How to use LiveCode 
> Subject: Re: Building a Standalone MacOS App in 9.6.1
> Message-ID: <84be53be-afd1-4fa2-b874-5d22b4eda...@me.com>
> Content-Type: text/plain; charset=us-ascii
> 
> 
> 
>> 6. jan. 2021 kl. 15:48 skrev Paul Dupuis via use-livecode 
>> :
>> 
>> macOS Catalina or Big Sur apps have to be code signed AND notarized. You 
>> must have the command line tools installed and there is a non-trivial number 
>> of commands you have to execute to prepare you app for code signing, then 
>> code sign it, and then notarize it, including obtaining an app specific 
>> password from Apple.
>> 
>> Livecode has a pretty decent tutorial on their web site on the whole lengthy 
>> process.
>> 
> 
> I can happily build a MacOS app without code signing or notarizing the app 
> from Big Sur and Catilina. I guess this is needed for an iOS app, but then 
> again you cannot build an iOS app with LiveCode Community
> 
> Best regards
> Tore Nilsen
> 


___
use-livecode mailing list
use-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: reading QR-code on Mac from an imported image

2020-11-23 Thread Andrew at MidWest Coast Media via use-livecode
You should be able to use mergAV with the source set as library or album. I use 
the live camera (“video”) to read barcodes.
mergAVRequestMediaAccess "video"


--Andrew Bell

on mouseDown

mergAVRequestMediaAccess --“audio” ## DEPRECATED parameter requirement

end mouseDown


on mouseUp

if platform() <> "iphone" then

answer "Sorry, the barcode scanner feature is currently 
unavailable on this platform."

exit mouseUp

else

wait 500 milliseconds with messages

mergAVCamStartBarcodeReader

end if // platform()

end mouseUp


on mergAVCamBarcodeFound pBarcode, pType

answer pType && “barcode found” & cr & pBarcode

mergAVCamDelete

end mergAVCamBarcodeFound





> Subject: Re: reading QR-code on Mac from an imported image
> 
> No idea? Anyone?
> 
>> Am 20.11.2020 um 19:16 schrieb Klaus major-k via use-livecode 
>> :
>> 
>> Hi all,
>> 
>> ist is possible to read the QR-code from an imported image
>> on the Mac? If yes, how?
>> The dictionary did not really enlighten me...
>> 
>> Thanks in advance!
>> 
>> 
>> Best
>> 
>> Klaus
> 
> --
> Klaus Major

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


Apple commissions

2020-11-18 Thread Andrew at MidWest Coast Media via use-livecode
Apple, in what seems to me like a giant screw you to Epic Games (or leveraging 
in current court battles), is cutting their piece of the pie in half for small 
developers: 30% --> 15%
https://www.engadget.com/apple-small-business-program-15-percent-112259064.html 


As someone earning substantially south of $1M annually I am super excited about 
this. Big Sur begins to combine the iOS and macOS platforms opening up a larger 
platform AND offers a larger revenue cut.

-Andrew Bell
___
use-livecode mailing list
use-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 Screen resizing /EXACT FIT not working as before

2020-11-07 Thread Andrew at MidWest Coast Media via use-livecode
I’m having a similar issue with “letterbox” on an a project. It has fit fine 
for years: exact fit on older devices with black bars on top/bottom of newer 
devices. But when I rebuild now, it shows black bars on all 4 sides of an 
iPhone 11. (old build currently on AppStore renders just on top/bottom)

Unfortunately because of how it was designed (for 5s device size with NO resize 
handler), “exactFit” will kill navigation on modern devices. The project needs 
a UI overhaul, and I’m using this as motivation for the client, but it seems 
that somewhere a change was made on how iOS device sizes are determined. I 
noticed a lot of chatter recently about this affecting the iPhone Plus models 
when zoomed. Perhaps Apple made a change in Xcode 11 if nothing has changed in 
LiveCode.

-Andrew Bell
___
use-livecode mailing list
use-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: DG outcomes on desktop vs mobile

2020-10-23 Thread Andrew at MidWest Coast Media via use-livecode
This happened to me, twice, in a project I just launched. I was in crunch so 
didn’t have time to properly document but something happened where the DG 
wasn’t loading. I could take the same dgData or dgText and load it to another 
DG fine. Being on mobile made this harder to debug because even with Remote 
Debugger I would still have to compile and launch to the simulator each time I 
tried a tweak.

Because I was up against a deadline and since I wasted several hours trying to 
troubleshoot I just replaced the DG with a brand new: everything worked. Didn’t 
even bother to troubleshoot the 2nd time it happened, just immediately made a 
new DG and moved on.

Not a definitive answer to your question but an acknowledgement of your problem.

—Andrew Bell

> I'm building an iPad app that reads a bunch of files into an array and 
> then sets the dgData of a form DG to that array. The array is 
> well-formed for DG use. After setting the dgData of the DG, the result 
> is empty. Only one problem: the DG now contains no data. (I also tried 
> setting the dgText of the DG to a flat version of the same data and got 
> the same outcome.)
> 
> I can then create another array from custom property data and set the 
> dgData of the same form DG to that array and it works.
> 
> On the desktop, however, the same DG loading process never fails.
> 
> The data being loaded is all text - nothing esoteric.
> 
> Does anyone have any ideas how I can find & fix the problem(s)? Or have 
> you run into this before?
> 
> Thank you -
> Phil Davis


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


Re: LC iOS Command 'mergPopActivity'

2020-10-18 Thread Andrew at MidWest Coast Media via use-livecode
The limited documentation is at http://mergext.com/home/mergpop/ 

Glad to hear that Elanor might be working on some more documentation. This 
feature (like push notifications and mobile camera) are difficult to test since 
the emulator either doesn’t work or has extremely limited functionality.

I found this code snippet in an old project where I was taking a screenshot of 
part of the screen and trying to share to Facebook or Twitter.

export snapshot from rect tExportRect of this card to file tFilePath as PNG

mergPopActivity "Indiana On Tap just hooked me up!",tFilePath,”"


—Andrew Bell


> 
> Message: 13
> Date: Sun, 18 Oct 2020 12:58:50 +0200
> From: Graham Samuel 
> To: How to use LiveCode 
> Subject: LC iOS Command 'mergPopActivity' [was Re: The iOS "Files"
>   folder]
> Message-ID: <769b3120-fcf5-4ecb-9683-ac0a303e2...@mac.com>
> Content-Type: text/plain; charset=utf-8
> 
> I have been trying to use this command, initially to allow an iOS app to put 
> something in the ?Files? folder on an iPhone, but I?m now more interested in 
> the whole idea of Activity Views and how to exploit them in an iOS app. I 
> believe that the LC ?mergPopActivity' command is a wrapper for some function 
> in the iOS native universe - connected with ?UIActivityViewController', but 
> so far I haven?t worked out which one, since I don?t really understand much 
> of Apple?s iOS Developer documentation (I always hope that using LC removes 
> the need to do so!).
> 
> Elanor Buchanan of the mother ship has been extremely helpful about this, and 
> has said she hopes to improve the almost non-existent documentation of this 
> command, but meanwhile I?m interested if anyone on this list has any 
> insights, as I?m quite stuck and don?t want to bug Elanor too much.
> 
> When you invoke the ?mergPopActivity' command in an LC script, it opens a 
> modal window which gives a gateway into services available on your device, 
> like email, printing, saving to ?Files?, sending to social media etc - it 
> depends on what your device is capable of, and the apps it has loaded; so I 
> believe that the LC command essentially implements the ?sharing? activity in 
> iOS, which is usually invoked via an icon consisting of a square with a 
> North-pointing arrow in it. 
> 
> So far so good, but I?ve only been able to do one thing so far, which is to 
> offer a text string originating in the app to these various services. So far 
> I have not been able to find a way to offer a file (for example, a file 
> containing a text rather than the text itself - easy to generate within an 
> app, but no luck in offering to email it etc). There is a ?URL? parameter but 
> I can?t work out what it does.
> 
> Anyone got any clues or shall I apologise (again) to Elanor and ask her for 
> more help?
> 
> Graham
> 
> --
___
use-livecode mailing list
use-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: The iOS "Files" folder

2020-10-13 Thread Andrew at MidWest Coast Media via use-livecode

> It looks from the minimum documentation I have that you could do much the 
> same with an image, but I have not tried it. 

I use this in a (now abandoned) feature of an app to take a screenshot of the 
mobile stack and share the image. Switched to this after mergSocial stopped 
working when Apple made some core OS updates. The entire MergExt suite is 
extremely powerful and extremely under-documented. 


put specialFolderPath("documents") & "/IndianaOnTap.png" into tFilePath
put the rect of this card into tRect
put the bottom of field "promoName" into tBottom
put item 1 of tRect & COMMA & item 2 of tRect & COMMA & item 3 of tRect & COMMA 
& tBottom into tExportRect
export snapshot from rect tExportRect of this card to file tFilePath as PNG
mergPopActivity "Indiana On Tap just hooked me up!",tFilePath,""


—Andrew Bell
___
use-livecode mailing list
use-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 Andrew at MidWest Coast Media via use-livecode
My apologies to Mike AND Mark on the misquote, and *bump* to this bug. I had 
too many QC tabs open for bugs, am I right? ;) 

Is there a way to send a mobileControlSet “delayTouches” command to the 
scroller created? I wasn’t sure how to get the ID since the DataGrid code made 
the scroller. 

-Andrew Bell

> 
> Subject: Re: DataGrid 2 swipe actions
> Message-ID: <166ab8a2-7e58-2303-4d72-f366960d9...@sonic.net>
> Content-Type: text/plain; charset=utf-8; format=flowed
> 
> On 8/26/20 9:36 PM, Andrew at MidWest Coast Media via use-livecode wrote:
> 
>> The highlighted row when scrolling is a separate bug patched by Mike Wieder  
>> https://quality.livecode.com/show_bug.cgi?id=22798 
>> <https://quality.livecode.com/show_bug.cgi?id=22798> awaiting a GitHub 
>> merge, but turning on delayTouches makes the swipe animation jerky because 
>> the scroller has to decide if it?s scrolling first so the swipe controls 
>> aren?t very responsive. Would be curious if these two things can live in 
>> harmony. Any DG2 advice?
> 
> That's actually Mike Kerner's fix. I just added a comment. Or two.
> Trying to prioritize getting it looked at.
> 
> -- 
>  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


DataGrid 2 swipe actions

2020-08-26 Thread Andrew at MidWest Coast Media via use-livecode
I was inspired by today’s Lockdown Learning Series presentation and looked at 
adding swipe gestures to a current project. This whole process made WAY more 
sense after re-watching Michael’s presentation (I saw it live too, but was over 
my head last year). I’m struggling with a large DG. I’ve got my custom swipe 
controls working and triggering custom swipe actions. But I’m having problems 
with my mouseDown.

If there is a swipe control open and you tap a different visible row, the open 
swipe control is closed (with or w/o animation). 
If there is a swipe control open and the DG scrolls to a point where that 
control is no longer on-screen, that swipe control doesn’t close even though a 
new row is highlighted. 

The closest workaround I could come up with was to check for vertical scroll 
and just kill all swipe controls. Is this expected behavior or bug?

on scrollerDidScroll pHScroll, pVScroll
if pVScroll > 50 then
dispatch "RowSwipeHideControl" to group "DataGrid" with TRUE
end if
end scrollerDidScroll

The highlighted row when scrolling is a separate bug patched by Mike Wieder  
https://quality.livecode.com/show_bug.cgi?id=22798 
 awaiting a GitHub merge, 
but turning on delayTouches makes the swipe animation jerky because the 
scroller has to decide if it’s scrolling first so the swipe controls aren’t 
very responsive. Would be curious if these two things can live in harmony. Any 
DG2 advice?

-Andrew Bell
___
use-livecode mailing list
use-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 Andrew at MidWest Coast Media via use-livecode
Sean-

My degree is in TV/stage production and digital design. I’ve built web sites 
(HTML, WordPress, LiveCode), produced/directed broadcast and streaming 
programs, and delivered custom software on Mac/PC/Web (using Director and 
Flash), and now Mac/PC/iOS/Android using LiveCode (because you’re right, the 
HTML5 port isn’t ready for primetime).

Anyone who thinks pixel perfection across mediums is possible has never worked 
on a web platform; this usually ends up being UI designers who only work in 
theoreticals. That InDesign file they mocked up might look great saved as a PDF 
or printed on a specific coated paper using Pantone inks, but those CMYK colors 
and Post Script fonts are rendered using RGB and WOFF in a web browser or 
desktop computer so they won’t look the same: and there’s not a damn thing you 
can do about it (short of making everything an image, but you still can’t 
make-up for the color gamut differences). The WYSWIG hacks that sufficed in the 
90s/00s to make things visually similar were always shoddy at-best creating 
hundreds of additional lines of code and won’t pass muster with current 
accessibility standards even if they did "work".

Fonts have ALWAYS been one of the most difficult parts of app development. 
Whether it’s getting legal fonts (the good ones aren’t cheap, and the cheap 
ones aren’t good), or cross-platform fonts (not every OS reads the same format, 
and not every font is available in multiple formats). The closest I’ve come has 
been to run some scripts when populating text fields to make sure they fit the 
dimensions allotted in the design. Text doesn’t fit in box? Reduce the fontSize 
by 1 until it does. Text doesn’t fill the space? Increase the fontSize by 1 
until it does. It’s a PITA, so I usually add this in at the end since the art 
department seems to have another “small change” along the way.

Programming isn't a science as much as an art. With your broadcasting 
background you understand that a projects aren’t “done” until the deadline: 
there is ALWAYS something else you would have tweaked if you had more time (2 
weeks?!?). But I get it: producers are generally unreasonable eggplant emojis 
that are notoriously difficult to please.

While LiveCode DOES require some if platform() conditionals, I can only imagine 
coding this in Swift and Java (even for a unicorn proficient in BOTH) would 
still take much longer and NOT give the pixel perfection you are referring to. 
I say “imagine” because I don’t know, and never had to learn, those languages 
since I could easily pick-up LiveCode from the various programming environments 
I’ve previously developed for. My copy of Microsoft Windows looks different on 
my iMac than it does on my Dell, and it wasn’t a fireable offense for the 
development team.

—Andrew Bell
___
use-livecode mailing list
use-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: Integrating Desktop or mobile application with LMS using LTI 1.3

2020-08-06 Thread Andrew at MidWest Coast Media via use-livecode
I would be excited to help test this! The higher ed school I work with uses 
Canvas by Instructure, a large open-source LMS. You can find documentation at 
https://github.com/instructure/canvas-lms/wiki

—Andrew Bell 

> 
> Thanks for the responses.  I am still actively working on this.  
> 
> I have hired a summer intern. Molly,  to work on this.  She has been getting 
> up to speed on LiveCode and LTI 1.3 and now she is turning her attention to 
> working on a proof of concept stack to connect with an LMS system and send 
> commands and receive responses and process them.  
> 
> Indeed we have found that LTI 1.3 is supported by many LMS?s to varying 
> degrees and some still just support LTI 1.1 currently. (There is a LTI 2.0 
> but that is a deprecated standard. 
> http://www.imsglobal.org/lti-security-announcement-and-deprecation-schedule)  
> The LMSs we have looked at also have their own APIs which seem to have 
> features beyond what the LTI feature set is but still looking at this. 
> 
> I am not at the point yet where I can open source it and I am not really sure 
> how to go about that. (Don?t know how I would sell it either but probably not 
> much of a market for it.)  I have my main app on GIT using Monte?s lcVCS but 
> if I did want to go open source with this library I want to to do something 
> simpler like a script only stack library and maybe do a Demo app based on 
> Trevor?s Levure App Framework 
> https://livecode.com/products/livecode-platform/levure/ to make it easier to 
> use git.   Does this sound like a good approach?
> 
> We are also looking for a way to access a sandbox with one of the LMS?s to 
> test the proof of concept app against.  If anyone has info on that that would 
> be appreciated.
> 
> Martin


___
use-livecode mailing list
use-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: WebSites made using Livecode.

2020-07-07 Thread Andrew at MidWest Coast Media via use-livecode

> In my own personal and subjective experience, LiveCode shines when you are
> building desktop applications, or combining desktop applications with
> server-side solutions. 
> With LC you can ship a whole suite of desktop and mobile apps that act as
> companions to the business your client is doing while still delivering a
> webapp as the user facing part of your contract.

This is a truth bomb. 

LiveCode server solution:
At the beginning of the pandemic, I used LiveCode server to setup a beer 
delivery system for my cousin’s brewery. Users put in their address, I use a 
Google Maps API to check driving distance (to make sure they are close enough 
and charge the appropriate delivery fee), once location is verified I use an 
Untappd API to query their tap list and filter out drafts (because this for 
to-go only), then let the consumer choose the quantity and place their order. 
NO payments are going through this system, they already had a 3rd party vendor 
they used for that. 

https://www.midwestcoastmedia.com/beta_ltd/delivery.html 
 


LiveCode solution:
While it may not fully fit the spectrum of your question, I’m working on a 
website right now powered by LiveCode. I have a custom backend interface for my 
client to make changes in (PC app). They upload data to a LiveCloud account 
(not an official Mothership tool, but a great database resource built on/for 
Livecode). That database data is then used to piece together a website. I found 
an HTML5 template from Envato Marketplace and licensed it for ~$20USD, modified 
the template site Dreamweaver to match my client’s branding, then chopped it up 
into little chunks that get collated together. LiveCode server is only really 
triggered when using one of the forms; the page is .html but the form action 
POSTs to  .lc which fires off an email after checking for SPAM.

This same data, and the desktop backed that powers it, supplies all the content 
for a companion mobile app (iOS and Android) that I am also building in 
LiveCode. Some mobile specific options are taken advantage of here like 
Local/Push Notifications.

Project hasn’t officially launched yet, but you can take a sneak peek @ 
https://www.whitestownparks.org/ 

—Andrew Bell
___
use-livecode mailing list
use-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

2020-06-21 Thread Andrew at MidWest Coast Media via use-livecode

> I am again looking at implementing Javascript charts within a LC browser.
> Looking at amCharts.
> Got a chart displaying easily within the browser widget.
> Tries to print the card but the widget does not print.


I’m using amCharts in another project and ran into the same problem: everything 
looked right in Live view but would disappear when I tried to print a PDF. The 
only way I could get them to appear right was by taking a picture of the 
browser and using that image instead of the live JavaScript in the browser 
(widget). I think hh keyed me into this with his epic knowledge of this tool

  set the width of templateImage to the width of widget "Browser"
  set the height of templateImage to the height of widget "Browser"
  export snapshot from rect globalRect(the rect of widget "Browser") to 
tSnapshot as JPEG
  create image “renderedBrowser"
  set the visible of widget “Browser” to FALSE
  put tSnapshot into image tSnapshotName
  set the name of image tSnapshotName to tSnapshotName
  set the loc of image tSnapshotName to the loc of widget “Browser"

—Andrew Bell
___
use-livecode mailing list
use-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: Catalina Entitlements or Permissions (was Possible Catalina problem)

2020-06-18 Thread Andrew at MidWest Coast Media via use-livecode

> http://newosxbook.com/ent.jl
> 
> Now, if only I could figure out from the database which ones I need to add.

Wow, that is an AWESOME tool! I hate that Apple won't pull a single engineer 
off a project to write some documentation. A similar solution I use is to 
make-up for Apple’s confusing developer matrix is https://xcodereleases.com/

I think you’re on the right track about figuring out entitlements via that 
database. By randomly selecting some Executable files that I was familiar with 
(iTunes, TextEdit, etc.) it looks like you might be interested in:
com.apple.security.files.user-selected.read-write
com.apple.security.files.user-selected.executable 

com.apple.security.device.camera 

com.apple.security.device.microphone 

com.apple.security.app-sandbox 
 
<— not really sure about this one

—Andrew Bell
___
use-livecode mailing list
use-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: revCopyFolder - execution error in standalone

2020-06-08 Thread Andrew at MidWest Coast Media via use-livecode
What flavor of macOS is this standalone trying to run? I’m guessing it has to 
do with the enhanced disk permissions in the newer versions. You might need to 
check System Preferences > Security & Privacy > Files and Folders or Full Disk 
Access for a blocker.

—Andrew Bell

> 
> Clarification - ?revCopyFolder" it is working on Windows but not on Mac. 
> Standalones built with LC 9.6 release version. revMoveFolder is working on 
> both.
> 
> Marty
> 
>> On Jun 5, 2020, at 11:32 AM, Marty Knapp  wrote:
>> 
>> I'm trying to implement "revCopyFolder" in a standalone. It works fine in 
>> the IDE but gets an "execution error" in a standalone. In the dictionary it 
>> says the "Common library" is implemented. I am manually setting inclusions 
>> and don't see anything there that hints at this. Is there some library that 
>> I need to select? I have been using revMoveFolder successfully in this same 
>> standalone. Any tips?
>> 
>> Thanks,
>> Marty
> 
> 

___
use-livecode mailing list
use-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: ADA Compliency

2020-06-01 Thread Andrew at MidWest Coast Media via use-livecode

I’m glad this has been brought up as I have done some internal investigation 
myself, with mixed results. A higher education institute I work for pushes us 
hard for a11y forward workflows (to the point where we’re supposed to include a 
text description of any MEMEs we post in the official Slack channel). This made 
me aware of some common issues and tools for adaptive technology.

As Curry mentioned (bravo for the excellent thread), there are LOTS of 
impairments to consider with absolutely zero practical way of accommodating 
them all. For the sake of web/mobile most usability requirements would tend to 
land on touch/motor (adaptive input), vision (text size, screen colors, text to 
speech), and hearing (transcripts and audio descriptions). iOS has some great 
accessibility features built-in that (I’ve been told by our “experts”) are the 
most common tools for the platform. 

So I gave them a go with a simple Livecode stack consisting of:
- native text field with content
- Livecode text field with content
- native button
- 3 Livecode text fields next to each other

A basic test that I tried was using the VoiceOver option. This is basically 
text to speech at the OS level. Everything in my Livecode app was recognized as 
“possible text” by the OS, including the system clock in the corner, but not 
even the native text fields were “recognized" as text. This worked ok if the 
text had a wide line length across the whole screen, but fell apart if fields 
with word wrap were placed next to each other (columns were ignored and reads 
across the entire screen, then goes “down a line” and reads across the screen, 
etc.). None of the text options take into account the Display & Text Size 
system settings.


—Andrew Bell
> 
> 
>> Re: ADA Compliency (Curry Kenworthy)
>> From: Curry Kenworthy 
>> Subject: Re: ADA Compliency
>> 
>> 
>> Rick:
>> 
>>> I have a couple of questions for you.
>> 
>> Thanks Rick! I do appreciate the concern. But in my post, your questions 
>> were already either answered or otherwise addressed before you asked. I 
>> anticipated them; I know what makes people tick! So I'll "re-answer" 
>> partly by quoting myself.
>> 
>> But when certain memes are burned so deep into community psyche that 
>> answers bounce right off, I feel like we're heading back toward the old 
>> failed group think. The same old patronizing ideas and faulty 
>> assumptions, while actually ignoring both the main point and the details 
>> of what I posted about UI.
>> 
>> Somehow we have to SHOUT louder than those old memes to get through!
>> 
>>> Is a trackpad or a trackball any better of an experience for you?
>> 
>> Heck no! Emphatically no. Much, much worse. Much more difficult. That's 
>> why I emphasized my mouse use already, to avoid precisely this type of 
>> inevitable question. Just be aware that the old oh handicap people 
>> should use blah blah mindset - the memes are sometimes true, but more 
>> often not.
>> 
>> Mouse = good. For handicap man too!
>> Trashing a UI to replace scientific arrangement with lickable = bad.
>> 
>> I said: "I'm very comfortable using the mouse if set up correctly. I 
>> switched to Windows for my main work, and that helped save energy and 
>> improve accuracy."
>> 
>> Thus, problem mostly solved on my end, at least when using apps and web 
>> sites with non-crappy UI. Pretty easy solution. Handicap man happy.
>> 
>> But problem not solved on Apple's end. Handicap man sad for Apple!
>> It really was a lousy move, destroying a once superior interface.
>> 
>>> Have you tried using the mac OS voice commands or controls?
>> 
>> Strike two! Think carefully about the implications of what I said: "I 
>> can only say a few words without getting out of breath."
>> 
>> For people with good breathing, this is a very good thing for typing or 
>> for no-hands computer use. But imagining it would be more efficient than 
>> mouse for the ability levels I described - and imagining I'm suffering 
>> here because I just haven't tried trackpad or voice recognition (I've 
>> built Mac apps with voice recognition) - no way. Totally unrealistic!
>> 
>> Now, a mental interface might be good, that's another story. Some 
>> interest there, for the future. But I'm not anywhere near ready for that 
>> yet. Privacy concerns etc, plus very importantly - use it or lose it. 
>> Without that exercise, the fingers are toast, and I need those guys. 
>> Maybe when I'm 80. Maybe I'll design it myself now and use it then.
>> 
>>> Apple has the money and resources to do it.
>> 
>> No, probably they don't. They can't. They don't have the brains (or the 
>> paradigm) to allow them to do it, not anymore. Not for any amount of 
>> money; mental assets are the most crucial. It's sad. I was a huge fan.
>> 
>> But enough about Apple - as I said, this is a pretty-much universal 
>> problem. Only using them as a small example of the problems:
>> 
>> - Binary thinking about physical abilities
>> - Trotting out the same 

Re: LC 9.6.0 RC1 Splash/Launch Images

2020-05-22 Thread Andrew at MidWest Coast Media via use-livecode
I had the same problem when creating storyboards: the icon was too big. My app 
was portrait so I could tell the dimensions were backwards, but when using the 
the recommended sizes the logo ran off the edges. Placing the 1x version in the 
2x slot (and the 2x in the 3x slot) seemed to make things look more like what I 
expected.

Making the first card of the stack have the same background color as the 
Storyboard worked fine, then just...
unlock screen for visual effect
go next card
unlock screen with visual effect “dissolve” very fast

—Andrew Bell


> *>and the Simulator showed the splash screen too large for the screen
> of the device *
> 
> Hmm, then I would expect the splash to show too large in the physical
> device as well. In this case, I would try with a smaller splash.
> 
> Kind regards,
> Panos
> --
> 
> On Fri, 22 May 2020 at 15:25, Graham Samuel via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> 
>> I did that, so fine, but noticed two issues: when making the standalone LC
>> 9.6.0 rc1 reported that I hadn?t provided a portrait splash screen for
>> iPad, when in fact there is no way of doing so since the storyboard change;
>> and the Simulator showed the splash screen too large for the screen of the
>> device (an iPhone XS). (Not sure if the real app does that as I?m having
>> trouble uploading - that?s a different conversation.)
>> 
>> Graham


___
use-livecode mailing list
use-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: mergAV Select specific rear camera

2020-04-30 Thread Andrew at MidWest Coast Media via use-livecode
“Bug” submitted, though this is probably a Feature Enhancement in hindsight.

https://quality.livecode.com/show_bug.cgi?id=22714 


-Andrew Bell
___
use-livecode mailing list
use-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: mergAV Select specific rear camera

2020-04-30 Thread Andrew at MidWest Coast Media via use-livecode
The only devices that are returned by mergAVCamGet(“video devices”) is:
com.apple.avfondation.avcapturedvice.built-in_video:0   Back Camera
com.apple.avfondation.avcapturedvice.built-in_video:1   Front Camera

mergAVPick(“rear camera”) brings up the native camera controls, but my goal is 
to have a live feed from the camera but WITHOUT all the overlays the native 
camera adds. I can do this easily with the mergAV demo stack, but can’t access 
all the features.

I’ve been able to utilize the mergAVCamGet/Set("zoom”) to work on the normal 
(non wide-angle) lens from 1x to 2x but it won’t go all the way to 3x or down 
to 0.5x like the native camera will do (0.5x-1x by using the wide-angle, not 
sure why I can’t use 2x-3x even without a telephoto lens if the native control 
does).

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


mergAV Select specific rear camera

2020-04-30 Thread Andrew at MidWest Coast Media via use-livecode
I’m using mergAv to access video on mobile. I can access the front camera but 
only one of the rear cameras on my iPhone 11, the 1x “normal” lens rather than 
the 0.5x “wide angle”. Is there a way to access the multiple lenses that Apple 
has on their newer devices?

—Andrew Bell 
___
use-livecode mailing list
use-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: Making an iOS app look like one

2020-04-16 Thread Andrew at MidWest Coast Media via use-livecode
>  -  Fields to display information, some of which must allow input via 
> keyboard or pasting. Although there is a Native Android Field widget, there 
> isn?t one for iOS, so I don?t know what my options are. I want the kind of 
> fonts and font sizes that are typical of iOS, but so far I haven?t found a 
> reference to these properties in the LC documentation. I found a command, 
> mobileControlCreate, which it appears can only function dynamically in a 
> mobile app, which seems to mean I can?t create and place controls until the 
> app is running. I find that confusing.

No native iOS field yet, and hopefully a “mobile field” widget that is more 
cross-platform gets added at some point. For now what I do is use standard 
fields and add the mobileControl options to basically create native mobile 
fields over top of your standard fields and pass the information back and forth 
using mobileControlGet and mobileControlSet. This let’s me test in the IDE w/o 
compiling for device as often.

http://lessons.livecode.com/m/4069/l/29112-how-do-i-use-native-text-controls-on-mobile

>  -  Small, tidy icons, for use as the equivalent of menus or menu items, for 
> example acting as links to various settings cards - so typically an image 
> like a cogwheel for example. I would like these to be SVG, but none of LC?s 
> SVG images have the necessary unchunky look. Do I have to create them from 
> scratch (it would not be the end of the world if I did, but I imagine that 
> there?s a library of them somewhere).

The SVGs in the current library are FontAwesome 4. They were good at the time, 
but are outdated now with the release of 5.13.0 (which includes COVID icons). I 
lucked out and bought a lifetime license when they ran a Kickstarter campaign a 
couple years ago which gives greater access, but even the free options are 
decent.

>  -  ?Done? type buttons (there is a built in widget for this but it doesn?t 
> end up looking like the ?done? buttons I see on typical apps) and other 
> buttons to start off processes or displays.

There is a widget pack to help with this, but I’ve always just made my own 
option that skirted the HID requirements of both major app stores without fully 
adhering or breaking them (of all the times my apps have been rejected it has 
NEVER been from native interface issues). Scott Rossi has some amazing assets 
to help with this.

http://tactilemedia.com/blog/2018/05/12/blasts-from-the-past/

>  -  Some kind of control that acts like a radio button group, so that one 
> option is chosen to the exclusion of any others in the group (I suppose it?s 
> a picking list, but I don?t know how to implement such a thing in an 
> iOS-compatible way and the widgets on offer are specialised to date and time)

After skinning them, radio buttons should act the same in mobile as they do on 
desktop since you aren’t using a native solution.

https://forums.livecode.com/viewtopic.php?t=22169 


> 
> 
—Andrew Bell
___
use-livecode mailing list
use-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: Problem simulating a location (Graham Samuel)

2020-04-14 Thread Andrew at MidWest Coast Media via use-livecode
> 
> From: Graham Samuel 
> I suppose I can try the test on a real phone, but I would rather stick to the 
> simulator for now.
If you have a physical device, regardless of age, try it. There are some things 
that either don’t work (like camera) or are spotty in the emulator.


> And I haven?t found out how LC knows I?ve got a provisioning profile 
> (separate problem I admit).

When you download from the Apple Developer site, just double-click the 
provisioning profile to open it in Xcode. Livecode will know it’s installed 
next time you open the Save As Standalone window (but won’t recognize if you 
install while that window is open)
> 
—Andrew Bell
___
use-livecode mailing list
use-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 started with geographical coordinates

2020-04-03 Thread Andrew at MidWest Coast Media via use-livecode
I feel that Calculate Distance script has been shared before, because it looks 
strikingly similar to one that I use in my mobile app (and is WAY better 
written than I ever could have done), so thank you.

Recently I was tasked by my cousin to come up with a delivery system for his 
brewery since they can only serve carryout during COVID. I did this using 
LiveCode server (https://midwestcoastmedia.com/beta_ltd/delivery.html 
) with Google Maps (and 
Untappd) APIs. Your post made me realize that I can update my current basic 
mobileLocation usage from just the “you are this far away” model to a “here’s 
how to get here” system. 

So thanks EVERYONE on this refresher! 
Here is the relevant code if anyone else finds it of interest. I was using 
$_POST values from an HTML form but you could easily modify the origin and 
destination to a number of formats:
## https://developers.google.com/maps/documentation/directions/start
put urlEncode("12365 N Dumont Way, Littleton, CO 80125, USA") 
into tOrigin // his brewery
put 
"https://maps.googleapis.com/maps/api/directions/json?origin=; & tOrigin & 
"=" into tAPIurl
put urlEncode(tAddress1 & COMMA && tCity & COMMA && "CO" && 
tZip & COMMA && "USA") into tDestination
put tDestination after tAPIurl
put "=WHATEVERYOURAPIKEYISGOESHERE" after tAPIurl
put url tAPIurl into tJSON

—Andrew Bell


> 
> Ralph, this is brilliant. I remember trying to do something similar years 
> ago, and giving up because I didn't know how to do the math. I suck at math, 
> or rather I am too lazy and impatient to work the problem. 
> 
> Bob S
> 
>> On Apr 3, 2020, at 14:27 , Ralph DiMola via use-livecode 
>>  wrote:
>> 
>> Graham,
>> 
>> This my distance calculation for what it's worth.
>> 
>> Function distance lat1, lon1, lat2, lon2, unit
>>  -- Calculate Distance between to points
>>  --
>>  --lat1, lon1, lat2, lon2 are in deg.fractionalDegrees
>>  -- Unit
>>  -- if empty then miles
>>  -- K = kilometers
>>  -- N = nautical miles
>>  local theta
>>  local dist
>> 
>>  Put lon1 - lon2 into theta
>>  put Sin(deg2rad(lat1)) * Sin(deg2rad(lat2)) + Cos(deg2rad(lat1)) * 
>> Cos(deg2rad(lat2)) * Cos(deg2rad(theta)) into dist
>> 
>>  put Acos(dist) into dist
>>  put rad2deg(dist) into dist
>>  put dist * 60 * 1.1515 into dist
>> 
>>  switch unit
>> case "K"
>>put dist * 1.609344 into dist
>> case "N"
>>put dist * 0.8684 into dist
>>  end switch
>> 
>>  Return dist
>> 
>> End distance
>> 
>> 
>> Function rad2deg rad
>>  Return rad / PI * 180.0
>> end rad2deg
>> 
>> 
>> Ralph DiMola
>> IT Director
>> Evergreen Information Services
>> rdim...@evergreeninfo.net
> 
> 
> 
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode