Re: Data Persistence

2018-08-04 Thread Mike Bonner via use-livecode
Putting text into a field pro-grammatically doesn't fire the openfield and
closefield handlers so yes, you'd need to add code to your button.  You can
either write the code directly, or you can use send (or dispatch) and have
the field do it.. IE send "closefield" to field "whateverfield"...   But if
it were me, I'd just add the code to the button itself.

Actually, I'd probably have the code once, in the card or stack script that
accepts parameters like the long id of the field, data to be saved and
whatever else so that you have a single handler that will work for all of
your saves.

Something like

on saveIt pLongId,pText
-- code to save pText and associate it with control pLongId
end saveIt

Then you can do..
on closefield
 saveit (the long id of me),(the text of me)
end closefield

Or in a button..
on mouseup
put "Whatever text" into field "myField"
saveit (the long id of field "myField"),the text of field "myField"
end mouseup

Just some thoughts.





On Sat, Aug 4, 2018 at 1:28 PM John McKenzie via use-livecode <
use-livecode@lists.runrev.com> wrote:

>
>  A little less busy now so I can look at my app some more. As you mat
> recall I was asking about data persistence.
>
>  Thank you to the additional people who welcomed me. I contrast this
> with the time I asked a question on Usenet about a scripting language I
> was learning and the first reply told me I was awful (true, which is
> why I was asking questions) and to come back and only ask questions
> when I have the script I posted working.
>
>  As for contributing brains. Yeah... I supposed I could fake
> that part for awhile. Just do not ask for kidneys as you will get
> nowhere there.
>
>  Klaus thank you for mentioning closefield. Did not notice it before
> and it seems like it would be just the thing for me. The data is
> simple, so I think I will start out by trying to save it all in an
> array and doing so every time there is an entry or change to an entry
> using closefield.
>
>  And that brings me to today's follow up question. In some cases I have
> a button that when pressed put the time inside the neighbouring text
> field. So when a plane lands I pressed the button labelled "ATA" and it
> puts the current time into a text field next to the ATA button. How
> would that count as focus?
>
>  Would having the app place something into the field put focus on the
> field?
>
>  What I am really wondering is when it comes to the buttons can I leave
> them be because the text fields have code to save their info when the
> focus leaves or should I add code to the buttons to tell them after
> placing the info into the text field, save same info to an array?
>
>  Thanks.
>
>
> ___
> use-livecode mailing list
> use-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: Using the $_POST global in LiveCode server

2018-08-03 Thread Mike Bonner via use-livecode
Still haven't got a test set up.  So trying the quicker easier way.. Hey
everyone, in which versions of server are sessions not broken?

On Thu, Aug 2, 2018 at 6:17 PM Mike Bonner  wrote:

> Version 7.1.0 doesn't seem to work.  (the version used by on-rev.)  Pretty
> sure its been in this non-working condition for a while.  (again, my faulty
> memory might be wrong)   I'll try and set up a test for later versions, but
> pretty sure things were still working in the 6.x range of server engines.
>
> On Thu, Aug 2, 2018 at 6:03 PM Mike Bonner  wrote:
>
>> Its been a while since I messed with sessions, but that looks right.  I
>> seem to vaguely remember that there is some version of LC server where
>> sessions is broken, but I can't recall for sure.  What version of server
>> are you running?   (IIRC sessions was implemented some time around 4.6.3?
>> And a later version was broken and later fixed)  I'll see if I can relocate
>> the info.
>>
>> On Thu, Aug 2, 2018 at 5:53 PM Tim Selander via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>>
>>> Thanks, Mike.
>>>
>>> This seemed like a good hint/possible solution.
>>> > Another though has just occurred to me also..  If you use session
>>> > variables, you can store the search term in the session, and since the
>>> > browser will re-post on reload, if $_POST and your session variable
>>> contain
>>> > the same search term, its possible (likely?) that it was a reload
>>> rather
>>> > than a new search, then don't do the search. Not sure if this is
>>> helpful,
>>> However, when I tried
>>> >> start session
>>> put "test" into $_SESSION["keyword"]
>>> put $_SESSION[keyword]
>>> stop session
>>> ?>
>>> and the server returned the error
>>>
>>> file "/home/pba/public_html/lifelinesearch.lc"
>>>row 2, col 1:
>>>
>>> This snippet is at the very top of the page, so row 2 is "start session."
>>>
>>> Am I misundertanding the syntax of 'session'?
>>>
>>> Thanks,
>>>
>>> Tim
>>>
>>>
>>>
>>> ___
>>> use-livecode mailing list
>>> use-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: Using the $_POST global in LiveCode server

2018-08-02 Thread Mike Bonner via use-livecode
Version 7.1.0 doesn't seem to work.  (the version used by on-rev.)  Pretty
sure its been in this non-working condition for a while.  (again, my faulty
memory might be wrong)   I'll try and set up a test for later versions, but
pretty sure things were still working in the 6.x range of server engines.

On Thu, Aug 2, 2018 at 6:03 PM Mike Bonner  wrote:

> Its been a while since I messed with sessions, but that looks right.  I
> seem to vaguely remember that there is some version of LC server where
> sessions is broken, but I can't recall for sure.  What version of server
> are you running?   (IIRC sessions was implemented some time around 4.6.3?
> And a later version was broken and later fixed)  I'll see if I can relocate
> the info.
>
> On Thu, Aug 2, 2018 at 5:53 PM Tim Selander via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
>> Thanks, Mike.
>>
>> This seemed like a good hint/possible solution.
>> > Another though has just occurred to me also..  If you use session
>> > variables, you can store the search term in the session, and since the
>> > browser will re-post on reload, if $_POST and your session variable
>> contain
>> > the same search term, its possible (likely?) that it was a reload rather
>> > than a new search, then don't do the search. Not sure if this is
>> helpful,
>> However, when I tried
>> > start session
>> put "test" into $_SESSION["keyword"]
>> put $_SESSION[keyword]
>> stop session
>> ?>
>> and the server returned the error
>>
>> file "/home/pba/public_html/lifelinesearch.lc"
>>row 2, col 1:
>>
>> This snippet is at the very top of the page, so row 2 is "start session."
>>
>> Am I misundertanding the syntax of 'session'?
>>
>> Thanks,
>>
>> Tim
>>
>>
>>
>> ___
>> use-livecode mailing list
>> use-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: Using the $_POST global in LiveCode server

2018-08-02 Thread Mike Bonner via use-livecode
Its been a while since I messed with sessions, but that looks right.  I
seem to vaguely remember that there is some version of LC server where
sessions is broken, but I can't recall for sure.  What version of server
are you running?   (IIRC sessions was implemented some time around 4.6.3?
And a later version was broken and later fixed)  I'll see if I can relocate
the info.

On Thu, Aug 2, 2018 at 5:53 PM Tim Selander via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Thanks, Mike.
>
> This seemed like a good hint/possible solution.
> > Another though has just occurred to me also..  If you use session
> > variables, you can store the search term in the session, and since the
> > browser will re-post on reload, if $_POST and your session variable
> contain
> > the same search term, its possible (likely?) that it was a reload rather
> > than a new search, then don't do the search. Not sure if this is helpful,
> However, when I tried
>  start session
> put "test" into $_SESSION["keyword"]
> put $_SESSION[keyword]
> stop session
> ?>
> and the server returned the error
>
> file "/home/pba/public_html/lifelinesearch.lc"
>row 2, col 1:
>
> This snippet is at the very top of the page, so row 2 is "start session."
>
> Am I misundertanding the syntax of 'session'?
>
> Thanks,
>
> Tim
>
>
>
> ___
> use-livecode mailing list
> use-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: Using the $_POST global in LiveCode server

2018-08-02 Thread Mike Bonner via use-livecode
I don't really understand what I've read yet, but I think what you're
looking for is Post/Redirect/Get (prg)  Basically.. Accept the post,
process it, redirect to another page without the post. (One example I read
basically placed the generated html into a session variable and displayed
it after the get, then cleared it from the session so that a reload
wouldn't show anything)

Lots of examples in php, not sure how to implement with lc.

Another though has just occurred to me also..  If you use session
variables, you can store the search term in the session, and since the
browser will re-post on reload, if $_POST and your session variable contain
the same search term, its possible (likely?) that it was a reload rather
than a new search, then don't do the search. Not sure if this is helpful,
and not sure how to handle the back button either.



On Thu, Aug 2, 2018 at 4:37 PM Tim Selander via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi,
>
> Is it possible to change, or even delete, the $_POST[] array in LiveCode
> server? I want to clear it after my script has pulled out the info it
> needs.
>
> Or, maybe there's another way to skin the cat. I have a search page that
> returns a list of our online TV programs. But even if the page is
> reloaded, the previous search term is still "live" in the $_P, so the
> page returns the previously searched list of programs. If a user reloads
> the page, I want the page to come up with no program list until they
> enter a new search term.
>
> Any pointers?
>
> Thanks!
>
> Tim Selander
> Tokyo Japan
>
> ___
> use-livecode mailing list
> use-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: Data Persistence

2018-07-30 Thread Mike Bonner via use-livecode
No, the memory db is in memory, the file db is still a file.  Also forgot,
you should probably quote the filename 'pathtofile.db' otherwise it gets
confused (unless you use a file with no extension.

The nice thing about this is you can have your nice persistent file db,
open a memory db, then do a create table main.tablename as select * from
attachedtable.tablename at which point you have the speed benefits of using
an in memory database.  Just gotta keep both updated if you make changes
that need to be persistent, but thats no different than loading an array,
and having to keep the disk based encoded array up to date with changes.
Faster if anything since you don't have to write the whole thing every time.

On Mon, Jul 30, 2018 at 3:46 PM Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Interesting... does it load the file database into memory?
>
> Bob S
>
>
> > On Jul 30, 2018, at 08:19 , Mike Bonner via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Doh. Been a bit since I did it. Its-- ATTACH DATABASE pathtodb.db as
> dbname
>
>
> ___
> use-livecode mailing list
> use-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: Too fundamental to be a bug, so what's wrong?

2018-07-30 Thread Mike Bonner via use-livecode
You have to declare it as a global in every script where you use it.   It
sounds like thats whats going on here.

On Mon, Jul 30, 2018 at 2:10 PM tbodine via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi all.
> I have a global array containing the value 4. It's stored in
> gTSsettings["teamcount"]
> The bizarre thing is when I do value comparisons, gTSsettings["teamcount"]
> does not equal 4.
> This first occurred in a repeat loop, but I can reproduce it in the message
> box, too.
> put gTSsettings["teamcount"]4put gTSsettings["teamcount"] = 4false
> This seems way to fundamental to be an undiscovered bug. So, what am I
> missing?
> I'm using LC 8.1.10 Build 14072 Indy on a MacBook Pro.
> Thanks!
> Tom B.
>
>
>
> --
> Sent from:
> http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html
> ___
> use-livecode mailing list
> use-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: Data Persistence

2018-07-30 Thread Mike Bonner via use-livecode
Doh. Been a bit since I did it. Its-- ATTACH DATABASE pathtodb.db as dbname

On Mon, Jul 30, 2018 at 8:55 AM Mike Bonner  wrote:

> Sorry.. To elaborate, yes you can attach a disk based db to a memory db.
> Then you use dot notation to specify which database you're working on.
>
> So it would be a regular attach-- attach pathtodatabase.db as dbname
> Then any place you would specify a table name it would be dbname.tablename
>
>
>
> On Mon, Jul 30, 2018 at 8:51 AM Mike Bonner  wrote:
>
>> Yes
>> >
>> On Mon, Jul 30, 2018 at 8:45 AM Bob Sneidar via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>>
>>> Wait, you can attach a disk based database to a memory database??
>>>
>>> Bob S
>>>
>>>
>>> > On Jul 27, 2018, at 15:19 , Mike Bonner via use-livecode <
>>> use-livecode@lists.runrev.com> wrote:
>>> >
>>> > On the subject of sqLite/memory databases and preferences/data
>>> persistence,
>>> > rather than using an array, and doing the encode/decode stuff, would it
>>> > make sense to do the following..
>>> > 1. open an empty in memory database
>>> > 2. attach a disk based database
>>> > 3. copy the required table(s) from disk base to memory base
>>>
>>>
>>> ___
>>> use-livecode mailing list
>>> use-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: Data Persistence

2018-07-30 Thread Mike Bonner via use-livecode
Sorry.. To elaborate, yes you can attach a disk based db to a memory db.
Then you use dot notation to specify which database you're working on.

So it would be a regular attach-- attach pathtodatabase.db as dbname
Then any place you would specify a table name it would be dbname.tablename



On Mon, Jul 30, 2018 at 8:51 AM Mike Bonner  wrote:

> Yes
> 
> On Mon, Jul 30, 2018 at 8:45 AM Bob Sneidar via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
>> Wait, you can attach a disk based database to a memory database??
>>
>> Bob S
>>
>>
>> > On Jul 27, 2018, at 15:19 , Mike Bonner via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>> >
>> > On the subject of sqLite/memory databases and preferences/data
>> persistence,
>> > rather than using an array, and doing the encode/decode stuff, would it
>> > make sense to do the following..
>> > 1. open an empty in memory database
>> > 2. attach a disk based database
>> > 3. copy the required table(s) from disk base to memory base
>>
>>
>> ___
>> use-livecode mailing list
>> use-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: Data Persistence

2018-07-30 Thread Mike Bonner via use-livecode
Yes
 wrote:

> Wait, you can attach a disk based database to a memory database??
>
> Bob S
>
>
> > On Jul 27, 2018, at 15:19 , Mike Bonner via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > On the subject of sqLite/memory databases and preferences/data
> persistence,
> > rather than using an array, and doing the encode/decode stuff, would it
> > make sense to do the following..
> > 1. open an empty in memory database
> > 2. attach a disk based database
> > 3. copy the required table(s) from disk base to memory base
>
>
> ___
> use-livecode mailing list
> use-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: Local images and the browser widget

2018-07-29 Thread Mike Bonner via use-livecode
Decided to try using the httpd library, and it seems to work pretty
nicely.  If you want to set up a very simple web picture viewer (VERY
simple) the following code is a working but minimal start.

local sBaseDir
on mouseup
   httpdstart "newrequest",,"My Picture Server" --start the server on
port 
   put specialfolderpath("desktop") & "/pics" into sBaseDir -- Set this to
the folder that contains your pictures
end mouseup

on newRequest pSocketId,pRequest -- handle requests
   if pRequest["resource"] is "/" then -- if the request has no filename,
give the directory index of jpg files. (I only coded for jpegs)
  put files(sBaseDir) into tFiles
  repeat for each line tLIne in tFiles
 put merge("[[tLine]]") & cr after tData
-- build up the response data for each file
  end repeat
  httpdresponse pSocketId,200,tData -- send the index
   else
  put "Content-Type: image/jpeg ;" into pHeader -- set the content type
to jpeg
  put URL("binfile:" & sBaseDir & pRequest["resource"]) into tData --
read the image file and pop it into tData (binary mode)
  httpdresponse pSocketId,200,tData,pHeader -- send the picture data,
200 ok code, and set the correct header for picture data
   end if
end newRequest

If your filenames/paths have spaces, you'd have to jump through some hoops
to get it to work, and your base path has that space in it, so not sure how
to get it working. Actually, nevermind.  If you change spaces in your
baseurl to "\ " it may work?  I couldn't make it work here (on windows)
despite trying a whole bunch of ideas, so I cheated and made sure there
were no spaces.

On Sun, Jul 29, 2018 at 3:21 PM Stephen MacLean via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Thanks Mike, yes that does work for just displaying the image.
>
> I’m building HTML on the fly and wanted to include the local image if
> there was one, for testing. This will be a moot point for production as
> everything will be served via a web server, but I was hoping to see this
> for testing.
>
> I will be looking to the new http server LC has as I will need it anyway
> for doing some API things with this engine.
>
> Thanks again to all!
>
> Best,
> Steve
>
> > On Jul 29, 2018, at 5:03 PM, Mike Bonner via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > If you just need to see the image, you can do it by changing your
> method..
> >
> > Instead of setting the htmltext, it should work to set the url to  "
> > http://Users/steve/Dropbox/ITB%20pubEngine/tempMedia/99578
> > 6d6-4429-4821-8b21-8e811289e12c.jpg"
> >
> > I'm not expert, but I think there is some type of cross-domain security
> > thing interfering here.  A web page shouldn't be able to force access to
> a
> > file on your system due to security, unless the page originates with you.
> > And I THINK that directly setting the html basically means there is no
> base
> > domain, so it will refuse to show the image.  Again, not an expert, so
> i'm
> > just making a wag.
> > If you need more control, you can likely create an html file on the fly
> and
> > point your url to that, at which point you can use relative addressing
> for
> > your pictures.  So, if you created the html file with your code in the
> same
> > folder as your stack, you could then place..  > 6d6-4429-4821-8b21-8e811289e12c.jpg> into the file and it will likely
> work.
> >
> > Another thing you might look into is running your own simple http server
> > (which LC now makes easy) so that you can set up a simple server and set
> > the url to http://localhost:8080/index.html  (or whatever port number
> you
> > wish, and again, use relative pathing.
> >
> > Either of these 2 methods is easier than using long, easily mangled
> > absolute paths.   I haven't delved into the self run server yet, but I
> > suspect you can do interesting things with it. (Or use the old revhttpd
> > stack which I HAVE used, and know that it works really well and can do
> > awesome stuff too)
> >
> >
> >
> > On Sun, Jul 29, 2018 at 2:32 PM Stephen MacLean via use-livecode <
> > use-livecode@lists.runrev.com> wrote:
> >
> >> Almost afraid to ask this because I feel like it’s a path issue with
> >> Relative vs Absolute… Remote images display fine in a browser widget,
> but
> >> local image files don’t seem to.
> >>
> >> This works (displays the image) in script and in the message box:
> >> put "http://www.trumbull-ct.gov/images/BoyScouts.jpg; &
> ">"
> >&

Re: Local images and the browser widget

2018-07-29 Thread Mike Bonner via use-livecode
Sorry, that should have been.. Set the url to   "file
:///Users/steve/Dropbox/I 
TB%20pubEngine/tempMedia/995786d6-4429-4821-8b21-8e811289e12c.jpg"

On Sun, Jul 29, 2018 at 3:03 PM Mike Bonner  wrote:

> If you just need to see the image, you can do it by changing your method..
>
> Instead of setting the htmltext, it should work to set the url to  "
> http://Users/steve/Dropbox/ITB%20pubEngine/tempMedia/99578
> 6d6-4429-4821-8b21-8e811289e12c.jpg"
>
> I'm not expert, but I think there is some type of cross-domain security
> thing interfering here.  A web page shouldn't be able to force access to a
> file on your system due to security, unless the page originates with you.
> And I THINK that directly setting the html basically means there is no base
> domain, so it will refuse to show the image.  Again, not an expert, so i'm
> just making a wag.
> If you need more control, you can likely create an html file on the fly
> and point your url to that, at which point you can use relative addressing
> for your pictures.  So, if you created the html file with your code in the
> same folder as your stack, you could then place..  995786d6-4429-4821-8b21-8e811289e12c.jpg> into the file and it will
> likely work.
>
> Another thing you might look into is running your own simple http server
> (which LC now makes easy) so that you can set up a simple server and set
> the url to http://localhost:8080/index.html  (or whatever port number you
> wish, and again, use relative pathing.
>
> Either of these 2 methods is easier than using long, easily mangled
> absolute paths.   I haven't delved into the self run server yet, but I
> suspect you can do interesting things with it. (Or use the old revhttpd
> stack which I HAVE used, and know that it works really well and can do
> awesome stuff too)
>
>
>
> On Sun, Jul 29, 2018 at 2:32 PM Stephen MacLean via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
>> Almost afraid to ask this because I feel like it’s a path issue with
>> Relative vs Absolute… Remote images display fine in a browser widget, but
>> local image files don’t seem to.
>>
>> This works (displays the image) in script and in the message box:
>> put "http://www.trumbull-ct.gov/images/BoyScouts.jpg; &
>> ">" into tHTML
>>
>> set the htmlText of widget "finished_html_content" to tHTML
>>
>>
>> This does not (Image not displayed) in script or the message box:
>> put "> & ">" into tHTML
>>
>> set the htmlText of widget "finished_html_content" to tHTML
>>
>>
>> Sorry about bombarding the list!
>>
>> Thanks,
>>
>> Steve
>> ___
>> use-livecode mailing list
>> use-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: Local images and the browser widget

2018-07-29 Thread Mike Bonner via use-livecode
If you just need to see the image, you can do it by changing your method..

Instead of setting the htmltext, it should work to set the url to  "
http://Users/steve/Dropbox/ITB%20pubEngine/tempMedia/99578
6d6-4429-4821-8b21-8e811289e12c.jpg"

I'm not expert, but I think there is some type of cross-domain security
thing interfering here.  A web page shouldn't be able to force access to a
file on your system due to security, unless the page originates with you.
And I THINK that directly setting the html basically means there is no base
domain, so it will refuse to show the image.  Again, not an expert, so i'm
just making a wag.
If you need more control, you can likely create an html file on the fly and
point your url to that, at which point you can use relative addressing for
your pictures.  So, if you created the html file with your code in the same
folder as your stack, you could then place..  into the file and it will likely work.

Another thing you might look into is running your own simple http server
(which LC now makes easy) so that you can set up a simple server and set
the url to http://localhost:8080/index.html  (or whatever port number you
wish, and again, use relative pathing.

Either of these 2 methods is easier than using long, easily mangled
absolute paths.   I haven't delved into the self run server yet, but I
suspect you can do interesting things with it. (Or use the old revhttpd
stack which I HAVE used, and know that it works really well and can do
awesome stuff too)



On Sun, Jul 29, 2018 at 2:32 PM Stephen MacLean via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Almost afraid to ask this because I feel like it’s a path issue with
> Relative vs Absolute… Remote images display fine in a browser widget, but
> local image files don’t seem to.
>
> This works (displays the image) in script and in the message box:
> put "http://www.trumbull-ct.gov/images/BoyScouts.jpg; & ">"
> into tHTML
>
> set the htmlText of widget "finished_html_content" to tHTML
>
>
> This does not (Image not displayed) in script or the message box:
> put " & ">" into tHTML
>
> set the htmlText of widget "finished_html_content" to tHTML
>
>
> Sorry about bombarding the list!
>
> Thanks,
>
> Steve
> ___
> use-livecode mailing list
> use-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: set the filename of image bug?

2018-07-29 Thread Mike Bonner via use-livecode
If you think the stack is corrupted, you might send it to
supp...@livecode.com so they can look at it, and/or post a bug report and
include the stack there so that it can be looked at. (assuming there is
nothing sensitive in the stack)

On Sun, Jul 29, 2018 at 11:24 AM Stephen MacLean via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Some other weirdness i’m noticing… When I copied a new image to that card,
> it gave it a very high numbered ID that corresponded with one of the icons
> in the image library.
>
> I think I’m dealing with some kind of corruption here.
>
> I’m going to rebuild this and give that a try. Thankfully it’s mostly
> script with just a few cards and graphics for doing things.
>
> > On Jul 29, 2018, at 1:03 PM, Stephen MacLean via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Ok, very strange… I created a test project to run in both 9.0.1 RC1 and
> 9.0.0… and it works fine, yet doesn’t work in the image that I have in my
> engine stack in either version.
> >
> > Even renaming the old one and dragging a new image out and trying that
> doesn’t work. Ugh!
> >
> > I’m at a loss.
> >
> > I’m running business in case that matters.
> >
> > Thanks,
> >
> > Steve
> >
> >> On Jul 29, 2018, at 12:38 PM, Stephen MacLean via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >>
> >> HI Klaus,
> >>
> >> Wow, ok… I will have to check 9.0.0. Currently using 9.0.1 RC1 on
> 10.12.6. It fails for me in both script and the inspector.
> >>
> >> Thanks for testing!
> >>
> >> Best,
> >>
> >> Steve
> >>
> >>> On Jul 29, 2018, at 12:34 PM, Klaus major-k via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >>>
> >>> Hi Steve,
> >>>
>  Am 29.07.2018 um 18:28 schrieb Stephen MacLean via use-livecode <
> use-livecode@lists.runrev.com>:
> 
>  Hi All,
> 
>  I’m having an issue with the “set the filename of img”.
>  This line: set the filename of img "checkImg" of cd "cropImg" stack
> "imgEngine" to imgURL
>  Works as expected when using “http”. When using “https”, it fails to
> get the image. No error is returned, but the image is blank.
> 
> https://pixfeeds.com/images/usa-travel/1280-589451788-statue-of-liberty-full-base.jpg
> <
> https://pixfeeds.com/images/usa-travel/1280-589451788-statue-of-liberty-full-base.jpg>
> is the test image I’m using. Don’t see any reports of issues, but wanted to
> know if anyone else has run into this.
> >>>
> >>> just tested, works right out of the box in the IDE, by setting the
> filename in the inspector and also via script!
> >>> macOS 10.13.6, LC 9
> >>>
>  Thanks,
> 
>  Steve MacLean
> >>>
> >>> Best
> >>>
> >>> Klaus
> >>>
> >>> --
> >>> Klaus Major
> >>> http://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
> >
> >
> >
> > ___
> > use-livecode mailing list
> > use-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: set the filename of image bug?

2018-07-29 Thread Mike Bonner via use-livecode
If it works for Klaus, and fails for you, it makes me wonder if something
has gotten munged in the imgUrl variable.

You might try putting an "answer imgUrl" (or use the variable inspector) to
confirm that everything looks right.

(worked fine for me too)

On Sun, Jul 29, 2018 at 10:39 AM Stephen MacLean via use-livecode <
use-livecode@lists.runrev.com> wrote:

> HI Klaus,
>
> Wow, ok… I will have to check 9.0.0. Currently using 9.0.1 RC1 on 10.12.6.
> It fails for me in both script and the inspector.
>
> Thanks for testing!
>
> Best,
>
> Steve
>
> > On Jul 29, 2018, at 12:34 PM, Klaus major-k via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Hi Steve,
> >
> >> Am 29.07.2018 um 18:28 schrieb Stephen MacLean via use-livecode <
> use-livecode@lists.runrev.com>:
> >>
> >> Hi All,
> >>
> >> I’m having an issue with the “set the filename of img”.
> >> This line: set the filename of img "checkImg" of cd "cropImg" stack
> "imgEngine" to imgURL
> >> Works as expected when using “http”. When using “https”, it fails to
> get the image. No error is returned, but the image is blank.
> >>
> https://pixfeeds.com/images/usa-travel/1280-589451788-statue-of-liberty-full-base.jpg
> <
> https://pixfeeds.com/images/usa-travel/1280-589451788-statue-of-liberty-full-base.jpg>
> is the test image I’m using. Don’t see any reports of issues, but wanted to
> know if anyone else has run into this.
> >
> > just tested, works right out of the box in the IDE, by setting the
> filename in the inspector and also via script!
> > macOS 10.13.6, LC 9
> >
> >> Thanks,
> >>
> >> Steve MacLean
> >
> > Best
> >
> > Klaus
> >
> > --
> > Klaus Major
> > http://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
___
use-livecode mailing list
use-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 saving image for file

2018-07-28 Thread Mike Bonner via use-livecode
It's just how file systems work.  If the beginning character is / that
means it starts at the root of the file system.  Since you had already set
the defaultfolder, and wanted to go relative to there, you would just
specify the folder name/filename.  Or as I said, pre-pend a dot.   In fact,
2 dots .. stands for the next folder towards the root so you can do weird
things like dir ../../..  which will list the contents of a folder 3 levels
above the current.

You also don't need to actually set the defaultfolder, you could do as in
your example...

set the itemDelimiter to slash
get the effective filename of this stack
put tTempCrop into URL "binfile:" & item 1 to - 2 of it &
"/tempMedia/testimage.jpg"

In the case of the above you DO need the slash before tempMedia because
there is no trailing slash when you get item 1 to -2 of it.  But, item 1 to
-2 of it is a path starting from the root so you end up with an absolute
path rather than a relative path.  IE it would be something like
/home/username/desktop/mystackfolder/tempMedia/testimage.jpg



On Sat, Jul 28, 2018 at 8:45 PM Stephen MacLean via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Thank you to all who replied!
>
> Adding the “.” solved the problem and the file saved where it was supposed
> to.
>
> Confusing, because you would think that setting the defaultFolder would
> allow you to specify the next sub folder like I did… and it’s not
> mentioned, that I saw, in the docs.
>
> Thanks again!
>
> Steve
>
> > On Jul 28, 2018, at 5:52 PM, Mike Bonner via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > If you use the path /tempMedia that forces it to the root of the
> > filesystem and if there isn't a folder /tempmedia, it'll fail.  Either
> > leave off the preceding slash, or prepend it with a . <--(a dot) which
> > designates the current directory.
> >
> > On Sat, Jul 28, 2018 at 3:40 PM Peter Bogdanoff via use-livecode <
> > use-livecode@lists.runrev.com> wrote:
> >
> >> That is (or use variables for the filename):
> >>> export image "testimage.jpg"  to file "/tempMedia/testimage.jpg" as
> JPEG
> >>
> >>
> >>
> >>
> >>> On Jul 28, 2018, at 2:37 PM, Peter Bogdanoff via use-livecode <
> >> use-livecode@lists.runrev.com> wrote:
> >>>
> >>> Hi,
> >>>
> >>> Try using this syntax:
> >>> export image "tImage"  to file "/tempMedia/testimage.jpg" as JPEG
> >>>
> >>> I think you need binfile to read but not to write.
> >>> Peter
> >>>
> >>>
> >>>> On Jul 28, 2018, at 1:41 PM, Stephen MacLean via use-livecode <
> >> use-livecode@lists.runrev.com> wrote:
> >>>>
> >>>> Hi All,
> >>>>
> >>>> Been a long time since I’ve done file work with LC, but I’m having an
> >> issue saving an image to a file:
> >>>>
> >>>> # set the defaultFolder to the folder containing the stackfile
> >>>>
> >>>> set the itemDelimiter to slash
> >>>>
> >>>> get the effective filename of this stack
> >>>>
> >>>> set the defaultFolder to item 1 to -2 of it
> >>>>
> >>>> put tTempCrop into URL "binfile:/tempMedia/testimage.jpg"
> >>>>
> >>>>
> >>>> results in a “Can’t open file” error.
> >>>>
> >>>> Trying to save to a folder called “tempMedia” that is in the same
> >> directory as the stack.
> >>>>
> >>>> Mac OS 10.12.6, 9.01 RC1 Business.
> >>>>
> >>>> TIA,
> >>>>
> >>>> Steve MacLean
> >>>> ___
> >>>> use-livecode mailing list
> >>>> use-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
>
>
>
> ___
> use-livecode mailing list
> use-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: Problem saving image for file

2018-07-28 Thread Mike Bonner via use-livecode
If you use the path /tempMedia that forces it to the root of the
filesystem and if there isn't a folder /tempmedia, it'll fail.  Either
leave off the preceding slash, or prepend it with a . <--(a dot) which
designates the current directory.

On Sat, Jul 28, 2018 at 3:40 PM Peter Bogdanoff via use-livecode <
use-livecode@lists.runrev.com> wrote:

> That is (or use variables for the filename):
> > export image "testimage.jpg"  to file "/tempMedia/testimage.jpg" as JPEG
>
>
>
>
> > On Jul 28, 2018, at 2:37 PM, Peter Bogdanoff via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Hi,
> >
> > Try using this syntax:
> > export image "tImage"  to file "/tempMedia/testimage.jpg" as JPEG
> >
> > I think you need binfile to read but not to write.
> > Peter
> >
> >
> >> On Jul 28, 2018, at 1:41 PM, Stephen MacLean via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >>
> >> Hi All,
> >>
> >> Been a long time since I’ve done file work with LC, but I’m having an
> issue saving an image to a file:
> >>
> >> # set the defaultFolder to the folder containing the stackfile
> >>
> >> set the itemDelimiter to slash
> >>
> >> get the effective filename of this stack
> >>
> >> set the defaultFolder to item 1 to -2 of it
> >>
> >> put tTempCrop into URL "binfile:/tempMedia/testimage.jpg"
> >>
> >>
> >> results in a “Can’t open file” error.
> >>
> >> Trying to save to a folder called “tempMedia” that is in the same
> directory as the stack.
> >>
> >> Mac OS 10.12.6, 9.01 RC1 Business.
> >>
> >> TIA,
> >>
> >> Steve MacLean
> >> ___
> >> use-livecode mailing list
> >> use-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: Data Persistence

2018-07-27 Thread Mike Bonner via use-livecode
On the subject of sqLite/memory databases and preferences/data persistence,
rather than using an array, and doing the encode/decode stuff, would it
make sense to do the following..
1. open an empty in memory database
2. attach a disk based database
3. copy the required table(s) from disk base to memory base

At this point, for data reads you have a super fast sqlite in memory
database.  For updates, do a double update, both in memory, and disk.

It seems like this would be more efficient than re-encoding an array every
time there is an update and writing the whole thing out to disk each time,
rather than updating just whatever small change might need to be made to
sqlite.

The affects and requirements would be similar. Update the array, (1 update)
ecode and write to disk (second update)  vs update in mem sqlite, and
update attached sqlite database.

Does my thinking make sense?

On Fri, Jul 27, 2018 at 4:11 PM Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I tried reading an "LSON" format, but it's not straight forward. It's
> easier to simply arrayDecode the LSON and work with the array. And since
> you can convert the array to a memory sqLite database and back again with
> my handy dandy handlers, everybody wins!
>
> Bob S
>
>
> > On Jul 27, 2018, at 12:52 , Alex Tweedly via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > On 27/07/2018 20:17, Richard Gaskin via use-livecode wrote:
> >
> >>
> >> >  Using arrays intigues me, especially if I can just keep it in RAM (It
> >> > is a small amount of data for sure).
> >>
> >> One great thing about LC's built-in support for arrays is that it's
> built-in.
> >>
> >> JSON has become used in so many other languages that we've forgotten
> why it was invented:  to serialize JavaScript objects as simply and
> efficiently as possible using features already built into the JavaScript
> interpreter.
> >>
> >> LSON is that for us, as much a with-the-grain approach to data handling
> in LiveCode as JSON is for JavaScript.
> > I just wish there was a human-readable, human-editable-in-a-text-editor
> variant of LSON :-)
> >
> > Someday, when I have some spare time, ...
> >
> > -- Alex.
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-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: Data Persistence

2018-07-27 Thread Mike Bonner via use-livecode
Your Bran. will be assimilated. (borg zombies FTW)

On Fri, Jul 27, 2018 at 3:39 PM J. Landman Gay via use-livecode <
use-livecode@lists.runrev.com> wrote:

> On 7/27/18 12:47 PM, John McKenzie via use-livecode wrote:
> >   Tom, thank you for welcoming me. Much different than some online
> > programming groups. :-)
>
> We love new users, it's more brains for the collective. :)
>
> --
> 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: drawing a Barcode without a Barcode font

2018-07-20 Thread Mike Bonner via use-livecode
Hey Mark (or anyone?)
Feel like writing up a widget for this (with lots of comments) as an
instructional? (Plus the fact that it'd be a very useful widget in its own
right)

BTW wow.  I toss out a short little ugly hunk of code and you all make it
into something so much better.

On Fri, Jul 20, 2018 at 3:08 PM Mark Wieder via use-livecode <
use-livecode@lists.runrev.com> wrote:

> On 07/20/2018 04:31 AM, Matthias Rebbe via use-livecode wrote:
> > We tried here with iPhone and also with an USB scanner. Both devices
> scanned the code successfully.
> >
> > I have just finished a program for shipment. It fetches customer and
> invoice data from the accounting software and creates then the shipment
> labels including a Code25i barcode and a QR code. The carrier is
> Trans-o-Flex. I need to send some sample labels to their IT department.
> They will check if the labels are readable by their scanners. But i am now
> confident, that this will work on their side also.
>
> Cool. I played around with Mattias' version of Mike's excellent code a
> bit. Here's my take. Note that you really only need one graphic image to
> work with - here's how to do it with a single invisible filled rectangle
> graphic (I kept the name "narrowB"). This takes a string of numbers and
> generates the intermediate string and bar code.
>
> -- 2of5 barcode
>
> constant kBarCodeHeight = 69
> constant kBarCodeWidth = 360
> constant kInitialTopLeft = "60,286" -- defines where the first bar is
> placed
> constant kGapBetweenBars = 0
> constant kBarCodeGroupName = "barcode2of5"
>
> local sLast
> local sWideWidth
>
> on mouseUp
> local tNumberString
> local tConvertedNumberString
> local tBarWidth
>
> set the height of graphic "narrowB" to kBarCodeHeight
> put field "barcodeNumber" into tNumberString
>
> -- need a checksum as the last digit?
> -- put checksumFrom (field "barcodeNumber") after tNumberString
>
> -- calculate the expected bar widths
> put convertNumberString(tNumberString) into tConvertedNumberString
> put barWidthFrom(tConvertedNumberString) into tBarWidth
> set the width of graphic "narrowB" to tBarWidth
> put tBarWidth * 2 into sWideWidth
> makeBarCodeFrom tConvertedNumberString
> -- add the number string to the barcode if it's not already on the form
> displayBarCodeNumber
> end mouseUp
>
> function barWidthFrom pNumberString
> local tHowManyChars
> local tTestString
>
> put pNumberString into tTestString
> replace "n" with empty in tTestString
> put length (tTestString) + length (pNumberString) into tHowManyChars
> return kBarCodeWidth / tHowManyChars
> end barWidthFrom
>
> on makeBarCodeFrom pChars
> local tIsFilled
>
> lock screen
> if there is a group kBarCodeGroupName then
>delete group kBarCodeGroupName
> end if
> put empty into sLast
>
> create group kBarCodeGroupName
> set the height of group kBarCodeGroupName to kBarCodeHeight
> set the width of group kBarCodeGroupName to kBarCodeWidth
> put true into tIsFilled
> repeat for each char tChar in pChars
>copy graphic "narrowB" to group kBarCodeGroupName
>switch tChar
>   case "w"
>  set the width of the last graphic to sWideWidth
>  break
>end switch
>if tIsFilled then
>   set the visible of the last graphic to true
>end if
>put not tIsFilled into tIsFilled
>if sLast is empty then
>   set the topleft of the last graphic to kInitialTopLeft
>else
>   set the topleft of the last graphic to horAdjust(kGapBetweenBars)
>end if
>put the short id of the last graphic into sLast -- the id of the
> most recently placed bar
> end repeat
>
> unlock screen
> end makeBarCodeFrom
>
> command displayBarCodeNumber
> copy field "barCodeNumber" to group kBarCodeGroupName
> set the opaque of the last field to false
> set the showborder of the last field to false
> set the textalign of the last field to "center"
> set the top of the last field to the bottom of group kBarCodeGroupName
> set the width of the last field to the width of group kBarCodeGroupName
> set the left of the last field to item 1 of kInitialTopLeft
> end displayBarCodeNumber
>
> function horAdjust pGap
> local tGap
>
> put the topright of graphic id sLast into tGap
> set the itemdelimiter to ","
> add pGap to item 1 of tGap
> return tGap
> end horAdjust
>
> local sConversionArray
>
> command initializeConversionArray
> put "nnWWn" into sConversionArray["0"]
> put "WnnnW" into sConversionArray["1"]
> put "nWnnW" into sConversionArray["2"]
> put "WWnnn" into sConversionArray["3"]
> put "nnWnW" into sConversionArray["4"]
> put "WnWnn" into sConversionArray["5"]
> put "nWWnn" into sConversionArray["6"]
> put "nnnWW" into sConversionArray["7"]
> put "WnnWn" into 

Re: drawing a Barcode without a Barcode font

2018-07-20 Thread Mike Bonner via use-livecode
Very cool!  Does it actually produce a code that can be scanned?

On Fri, Jul 20, 2018 at 3:25 AM Matthias Rebbe via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Mike
>
> you´re awesome. That is already an almost complete solution to my
> question. Never had expected that. Thank you very much.
> I´ve made some little changes. One among of them is:
> To have all the separate bars of the barcode in a group, i changed the
> lines where the grc is cloned
> to for examplecopy grc “narrowB” to grp “barcode2of5”
>
> Here´s now my code to convert the nNnNN…. string to Barcode
>
> local tLast
> on mouseup
>if there is a grp "barcode2of5" then delete grp "barcode2of5"
>-- now change the width of the template graphics
>put "2" into tNarrow
>put "4" into tWide
>set the width of grc "narrowC" to tNarrow
>set the width of grc "narrowB" to tNarrow
>set the width of grc "wideC" to tWide
>set the width of grc "wideB" to tWide
>put "0" into tHorAdjust -- allows to put a gap beween the separate bars.
>put "60,286" into tBarTopLeft -- defines where the first bar is placed
>put empty into tLast
>put fld "2of5" into tChars -- the field with your wNnnW string
>set the casesensitive to true -- to differentiate case of course
>create grp "barcode2of5"
>repeat for each char tChar in tChars
>   switch tChar
>  case "N"
> -- checks the char, and clones the matching bar.
> --if its the first time through, places it at astart location
> -- then uses the id of the most recent bar forplacement
> purposes
> --clone grc "narrowB"
> copy grc "narrowB" to grp "barcode2of5"
> if tLast is empty then
>set the topleft of the last grc to tBarTopLeft
> else
>set the topleft of the last grc to horAdjust(tHorAdjust)
> end if
> break
>  case "n"
> --clone grc "narrowC"
> copy grc "narrowC" to grp "barcode2of5"
> if tLast is empty then
>set the topleft of the last grc to tBarTopLeft
> else
>set the topleft of the last grc to horAdjust(tHorAdjust)
> end if
> break
>  case "W"
> --clone grc "wideB"
> copy grc "wideB" to grp "barcode2of5"
> if tLast is empty then
>set the topleft of the last grc to tBarTopLeft
> else
>set the topleft of the last grc to horAdjust(tHorAdjust)
> end if
> break
>  case "w"
> --clone grc "widec"
> copy grc "widec" to grp "barcode2of5"
> if tLast is empty then
>set the topleft of the last grc to tBarTopLeft
> else
>set the topleft of the last grc to horAdjust(tHorAdjust)
> end if
> break
>   end switch
>   put the short id of the last grc into tLast -- the id of the most
> recently placed bar
>    end repeat
>set the height of grp "barcode2of5" to 69
>set the width of grp "barcode2of5" to 360
> end mouseup
>
> --This function allows a horizontal adjustment of the single bars.
> function horAdjust tHorAdjust
>put the topright of grc id tLast into tTMP
>set the itemdelimiter to ","
>add tHorAdjust to item 1 of tTMP
>return tTMP
> end horAdjust
>
> Again, thank you very much for your help.
>
> Regards,
>
> Matthias
>
>
> > Am 20.07.2018 um 01:01 schrieb Mike Bonner via use-livecode <
> use-livecode@lists.runrev.com>:
> >
> > Not sure if it will work for your purpose, but as a test I created for
> > graphic lines, 1 narrow black, 1 wider black, duplicated them and set the
> > blendlevel of the copies so that they're transparent.
> >
> > Grcs are named narrowB, wideB, narrowC and wideC (b for black, c for
> clear)
> >
> > Then used the following code (and your example string from above with the
> > WWnNw stuff) to generate a barcode.
> >
> > on mouseup
> >   put empty into tLast
> >   put field 1 into tChars -- the field with your wNnnW string
> >   set the casesensitive to true -- to differentiate case of course
> >   repeat for each char tChar i

Re: drawing a Barcode without a Barcode font

2018-07-19 Thread Mike Bonner via use-livecode
Not sure if it will work for your purpose, but as a test I created for
graphic lines, 1 narrow black, 1 wider black, duplicated them and set the
blendlevel of the copies so that they're transparent.

Grcs are named narrowB, wideB, narrowC and wideC (b for black, c for clear)

Then used the following code (and your example string from above with the
WWnNw stuff) to generate a barcode.

on mouseup
   put empty into tLast
   put field 1 into tChars -- the field with your wNnnW string
   set the casesensitive to true -- to differentiate case of course
   repeat for each char tChar in tChars
  switch tChar
 case "N" -- checks the char, and clones the matching bar.
--if its the first time through, places it at a
start location
-- then uses the id of the most recent bar for
placement purposes
clone grc "narrowB"
if tLast is empty then
   set the topleft of the last grc to 10,50
else
   set the topleft of the last grc to the topright of grc id
tLast
end if
break
 case "n"
clone grc "narrowC"
if tLast is empty then
   set the topleft of the last grc to 10,50
else
   set the topleft of the last grc to the topright of grc id
tLast
end if
break
 case "W"
clone grc "wideB"
if tLast is empty then
   set the topleft of the last grc to 10,50
else
   set the topleft of the last grc to the topright of grc id
tLast
end if
break
 case "w"
clone grc "widec"
if tLast is empty then
   set the topleft of the last grc to 10,50
else
   set the topleft of the last grc to the topright of grc id
tLast
end if
break

  end switch
  put the short id of the last grc into tLast -- the id of the most
recently placed bar
   end repeat
end mouseup

Spacing and line size might need to be tweaked, but it seems like this
would be relatively straight forward.

On Thu, Jul 19, 2018 at 4:30 PM Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I think the trick will be drawing large graphics one at a time and
> properly spaced at several times their finished size, perhaps off screen,
> then getting a snapshot of the result and scaling it down. Not sure how
> picky the readers will be.
>
> Bob S
>
>
> > On Jul 19, 2018, at 15:06 , Matthias Rebbe via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Currently i am using a special 2of5i barcode font. The font .has only
> four characters (bars) in its set.
> > The code displays a
> > narrow space (blank) bar when the character is n
> > narrow black bar when N
> > wide space when w
> > wide black bar when W
>
>
> ___
> use-livecode mailing list
> use-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: Docker

2018-07-11 Thread Mike Bonner via use-livecode
They'll be more annoyed that their car isn't where they left it.  Of course
if they understand sock science, maybe they'll go look for it in the dryer.

On Wed, Jul 11, 2018 at 6:09 PM Mark Wieder via use-livecode <
use-livecode@lists.runrev.com> wrote:

> On 07/11/2018 03:18 PM, Bob Sneidar via use-livecode wrote:
> > I'm in a strange mood. I got into my car last Sunday and discovered two
> of my three radio programmable buttons had changed stations. I'm the only
> person who drives my car, and I always lock it wherever I go. I'm not sure
> I haven't entered some alternate universe or something.
>
> That's easy. You got into someone else's unlocked car.
> They're gonna be annoyed if you change those presets.
>
>
>
___
use-livecode mailing list
use-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: Docker

2018-07-11 Thread Mike Bonner via use-livecode
Sounds like there is a need for a new Dropsock service so that socks can be
posted and shared freely. Or perhaps a bitSock system where those who are
advantaged can solve sock chain transactions, but it would require everyone
to set up a digital hamper to store any earned sock currency.   Next thing
we know, people will be daisy chaining dryer elements to increase their
sockchain computing power, pricing the rest of us out of the market.  Wet
sock wearing will be on the rise.

On Wed, Jul 11, 2018 at 1:53 PM J. Landman Gay via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I'm not sure about the rest of it, but the temporally advantaged are not
> eligible unless they actually find and deliver a lost sock.
> Unfortunately that's a catch-22 because the list does not accept
> enclosures, which is something I'd whine about if I had the chance.
>
> On 7/11/18 1:39 PM, Mike Bonner via use-livecode wrote:
> > Someone needs to make a list..  How soon can one start to whine, or
> > obfuscate, or speak of cheese.  But I'm not sure how it would apply to
> > those who are temporally advantaged with access to the lost sock quark
> > gate.
> >
> > On Wed, Jul 11, 2018 at 12:30 PM J. Landman Gay via use-livecode <
> > use-livecode@lists.runrev.com> wrote:
> >
> >> On 7/11/18 12:33 PM, Mike Bonner via use-livecode wrote:
> >>> Sorry for the whine.
> >>
> >> You've been here long enough that you're entitled to a whine. I believe
> >> there's a participation quotient for those.
> >>
> >> --
> >> Jacqueline Landman Gay | jac...@hyperactivesw.com
> >> HyperActive Software   | http://www.hyperactivesw.com
>
>
> --
> 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: Docker

2018-07-11 Thread Mike Bonner via use-livecode
Someone needs to make a list..  How soon can one start to whine, or
obfuscate, or speak of cheese.  But I'm not sure how it would apply to
those who are temporally advantaged with access to the lost sock quark
gate.

On Wed, Jul 11, 2018 at 12:30 PM J. Landman Gay via use-livecode <
use-livecode@lists.runrev.com> wrote:

> On 7/11/18 12:33 PM, Mike Bonner via use-livecode wrote:
> > Sorry for the whine.
>
> You've been here long enough that you're entitled to a whine. I believe
> there's a participation quotient for those.
>
> --
> 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: Docker

2018-07-11 Thread Mike Bonner via use-livecode
If I make any real progress, I'll definitely write things down.

Honestly, not sure how far I'll get, seems that every time I feel good
enough to resume working on projects, the bad health truck parks on my face
again. *grins from underneath a wheel* Wow what a morning I've been having.

Sorry for the whine.

On Wed, Jul 11, 2018 at 8:52 AM Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Cute. Sounds like sandboxing for clone processes.
>
> Bob S
>
>
> > On Jul 10, 2018, at 16:42 , Mark Wieder via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Kubernetes for sure.
> > This should get you started:
> >
> > https://deis.com/blog/2016/kubernetes-illustrated-guide/
>
>
> ___
> use-livecode mailing list
> use-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: Docker

2018-07-10 Thread Mike Bonner via use-livecode
Love that its a childrens guide. Definitely my speed.

On Tue, Jul 10, 2018 at 6:00 PM Mike Bonner  wrote:

> Thank you!
>
> On Tue, Jul 10, 2018 at 5:42 PM Mark Wieder via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
>> On 07/10/2018 02:40 PM, Mike Bonner via use-livecode wrote:
>> > Mostly i'm looking to learn how things work, but the end goal is to a)
>> have
>> > a front lc based controller (httpd) that can hand off jobs to a pool of
>> > docker "processors," and getting a handle on how to dynamically spin up
>> > more instances based on demand.  (kubernetes?)  I don't know enough yet
>> to
>>
>> Kubernetes for sure.
>> This should get you started:
>>
>> https://deis.com/blog/2016/kubernetes-illustrated-guide/
>>
>> or if you prefer the video version:
>>
>> https://www.youtube.com/watch?v=4ht22ReBjno
>>
>> --
>>   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


Re: Docker

2018-07-10 Thread Mike Bonner via use-livecode
Thank you!

On Tue, Jul 10, 2018 at 5:42 PM Mark Wieder via use-livecode <
use-livecode@lists.runrev.com> wrote:

> On 07/10/2018 02:40 PM, Mike Bonner via use-livecode wrote:
> > Mostly i'm looking to learn how things work, but the end goal is to a)
> have
> > a front lc based controller (httpd) that can hand off jobs to a pool of
> > docker "processors," and getting a handle on how to dynamically spin up
> > more instances based on demand.  (kubernetes?)  I don't know enough yet
> to
>
> Kubernetes for sure.
> This should get you started:
>
> https://deis.com/blog/2016/kubernetes-illustrated-guide/
>
> or if you prefer the video version:
>
> https://www.youtube.com/watch?v=4ht22ReBjno
>
> --
>   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


Re: Docker

2018-07-10 Thread Mike Bonner via use-livecode
Mostly i'm looking to learn how things work, but the end goal is to a) have
a front lc based controller (httpd) that can hand off jobs to a pool of
docker "processors," and getting a handle on how to dynamically spin up
more instances based on demand.  (kubernetes?)  I don't know enough yet to
use the right words.  I could do all this exploration without lc, but it is
so much easier to put together whatever processors I want in lc, so that I
can spend most of my (limited) energy focusing on the docker side.

One thing I may try to set up..  I have an old HP z800, with 24 possible
threads, and I also have most of the (english) files from project
gutenberg. I'd like to process and index all those files into a searchable
database, using 24 docker images at once, each assigned to a core.  IE take
advantage of my knowledge of LC, while at the same time, bypassing its
single thread limitations.

I have a similar goal with a bunch of climate data from
https://www.ncdc.noaa.gov/cdo-web/datatools that I want to use to calculate
worldwide temperature trends.  (Both of these things, as well as all the
docker stuff are over my head right now, but maybe I can close that gap.)


On Tue, Jul 10, 2018 at 2:38 PM Tom Glod via use-livecode <
use-livecode@lists.runrev.com> wrote:

> mike i'm really curious about what you are building to be running LC as a
> (web?) service?  I've done some tests with that but i have yet to gain
> complete clarity that I can use it the way I want . I've done some very
> basic testing on a centos box on digital ocean.  my bash code loooked like
> this before i got to the service
>
> yum -y install fontconfig freetype freetype-devel fontconfig-devel
> libstdc++
> yum -y install wget
> yum install monit
>
> thats all i needed to run it and i had successful connections,(I
> thinkI also tested locally so i can't be sur)  but ran into trouble
> when the requests went over a certain size then even my local running
> standalone couldn't get the data that the request included. i was using the
> httd library to accept and reply to requests.
>
> so i'm curious about your experience with that when you get to it.
>
>
>
> On Tue, Jul 10, 2018 at 2:18 PM, Mike Bonner via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
> > Hoping someone can help me shortcut this..
> > If I start with an alpine image, what things do I need to add so that LC
> > executables will run?  (using the -ui flag)
> > Or would I be better off starting with another base?   I'm looking to end
> > up with smallest possible docker that can do the job.
> > ___
> > use-livecode mailing list
> > use-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


Docker

2018-07-10 Thread Mike Bonner via use-livecode
Hoping someone can help me shortcut this..
If I start with an alpine image, what things do I need to add so that LC
executables will run?  (using the -ui flag)
Or would I be better off starting with another base?   I'm looking to end
up with smallest possible docker that can do the job.
___
use-livecode mailing list
use-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 are possible reasons for memory consumption ...

2018-07-08 Thread Mike Bonner via use-livecode
Or alternatively, check the pendingmessages and only send if there is not
already a message for the handler in question in queue.

I've had situations (in my case, bad coding) where I thought I was starting
a looping handler once ,but had left a call to that handler elsewhere
accidentally during the re-think process.  In those cases, even if it is a
seldom run handler that has the mistake, every time it is called, a new
instance of the loop starts.  In my case, (since I have trouble tracking
details as complexity grows beyond a certain point.. Small scale I'm great,
large scale, not so much) I've just made it a habit to always do the
pendingmessage check before sending again.  (I have lots of little rules
like this to help me manage my own personal limitations in a consistent
way.. Like always including a way to exit a tight repeat loop during
development at least, to avoid issues with runaways.)

Hmm. I tend to run on about things lately don't I?  Feel free to ignore any
extraneous blab.

On Sun, Jul 8, 2018 at 10:42 AM Douglas Ruisaard via use-livecode <
use-livecode@lists.runrev.com> wrote:

> To help determine if Brian's suggestion is occurring, you could put the
> following line in your "self perpetuating" code (assuming you're not
> running the code on a Mobile device which have no "messsage box") just
> before the "send... in x time ":
>
> put the pendingmessages
>
> If you see ANY output, then you've got multiple overlapping messages ...
> again, this assumes you only have ONE "loop" running.  Perhaps you can send
> the "offending" section of code for analysis?
>
>
>
___
use-livecode mailing list
use-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: odbc "information type out of range"

2018-07-06 Thread Mike Bonner via use-livecode
Ah k. was hoping.

On Fri, Jul 6, 2018 at 3:36 PM Mike Kerner via use-livecode <
use-livecode@lists.runrev.com> wrote:

> The bizarre parts are
> a) No errors returned from Valentina
> b) The operations succeed but I get an error, almost like LC is sending
> something extra to the ODBC driver.
>
> Ralph:
> Windows, connecting to Marxmeier's SQL/R (which is connecting to eloquence,
> a legacy mainframe environment for HP).
>
> Bob
> No
>
> mike,
> That gives me
>
> revdberr,[Marxmeier][SQL/R ODBC Server]37000 - Unexpected symbol (#1)
>
> syntax error near "("
>
>
> Unexpected symbol or invalid SQL/R language statement.
>
>
> On Fri, Jul 6, 2018 at 1:04 PM Mike Bonner via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
> > I have no way to test it, but if you change your insert to..
> > insert into employee (empno) values (double(-1))
> >
> > Does it make a difference?
> >
> >
> > On Fri, Jul 6, 2018 at 10:14 AM Mike Kerner via use-livecode <
> > use-livecode@lists.runrev.com> wrote:
> >
> > > Hmmm.  How about this:  The insert is actually succeeding, but I'm
> > getting
> > > the error.
> > >
> > > select count (*) from employee where empno=-1 -> 0
> > > insert into employee (empno) values (-1) -> "revdberr,[Microsoft][ODBC
> > > Driver Manager] Information type out of range"
> > > select count (*) from employee where empno=-1 -> 1
> > > delete from employee where empno = -1 -> "revdberr,[Microsoft][ODBC
> > Driver
> > > Manager] Information type out of range"
> > > select count (*) from employee where empno=-1 -> 0
> > > ___
> > > use-livecode mailing list
> > > use-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
> >
>
>
> --
> 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: odbc "information type out of range"

2018-07-06 Thread Mike Bonner via use-livecode
I have no way to test it, but if you change your insert to..
insert into employee (empno) values (double(-1))

Does it make a difference?


On Fri, Jul 6, 2018 at 10:14 AM Mike Kerner via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hmmm.  How about this:  The insert is actually succeeding, but I'm getting
> the error.
>
> select count (*) from employee where empno=-1 -> 0
> insert into employee (empno) values (-1) -> "revdberr,[Microsoft][ODBC
> Driver Manager] Information type out of range"
> select count (*) from employee where empno=-1 -> 1
> delete from employee where empno = -1 -> "revdberr,[Microsoft][ODBC Driver
> Manager] Information type out of range"
> select count (*) from employee where empno=-1 -> 0
> ___
> use-livecode mailing list
> use-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: Capture Keystrokes & MouseMovements without being in focus?

2018-07-06 Thread Mike Bonner via use-livecode
Cool, yep.  For that purpose it should work great.

Its interesting when using this method for a game.. One can be typing code
into the script editor, and the game does interesting things because its
still looping.  Not that I have ever inadvertently done such a thing...

On Thu, Jul 5, 2018 at 10:53 PM Tom Glod via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi Mike, actually the main problem I was facing is getting a hotkey press
> detected when another stack is in focus I think this function will
> allow me to do that.
>
> The keystroke counter was  something i wanted to do but can live without.
> Thanks, I will try this tomorrow ...i don't see why it wouldn't work for
> what I need.
>
> there is always an answer i guess. this community rocks.
>
> On Fri, Jul 6, 2018 at 12:23 AM, Mike Bonner via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
> > The only way I know of is to start a relatively fast send loop and check
> > the keysdown().  For some things it works fine but for most other things
> > its not a good answer since you can see if a key is down, but not how
> long
> > its down, or tell if it has been pressed, then pressed again before the
> > next loop cycle. All you can do is see that the key IS down.
> >
> > If you wanted to say.. Have a loop processing something in the
> background,
> > you could have it check the keysdown for 
> and
> > if they're present, use revspeak to say how far along the process is.  If
> > you want to do a real, accurate logging of keys though, I'd say its a no
> > go.
> >
> > On Thu, Jul 5, 2018 at 9:43 PM Tom Glod via use-livecode <
> > use-livecode@lists.runrev.com> wrote:
> >
> > > Hi folks,
> > >
> > > Is it possible to still trigger the rawKey message or the mousemove
> > > message? when the LC stack is not in focus?
> > >
> > > I know can can sort of create my own mousemove message by tracking the
> > > absolute (or is it relative) location of the mouse
> > >
> > > but the rawkey up message seems like a no go for any kind of workaround
> > >
> > > is there something i don't know about?
> > >
> > > on rawup
> > >
> > > I want to add 1 to MyStats["Keystrokes"]
> > >
> > > end rawup
> > >
> > > I'm afraid the answer is noso unless by some miracle ...
> > >
> > > Thank you.
> > > ___
> > > use-livecode mailing list
> > > use-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: Capture Keystrokes & MouseMovements without being in focus?

2018-07-05 Thread Mike Bonner via use-livecode
The only way I know of is to start a relatively fast send loop and check
the keysdown().  For some things it works fine but for most other things
its not a good answer since you can see if a key is down, but not how long
its down, or tell if it has been pressed, then pressed again before the
next loop cycle. All you can do is see that the key IS down.

If you wanted to say.. Have a loop processing something in the background,
you could have it check the keysdown for  and
if they're present, use revspeak to say how far along the process is.  If
you want to do a real, accurate logging of keys though, I'd say its a no go.

On Thu, Jul 5, 2018 at 9:43 PM Tom Glod via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi folks,
>
> Is it possible to still trigger the rawKey message or the mousemove
> message? when the LC stack is not in focus?
>
> I know can can sort of create my own mousemove message by tracking the
> absolute (or is it relative) location of the mouse
>
> but the rawkey up message seems like a no go for any kind of workaround
>
> is there something i don't know about?
>
> on rawup
>
> I want to add 1 to MyStats["Keystrokes"]
>
> end rawup
>
> I'm afraid the answer is noso unless by some miracle ...
>
> Thank you.
> ___
> use-livecode mailing list
> use-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: Script Only Stack Behaviors and Nesting

2018-07-02 Thread Mike Bonner via use-livecode
Curious if this would be useful.  It occurred to me that one could use
getters and setters in the behavior if one wanted a "central" location for
data for objects using that behavior.

Not as easy as just using an actual property set, but might end up being
faster?

To test I put the following into a button to use as a behavior..
local sOhBehaveLocalA

on mouseup
   -- sets a value in the local of the behavior object
   -- based on the long id of the object using the behavior
   set the setter[(the long id of me)] of (the behavior of me) to
random(4000)

   -- grabs the whole array from the behavior object
   put the getter of (the behavior of me) into tArray

   -- shows the value assigned to the array entry for the
   -- object using the behavior keyed by long id
   put tArray[the long id of me] & cr

   --cycles through all keys in the array returned by getter
   -- and shows values for all objects tracked by the getter/setter in the
behavior object
   put the keys of tArray into tKeys
   repeat for each line tLine in tKeys
  put tLine & ":" & tArray[tLine] & cr after msg
   end repeat

end mouseup

Then assigned the behavior to several buttons and it works well enough.
LIke I said, i'm not sure there is actually a point to this since there are
so many other ways the same objective could be reached, but thought I'd
toss it out there.  (sorry for the ugly code and silly example) I think I
read somewhere that setting a variable is faster than setting a property,
but.. /shrug

On Mon, Jul 2, 2018 at 6:27 PM Mark Wieder via use-livecode <
use-livecode@lists.runrev.com> wrote:

> On 07/02/2018 04:16 PM, Bob Sneidar via use-livecode wrote:
> > oic. Well getting the stacks custom property and referencing that is
> working for me. It's curious then if you can use the sLocal of this me,
> could you also use the sLocal of button x or stack y?? That would be very
> cool! That would mean you could get and set the script locals of another
> object.
>
> Ick
>
> --
>   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


Re: Sort IP List

2018-06-29 Thread Mike Bonner via use-livecode
You all are just too darn smart. great solution.

On Fri, Jun 29, 2018 at 5:54 PM Alex Tweedly via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Why not just do it directly (avoid the function call) ...
>
> function sortIPList2 pIPList
> set the itemdelimiter to "."
> try
>sort lines of pIPList ascending numeric \
>  by (item 1 of each * 16777216) + \
>  (item 2 of each *65536) + \
>  (item 3 of each *256) + \
>  (item 4 of each )
> catch theError
>breakpoint
> end try
> return pIPList
> end sortIPList2
>
> or if you prefer ...
> by item 4 of each + 256 * ( item 3 of each + 256 * (item 2 of each +
> 256 * item 1 of each ))
> ...
>
> Alex.
>
> On 30/06/2018 00:41, hh via use-livecode wrote:
> > Your IP addresses [0-255].[0-255].[0-255].[0-255]
> > are the hex IP numbers converted to base 256.
> > So you may try the following sorting function that
> > converts the IPs from base 256 to base 10 (decimal).
> >
> > function ip2dec x
> >set itemdel to "."
> >repeat with i=0 to 3
> >  add (item 4-i of x)*256^i to y
> >end repeat
> >return y
> > end ip2dec
> >
> > on mouseUp
> >put fld "ips" into s
> >sort s numeric by ip2dec(each) # <
> >put s into fld "out"
> > end mouseUp
> >
> >
> > ___
> > use-livecode mailing list
> > use-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: Sort IP List

2018-06-29 Thread Mike Bonner via use-livecode
Now that is weird because the sort is definitely working for me.OH
wait, you don't set the numberformat in your function.  Do you set it
elsewhere, and if so, does it stick when the function is called?  The sort
is definitely, no question, working for me.

I generate a list of IPs then in the msg box do this..

set the numberformat to "000"
set the itemdel to "."
put the millisec into tstart
sort lines of tList ascending numeric by (item 1 of each +0) & (item 2 of
each + 0) & (item 3 of each + 0) & (item 4 of each + 0)
put the millisec - tstart
put cr & tList after msg -- the list is sorted.

Not sure why it isn't working for you, but on the off chance its a version
difference, i'm on 9.0, community +, stable.

On Fri, Jun 29, 2018 at 4:33 PM Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I have good news and bad news!
>
> function sortIPList2 pIPList
>set the itemdelimiter to "."
>try
>   sort lines of pIPList ascending numeric \
> by (item 1 of each + 0) & \
> (item 2 of each + 0) & \
> (item 3 of each + 0) & \
> (item 4 of each + 0)
>catch theError
>   breakpoint
>end try
>return pIPList
> end sortIPList2
>
> With a small subset of data, it doesn't error meaning I have some cruft in
> the data. Fair enough. The bad news is... IT DOESN'T SORT! LOL!!! Reversing
> the items does not help either.
>
> Bob S
>
> > On Jun 29, 2018, at 15:16 , Mike Bonner via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Yup, that would be it!
>
>
> ___
> use-livecode mailing list
> use-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: Sort IP List

2018-06-29 Thread Mike Bonner via use-livecode
Yup, that would be it!

On Fri, Jun 29, 2018 at 4:15 PM Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Wait I know exactly what is wrong. I have a few lines that use CIDR
> notation ie. 192.168.1.0/24 and THAT is not a number!
>
> Bob S
>
>
> > On Jun 29, 2018, at 15:13 , Bob Sneidar via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Yeah mine won't run. I have:
> >
> > function sortIPList2 pIPList
> >   set the itemdelimiter to "."
> >   try
> >  sort lines of pIPList ascending numeric by (item 1 of each +0) &
> (item 2 of each + 0) & (item 3 of each + 0) & (item 4 of each + 0)
> >   catch theError
> >  breakpoint
> >   end try
> >   return pIPList
> > end sortIPList2
> >
> > Script hits breakpoint but there is nothing in theError. What version/OS
> are you running? We may have uncovered an engine anomaly.
> >
> > Bob S
> >
> >> On Jun 29, 2018, at 15:00 , Mike Bonner via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >>
> >> sort lines of tList ascending numeric by (item 1 of each +0) & (item 2
> of
> >> each + 0) & (item 3 of each + 0) & (item 4 of each + 0)
> >
> >
> > ___
> > use-livecode mailing list
> > use-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: Sort IP List

2018-06-29 Thread Mike Bonner via use-livecode
Oh, the above assumes setting the numberformat to "000" as you specified of
course.

On Fri, Jun 29, 2018 at 4:00 PM Mike Bonner  wrote:

> Thx for the clue, I see what you mean.
>
> I had tried to get something similar to your value(item 1 of each +0)
> method to work and something wasn't clicking, but after seeing yours, I
> think I have it working.
>
> sort lines of tList ascending numeric by (item 1 of each +0) & (item 2 of
> each + 0) & (item 3 of each + 0) & (item 4 of each + 0)
>
> The above seems to work fine (and I avoided using value() to avoid an
> unnecessary function call), you just have to remember to set the
> itemdelimiter to "." otherwise you get the error.  This may be faster
> because there aren't a bunch of function calls like my first idea, though
> I'm not sure how overhead compares since the numbers must still be
> evaluated.
>
> Just did some testing and it seems to be way way faster.  100k lines sort
> in 3/4 of a second.
>
> On Fri, Jun 29, 2018 at 3:18 PM Bob Sneidar via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
>> Yeah, no I get runtime error. 
>>
>> > On Jun 29, 2018, at 14:09 , Bob Sneidar via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>> >
>> > Yes because your ampersand operator is not passing different
>> arguements, it's concatenating the items together so that 10.2.245.6
>> produces the integer 1022456. But 10.22.2.6 produces 102226 which is
>> smaller, but ought to sort higher. Hence the 4 pass sort.
>> >
>> > But you got me thinking, what if you did something like:
>> >
>> > set the numberformat to "000"
>> > sort lines of tIPList numeric by \
>> >   value(item 1 of each +0) & \
>> >   value(item 2 of each +0) & \
>> >   value(item 3 of each +0) & \
>> >   value(item 4 of each)
>> >
>> > Bob S
>>
>>
>> ___
>> use-livecode mailing list
>> use-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: Sort IP List

2018-06-29 Thread Mike Bonner via use-livecode
Thx for the clue, I see what you mean.

I had tried to get something similar to your value(item 1 of each +0)
method to work and something wasn't clicking, but after seeing yours, I
think I have it working.

sort lines of tList ascending numeric by (item 1 of each +0) & (item 2 of
each + 0) & (item 3 of each + 0) & (item 4 of each + 0)

The above seems to work fine (and I avoided using value() to avoid an
unnecessary function call), you just have to remember to set the
itemdelimiter to "." otherwise you get the error.  This may be faster
because there aren't a bunch of function calls like my first idea, though
I'm not sure how overhead compares since the numbers must still be
evaluated.

Just did some testing and it seems to be way way faster.  100k lines sort
in 3/4 of a second.

On Fri, Jun 29, 2018 at 3:18 PM Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Yeah, no I get runtime error. 
>
> > On Jun 29, 2018, at 14:09 , Bob Sneidar via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Yes because your ampersand operator is not passing different arguements,
> it's concatenating the items together so that 10.2.245.6 produces the
> integer 1022456. But 10.22.2.6 produces 102226 which is smaller, but ought
> to sort higher. Hence the 4 pass sort.
> >
> > But you got me thinking, what if you did something like:
> >
> > set the numberformat to "000"
> > sort lines of tIPList numeric by \
> >   value(item 1 of each +0) & \
> >   value(item 2 of each +0) & \
> >   value(item 3 of each +0) & \
> >   value(item 4 of each)
> >
> > Bob S
>
>
> ___
> use-livecode mailing list
> use-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: Sort IP List

2018-06-29 Thread Mike Bonner via use-livecode
Actually, when using the multiple key sort, dont reverse the order since it
does it all in one go.

On Fri, Jun 29, 2018 at 11:29 AM Mike Bonner  wrote:

> Ok, now i'm curious about something.. I know its possible to designate
> multiple keys to a single sort using the form..
> sort lines of plist  by item 1 of each &  item 2 of each & item 3 of each
> & item 4 of each
> which works fine.
> But changing it to..
> sort lines of plist  ascending numeric by item 1 of each &  item 2 of
> each & item 3 of each & item 4 of each  -- reverse this for your desired
> sort
> doesn't sort numerically (even if each key is forced to numeric with a + 0)
>
> BTW, I had to go back to comments in an older version of LC to remember
> how to do the multiple-key sorts.
>
> Since it ignores the "numeric" part, if one limits ips to all 3 digit
> numbers, the sort works as expected despite sorting as  alpha.
>
> So my question is this.. Would it be a reasonable feature request to
> adjust sort so that its multiple key format respects the numeric sort type?
>
>
> On Fri, Jun 29, 2018 at 10:46 AM Bob Sneidar via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
>> A realistic expectation of IP addresses for a given network might only be
>> around 16,535 (class B network) assuming every address was in use, an
>> unlikely scenario. I thought of way to do this for an extremely large
>> number of addresses by reading a large file in 1000 line chunks into 4
>> columns of a SQL memory database, then querying using concatenation and
>> sorts on the 4 columns, and using limit 1,1000 1001,1000 2001,1000 etc. and
>> writing back to another file. The time to do this of course would be much
>> longer, but it would avoid any memory constraints.
>>
>> Bob S
>>
>>
>> > On Jun 29, 2018, at 09:35 , Mike Bonner via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>> >
>> > ## was writing this when your response showed up..
>> > Just did some tests.  For reasonable size lists of IP numbers, your
>> method
>> > is clearly faster. As lines increase the disparity shrinks (due to 4
>> > processings of the same lines rather than 1) until around 35000 lines at
>> > which point positions reverse and the disparity grows in favor of the
>> > function(each) method.
>> >
>> > After just a bit more testing, the fastest method (for anything over
>> 2
>> > lines) is to run through the whole list first converting it to numeric
>> and
>> > then do a single simple sort, but that leaves you with a straight list
>> of
>> > numbers that would then have to be re-divided into triads, so the post
>> > processing needed kills the whole idea.
>> >
>> > As for your response,
>> > Yes  the function is called by sort for each line and returns the
>> numbers
>> > to use to give that line its sort value.  It isn't as fast as I had
>> hoped
>> > most likely because it has to call a function for each line in the list.
>> > With the first method I posted, on my machine, the crossover point is
>> right
>> > around 35000 lines (at least on my system, at 35000 lines it takes 475
>> > millisec to 612 millisec vs the 4xsort)   At 200,000 lines the disparity
>> > grows to over 3 seconds difference, but i'm unsure what max length list
>> > might be reasonably expected.  The 4 sort method is by far the simplest
>> to
>> > code and is plenty fast for list under 10.
>> > The nicest part of your method is that if processing a huge list, its
>> easy
>> > to give visual feedback between each sort if need be.  But again, all
>> this
>> > is likely moot unless the ip list is huge.
>>
>>
>> ___
>> use-livecode mailing list
>> use-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: Sort IP List

2018-06-29 Thread Mike Bonner via use-livecode
Ok, now i'm curious about something.. I know its possible to designate
multiple keys to a single sort using the form..
sort lines of plist  by item 1 of each &  item 2 of each & item 3 of
each & item
4 of each
which works fine.
But changing it to..
sort lines of plist  ascending numeric by item 1 of each &  item 2 of each &
 item 3 of each & item 4 of each  -- reverse this for your desired sort
doesn't sort numerically (even if each key is forced to numeric with a + 0)

BTW, I had to go back to comments in an older version of LC to remember how
to do the multiple-key sorts.

Since it ignores the "numeric" part, if one limits ips to all 3 digit
numbers, the sort works as expected despite sorting as  alpha.

So my question is this.. Would it be a reasonable feature request to adjust
sort so that its multiple key format respects the numeric sort type?


On Fri, Jun 29, 2018 at 10:46 AM Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> A realistic expectation of IP addresses for a given network might only be
> around 16,535 (class B network) assuming every address was in use, an
> unlikely scenario. I thought of way to do this for an extremely large
> number of addresses by reading a large file in 1000 line chunks into 4
> columns of a SQL memory database, then querying using concatenation and
> sorts on the 4 columns, and using limit 1,1000 1001,1000 2001,1000 etc. and
> writing back to another file. The time to do this of course would be much
> longer, but it would avoid any memory constraints.
>
> Bob S
>
>
> > On Jun 29, 2018, at 09:35 , Mike Bonner via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > ## was writing this when your response showed up..
> > Just did some tests.  For reasonable size lists of IP numbers, your
> method
> > is clearly faster. As lines increase the disparity shrinks (due to 4
> > processings of the same lines rather than 1) until around 35000 lines at
> > which point positions reverse and the disparity grows in favor of the
> > function(each) method.
> >
> > After just a bit more testing, the fastest method (for anything over
> 2
> > lines) is to run through the whole list first converting it to numeric
> and
> > then do a single simple sort, but that leaves you with a straight list of
> > numbers that would then have to be re-divided into triads, so the post
> > processing needed kills the whole idea.
> >
> > As for your response,
> > Yes  the function is called by sort for each line and returns the numbers
> > to use to give that line its sort value.  It isn't as fast as I had hoped
> > most likely because it has to call a function for each line in the list.
> > With the first method I posted, on my machine, the crossover point is
> right
> > around 35000 lines (at least on my system, at 35000 lines it takes 475
> > millisec to 612 millisec vs the 4xsort)   At 200,000 lines the disparity
> > grows to over 3 seconds difference, but i'm unsure what max length list
> > might be reasonably expected.  The 4 sort method is by far the simplest
> to
> > code and is plenty fast for list under 10.
> > The nicest part of your method is that if processing a huge list, its
> easy
> > to give visual feedback between each sort if need be.  But again, all
> this
> > is likely moot unless the ip list is huge.
>
>
> ___
> use-livecode mailing list
> use-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: Sort IP List

2018-06-29 Thread Mike Bonner via use-livecode
## was writing this when your response showed up..
Just did some tests.  For reasonable size lists of IP numbers, your method
is clearly faster. As lines increase the disparity shrinks (due to 4
processings of the same lines rather than 1) until around 35000 lines at
which point positions reverse and the disparity grows in favor of the
function(each) method.

After just a bit more testing, the fastest method (for anything over 2
lines) is to run through the whole list first converting it to numeric and
then do a single simple sort, but that leaves you with a straight list of
numbers that would then have to be re-divided into triads, so the post
processing needed kills the whole idea.

As for your response,
Yes  the function is called by sort for each line and returns the numbers
to use to give that line its sort value.  It isn't as fast as I had hoped
most likely because it has to call a function for each line in the list.
With the first method I posted, on my machine, the crossover point is right
around 35000 lines (at least on my system, at 35000 lines it takes 475
millisec to 612 millisec vs the 4xsort)   At 200,000 lines the disparity
grows to over 3 seconds difference, but i'm unsure what max length list
might be reasonably expected.  The 4 sort method is by far the simplest to
code and is plenty fast for list under 10.
The nicest part of your method is that if processing a huge list, its easy
to give visual feedback between each sort if need be.  But again, all this
is likely moot unless the ip list is huge.

On Fri, Jun 29, 2018 at 9:37 AM Mike Bonner  wrote:

> I don't know what speed differences there might be, but another option is
> something like this..
>
> function ipfunc pIp
>set the itemdel to "."
>set the numberformat to "###" -- force length of each chunk to 3
>
> -- append the numbers together sans "." with padded 0's using numberformat
>repeat for each item tItem in pIp
>  put tItem +0 after tIp -- do the add to force the numberformat to
> work
>end repeat
>return tIp
> end ipfunc
>
> And then use it like so..
> sort lines of myIpList ascending numeric by ipfunc(each)
>
>
> On Fri, Jun 29, 2018 at 9:14 AM Bob Sneidar via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
>> Hi all.
>>
>> I somehow got on to how to sort IP addresses, seeing they are not real
>> numbers, and read in the dictionary that the sort command is a "stable
>> sort". This occured to me:
>>
>> function sortIPList pIPList
>>set the itemdelimiter to "."
>>sort lines of pIPList numeric by item 4 of each
>>sort lines of pIPList numeric by item 3 of each
>>sort lines of pIPList numeric by item 2 of each
>>sort lines of pIPList numeric by item 1 of each
>>return pIPList
>> end sortIPList
>>
>> Enjoy!
>>
>> Bob S
>>
>>
>> ___
>> use-livecode mailing list
>> use-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: Sort IP List

2018-06-29 Thread Mike Bonner via use-livecode
I don't know what speed differences there might be, but another option is
something like this..

function ipfunc pIp
   set the itemdel to "."
   set the numberformat to "###" -- force length of each chunk to 3

-- append the numbers together sans "." with padded 0's using numberformat
   repeat for each item tItem in pIp
 put tItem +0 after tIp -- do the add to force the numberformat to
work
   end repeat
   return tIp
end ipfunc

And then use it like so..
sort lines of myIpList ascending numeric by ipfunc(each)


On Fri, Jun 29, 2018 at 9:14 AM Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi all.
>
> I somehow got on to how to sort IP addresses, seeing they are not real
> numbers, and read in the dictionary that the sort command is a "stable
> sort". This occured to me:
>
> function sortIPList pIPList
>set the itemdelimiter to "."
>sort lines of pIPList numeric by item 4 of each
>sort lines of pIPList numeric by item 3 of each
>sort lines of pIPList numeric by item 2 of each
>sort lines of pIPList numeric by item 1 of each
>return pIPList
> end sortIPList
>
> Enjoy!
>
> Bob S
>
>
> ___
> use-livecode mailing list
> use-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: Grabbing a widget

2018-06-27 Thread Mike Bonner via use-livecode
I haven't found a way to make it stop sticking either.  And I agree with
the QCC entry that basic mouse event type messages including the ability to
use "grab" or whatever should be glommed on to all widgets in some way.
 Admittedly, the grab issue can likely be worked around (mousedown itself
works, you can have mousedown PUT a random number from the widgets script,
its the grab in this case that doesn't work..) so one could use the old
mouse is down set a flag mousemove method to change its location, but in
many cases grab/dragdrop is preferable.

On Wed, Jun 27, 2018 at 12:55 PM Klaus major-k via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Am 27.06.2018 um 20:30 schrieb Klaus major-k via use-livecode <
> use-livecode@lists.runrev.com>:
> > Hi Richmond,
> >> Am 27.06.2018 um 20:24 schrieb Richmond Mathewson via use-livecode <
> use-livecode@lists.runrev.com>:
> >> Indeed: but that is not what I, and subsequently, Klaus, found.
> >> If an SVG widget contains this script:
> >> on mouseDown
> >>  grab me
> >> end mouseDown
> >> in Edit mode, whether the mouse is down or up the widget moves with
> >> the mouse and cannot be released.
> >
> > EXACTLY!
> > Thanks for testing.
>
> In case someone is interested:
> 
>
>
> Best
>
> Klaus
> --
> Klaus Major
> http://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: Translation Service Deepl.com

2018-06-24 Thread Mike Bonner via use-livecode
Same method as yandex from a recent thread, built your query string some
way and send it to the server.

something like..
put urlencode("Text to translate") into tText
put  "https://api.deepl.com/v1/translate?text=; & tText &
"target_lang=EN_key=YourAuthKeyHere" into tUrl
get URL tUrl
put it

You could also use POST rather than get using the same base url (
https://api.deepl.com/v1/translate) according to the documentation.

On Sun, Jun 24, 2018 at 2:52 AM R.H. via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I like to draw your attention to DeepL Translator - an online translation
> service that does much better than anything before, including Google,
> Microsoft or whatever. There is a free service and a paid one as well.
>
> Right now it supports English, Spanish, Italian, French, German, Polish and
> Dutch.
>
> https://www.deepl.com
>
> They provide an API and I wonder how we could enable this. I am trying to
> get it to work in LiveCode. Or, maybe, someone has been doing this already?
>
> https://www.deepl.com/pro.html
>
> It says: "
> As a DeepL Pro user, not only are you able to translate on our website, but
> you are also able to integrate DeepL’s JSON-based REST API into your own
> products and platforms. This allows you to incorporate the world’s best
> machine translation technology into a variety of new applications. For
> example, a company could have their international service enquiries
> instantly translated by DeepL Pro, greatly simplifying business procedures
> and improving customer satisfaction.
> "
>
> (I am not affiliated with DeepL and just give the information after I found
> that the job it does is really amazing.)
>
> Roland
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: merge()

2018-06-15 Thread Mike Bonner via use-livecode
Cool, thanks!

On Fri, Jun 15, 2018 at 7:58 PM Brian Milby  wrote:

> I think that as long as you control the string that is passed to merge you
> should be fine.  But if the user were able to directly influence the string
> that is passed to merge, then they certainly could inject something.
>
> put the text of field 1 into tMerge
> put merge(tMerge) into tDangerousUse
> put merge("Field 1 contains: [[tMerge]]") into tSafeUse
>
> So, I think your assumption is correct.
>
> On Fri, Jun 15, 2018 at 8:06 PM, Mike Bonner via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
>> I just had a thought while pondering some code from another thread.  I
>> have
>> done things like put merge("This is a random number: [[random(tNum)]]")
>>
>> Since merge can do what do can, is there a way this method could be taken
>> advantage of using an injection type of attack?   I'm thinking the answer
>> is no, (and I haven't managed to find a way to inject yet,) other than
>> allowing a user to build the whole merge string themselves (which would be
>> a "bad thing to do" (c))
>>
>> Am I wrong?  Is it safe as long as I don't do anything careless?
>> ___
>> use-livecode mailing list
>> use-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: Regex (matchChunk) help...

2018-06-15 Thread Mike Bonner via use-livecode
Hey cool!   I'd use Jims (an marks) method.  MUCH simpler.

On Fri, Jun 15, 2018 at 7:06 PM Jim Lambert via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Building on what Mark Wieder elegantly wrote:
>
> > MarkW wrote:
> >
> >  filter lotsOfText with "*selkirkst*skyrider1*”
>
> function extractStrings lotsOfText, startWord, endWord
>
> replace cr with space in lotsOfText -- Makes sure lotsOfText is
> just a single line
>
> replace startWord with cr & startWord in lotsOfText -- Makes sure
> a line starts with the startWord
>
> replace endWord with endWord & cr in lotsOfText -- Makes sure a
> line ends with the endWord
>
> filter lotsOfText with "*" & startWord & "*" & endWord  — Mark’s
> suggestion
>
> return lotsOfText
>
> end extractStrings
>
>
> Try it with your original gibberish. I‘ve added a second instance of the
> string you want to extract to show that the function will return all
> instances.
>
>
> Use the *selkirkst* function to check whether a *string* contains a
>
> specified pattern. If *selkirkst* includes a pair of parentheses, the
>
> position of the substring matching the part of theregular expression inside
>
> the parentheses is placed in the variables in the *positionVarsList*. The
>
> number of the first character in the matching substring is placed in the
>
> first variable in the positionVarsList, and the number of the last
>
> *selkirkst is
>
> placed in the second **skyrider1*. Additional starting and ending
>
> positions, matching additional parenthetical expressions, are placed in
>
> additional pairs of variables in thepositionVarsList. If the
>
> *selkirkst* function
>
> returns false, the values of the variables in the positionVarsListare not
>
> *selkirkst is
>
> placed in the third **skyrider1*. changed. The string and
> regularExpression are always case-sensitive,
>
> regardless of the setting of the caseSensitive property. (If you need to
>
> make a case-insensitive comparison, use "(?i)" at the start of the
>
> regularExpression to make the match case-insensitive.)
>
>
> Jim Lambert
>
> ___
> use-livecode mailing list
> use-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

merge()

2018-06-15 Thread Mike Bonner via use-livecode
I just had a thought while pondering some code from another thread.  I have
done things like put merge("This is a random number: [[random(tNum)]]")

Since merge can do what do can, is there a way this method could be taken
advantage of using an injection type of attack?   I'm thinking the answer
is no, (and I haven't managed to find a way to inject yet,) other than
allowing a user to build the whole merge string themselves (which would be
a "bad thing to do" (c))

Am I wrong?  Is it safe as long as I don't do anything careless?
___
use-livecode mailing list
use-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: calling an api from a stack?

2018-06-15 Thread Mike Bonner via use-livecode
Thanks for the tip, and clarification.


On Fri, Jun 15, 2018 at 3:34 PM Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Yes, but you found more utility than I was thinking of. My thing is that
> when tracing/debugging, I need to see what a function returns, and I can
> only do that if I put the returned value or it or the result into a
> variable of some sort.
>
> Bob S
>
>
> > On Jun 15, 2018, at 14:28 , Mike Bonner via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > If you mean using merge inside the function, I guess one could do the
> merge
> > beforehand and pass it in as a parameter, or alternatively do the merge
> in
> > the function and return the generated url string as part of the returned
> > value.  IE change it like so..
> > function translate pText,pLang
> >   put merge(kGetTransUrl) into tUrl
> >   get url tUrl
> >   return "URLString: " & tUrl & cr & it
> > end translate
> >
> > Then just dump the first line if things are working right.  Hmm.
> Actually,
> > pre-merging is nice because it would allow the use of "load" with
> callbacks
> > for multiple url calls. Use the callback to process, part of which lets
> you
> > see the URL associated with the callback.  Sounds like a better option
> than
> > using a function call for sure.
>
>
> ___
> use-livecode mailing list
> use-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: calling an api from a stack?

2018-06-15 Thread Mike Bonner via use-livecode
If you mean using merge inside the function, I guess one could do the merge
beforehand and pass it in as a parameter, or alternatively do the merge in
the function and return the generated url string as part of the returned
value.  IE change it like so..
function translate pText,pLang
   put merge(kGetTransUrl) into tUrl
   get url tUrl
   return "URLString: " & tUrl & cr & it
end translate

Then just dump the first line if things are working right.  Hmm. Actually,
pre-merging is nice because it would allow the use of "load" with callbacks
for multiple url calls. Use the callback to process, part of which lets you
see the URL associated with the callback.  Sounds like a better option than
using a function call for sure.

On Fri, Jun 15, 2018 at 2:54 PM Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Again, this is why I don't like to nest functions. You cannot tell what
> the function returned without pulling it apart.
>
> Bob S
>
>
> > On Jun 15, 2018, at 10:40 , Mike Bonner via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > jsontoarray returns an array, you'll have to dig through the array to
> find
> > where pieces of information reside, but it pretty straightforward after
> you
> > poke around.
> >
> > For example.. If you instead do this..
> > put jsontoarray(tResult) into tArray
> >
> > you have an array variable named tArray.
>
>
> ___
> use-livecode mailing list
> use-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: Regex (matchChunk) help...

2018-06-15 Thread Mike Bonner via use-livecode
Glad it worked.   If it turns out there is a reason not to use trueword and
a for each loop, the same basic algorithm can be used with offset() but it
would be a bit more convoluted.
Basically, find the first offset for the beginning string, then use that to
skip chars to look for both the beginning string and ending string.  If
both are found, replace the initial offset for beginning with the new
offset, use that info for the next chars to skip, and do it again.

There would be several more things to watch for, like having a current
beginning offset, doing your check, and making sure you still have a match
even if there isn't another beginning offset, and only an end. (and various
other combinations i'm sure) but it shouldn't be too bad to figure out if
the other solution is ruled out for some reason.

On Fri, Jun 15, 2018 at 12:32 PM Glen Bojsza via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi Mike,
>
> Yes this worksnever used or knew about trueword.
>
> thanks!
>
> Glen
>
> On Fri, Jun 15, 2018 at 1:21 PM, Mike Bonner via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
> > Try this..
> >
> > on mouseup
> >local tCharOffset
> >--set the text of field 1 to the text of field 1
> >put the text of field 1 into tText
> >put "beginning" into tstartword -- string begin
> >put "ending" into tEndword -- string end
> >put 1 into tCounter -- tracks current word
> >repeat for each trueword tWord in tText
> >   switch tWord
> >  case tStartword
> > put tCounter into tPair
> > break
> >  case tEndword
> > if tPair is not empty then
> >put tPair & comma & tCounter & cr after tPairs
> > end if
> > break
> >   end switch
> >   add 1 to tcounter
> >end repeat
> >delete the last char of tPairs
> >repeat for each line tLine in tPairs
> >   set the textcolor of trueword (item 1 of tLine) to (item 2 of
> tLine)
> > of field 1 to "blue"
> >end repeat
> > end mouseup
> >
> > On Fri, Jun 15, 2018 at 11:03 AM Glen Bojsza via use-livecode <
> > use-livecode@lists.runrev.com> wrote:
> >
> > > Mike, I believe that you are correct in understanding what I am trying
> to
> > > extract.
> > >
> > > I will need a bit more time to work through your solution.
> > >
> > > regards,
> > >
> > > Glen
> > > ___
> > > use-livecode mailing list
> > > use-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: Regex (matchChunk) help...

2018-06-15 Thread Mike Bonner via use-livecode
 Slightly cleaned up, and adjusted to empty tPair after a match.  (on the
off chance there is a second ending without a matching new beginning word)



> on mouseup
>put the text of field 1 into tText
>put "beginning" into tstartword -- string begin
>put "ending" into tEndword -- string end
>put 1 into tCounter -- tracks current word
>repeat for each trueword tWord in tText
>   switch tWord
>  case tStartword
> put tCounter into tPair
> break
>  case tEndword
> if tPair is not empty then
>put tPair & comma & tCounter & cr after tPairs
> put empty into tPair
> end if
> break
>   end switch
>   add 1 to tcounter
>end repeat
>delete the last char of tPairs
>repeat for each line tLine in tPairs
>   set the textcolor of trueword (item 1 of tLine) to (item 2 of tLine)
> of field 1 to "blue"
>end repeat
> end mouseup
>
___
use-livecode mailing list
use-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: calling an api from a stack?

2018-06-15 Thread Mike Bonner via use-livecode
jsontoarray returns an array, you'll have to dig through the array to find
where pieces of information reside, but it pretty straightforward after you
poke around.

For example.. If you instead do this..
put jsontoarray(tResult) into tArray

you have an array variable named tArray.
If you-- put the keys of tArray you'll see the first level of keys.
One of the keys is named "text" and it has a numeric subkey named 1
So if you-- put tArray["text"][1] into field 1
The translation will be placed into the field.

YOu can use the "put the keys"  syntax to find subkeys too, so if you-- put
the keys of tArray["text"]  you get back the single subkey 1. If you were
to-- put the keys of tArray["text"][1] you would get nothing back because
there are no subkeys.  Instead, a value has been placed into key
["text"][1] which is your translated text.  Its pretty easy to poke around
an array this way and figure things out, especially since the array for
this is pretty simple. (also look at "elements" in the dictionary)

On Fri, Jun 15, 2018 at 11:07 AM Eric A. Engle via use-livecode <
use-livecode@lists.runrev.com> wrote:

> This works, sort of:
>
>   put URL "
> https://translate.yandex.net/api/v1.5/tr.json/translate?key=trnsl.1.1.20180527T091305Z.7f33f9fb3f66f0bb.d573f1d9a6336a981504916600c45f49255938b3=hello%20world=en-de;
> into tResult
>   put tResult into card field 1
>   --put JsonImport(tResult) into  tResults
>   --put JsonToArray(tResults) into tProfile
>   put tResult & return into cd fld 1
>   set the itemdelimiter to "["
>   put the last item of tResult after cd fld 1
>
> for some reason JsonImport and JsonToArray return nothing. I can however
> set delimiter to [ and then programmatically delete the first and last 3
> chars after the last item of tResult. But why can't, or how, must I extract
> from Json?
>
> ___
> use-livecode mailing list
> use-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: Regex (matchChunk) help...

2018-06-15 Thread Mike Bonner via use-livecode
Try this..

on mouseup
   local tCharOffset
   --set the text of field 1 to the text of field 1
   put the text of field 1 into tText
   put "beginning" into tstartword -- string begin
   put "ending" into tEndword -- string end
   put 1 into tCounter -- tracks current word
   repeat for each trueword tWord in tText
  switch tWord
 case tStartword
put tCounter into tPair
break
 case tEndword
if tPair is not empty then
   put tPair & comma & tCounter & cr after tPairs
end if
break
  end switch
  add 1 to tcounter
   end repeat
   delete the last char of tPairs
   repeat for each line tLine in tPairs
  set the textcolor of trueword (item 1 of tLine) to (item 2 of tLine)
of field 1 to "blue"
   end repeat
end mouseup

On Fri, Jun 15, 2018 at 11:03 AM Glen Bojsza via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Mike, I believe that you are correct in understanding what I am trying to
> extract.
>
> I will need a bit more time to work through your solution.
>
> regards,
>
> Glen
> ___
> use-livecode mailing list
> use-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: Regex (matchChunk) help...

2018-06-15 Thread Mike Bonner via use-livecode
If I understand correctly.. If you find the beginning string occurrence,
and then find another beginning string, you want to ignore the first, and
only take strings where beginning and end have no intermediate beginnings?
Like this I mean..

beginning blah blah blah blah blah *beginning blah blah blah blah ending*

Where you would only want the bold part to match?

If so, it might be easiest to do a repeat for each trueword loop.

put 1 into tCounter
repeat for each trueword tword in tText
/*pseudocode
check the word. If its the beginning word, keep track of it using tCounter
so you know what word it was
If you're tracking a beginning and you hit a beginning again, track that
one instead.
If its the ending word, and you have a beginning word being tracked, place
the pair of word numbers into a list of found strings and reset the begin
tracker to empty
if its neither, do nothing
increment the counter
next loop
*/
end repeat

Of course if I've misunderstood what you need, kindly ignore this.

On Fri, Jun 15, 2018 at 10:27 AM Jerry Jensen via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Will this do what you want? (untested)
>
> put empty into tExtract
> repeat for each line L in bigText
>   if char -9 to -1 of L is “skyrider1” then
> if char 1 to 9 of L is “selkirkst” then
>   put L & return after tExtract
> end if
>   end if
> end repeat
> if char -1 of tExtract is return then delete char -1 of tExtract
>
> > On Jun 15, 2018, at 8:45 AM, Glen Bojsza via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Hello,
> >
> > I have a couple of hundred pages of text where I need to extract out a
> > different string.
> >
> > The ending of each string I need has the same endingskyrider1
> >
> > The beginning of each string is the same   selkirkst
> >
> > The middle of each string can be any text.
> >
> > The problem is that within each line where a string exists there are
> > several strings that have the same beginning selkirkst but none of the
> have
> > the correct ending skyrider1.
> >
> > My thoughts are to find ending of the string first and then work
> backwards
> > to the first beginning string.
> >
> > I created the following example which is gibberish but should make this
> > clearer... this is the string I want to extract from the line given is
> > *selkirkst is
> > placed in the second **skyrider1*
> >
> >
> >
> > Use the *selkirkst* function to check whether a *string* contains a
> > specified pattern. If *selkirkst* includes a pair of parentheses, the
> > position of the substring matching the part of theregular expression
> inside
> > the parentheses is placed in the variables in the *positionVarsList*. The
> > number of the first character in the matching substring is placed in the
> > first variable in the positionVarsList, and the number of the last
> > *selkirkst is
> > placed in the second **skyrider1*. Additional starting and ending
> > positions, matching additional parenthetical expressions, are placed in
> > additional pairs of variables in thepositionVarsList. If the
> > *selkirkst* function
> > returns false, the values of the variables in the positionVarsListare not
> > changed. The string and regularExpression are always case-sensitive,
> > regardless of the setting of the caseSensitive property. (If you need to
> > make a case-insensitive comparison, use "(?i)" at the start of the
> > regularExpression to make the match case-insensitive.)
> >
> > The next line will not have *is placed in the second*  but some other
> text
> > *selkirkst*     *skyrider1*
> >
> > I am not sure if this explains it well enough but I believe a regex
> > expression could be used (or perhaps a matchChunk) to extract the correct
> > string from each line of text.
> >
> > Any suggestions?
> >
> > thanks,
> >
> > Glen
> > ___
> > use-livecode mailing list
> > use-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: calling an api from a stack?

2018-06-15 Thread Mike Bonner via use-livecode
/*
A quick and dirty example of using yandex translator
Fill in your key then use the 2 functions to try things out.
Put this in your card or stack script, then call the desired function
passing in the required parameters.
*/
constant kKey="put your key here"

constant kGetTransURL="
https://translate.yandex.net/api/v1.5/tr.json/translate?key=[[kKey]]=[[urlencode(pText)]]=[[pLang]]=plain=1
"
constant kGuessLanguageUrl="
https://translate.yandex.net/api/v1.5/tr.json/detect?key=[[kKey]]=[[urlencode(pText)]]=[[pHints]]
"

/* The translate function.
pText is the text to translate
pLange is the target language. It can either be in "source-target" version,
or just target, allowing the system to guess the source language
Returns json and pops it into the message box.
It also has the option turned on to tell you its best guess language,
so that if you use the version (for example) en-es to go from english to
spanish
you can see if it agrees with you on the source language.
If you look at the constant kGetTransUrl, you can see
that when the merge is done, the text is urlencoded as part of the merge.
Do this for all text being sent for translation/analysis.
*/

function translate pText,pLang
   get URL merge(kGetTransUrl)
   return it & cr & the result
end translate

/*
 Just tries to guess the source language.
 pText again, is the text to send
 pHints is an optional comma delimited list
 of languages that you suspect might be the source.
 IE "es,fr" It is safe to send an empty string for pHints
 and let yandex check against all languages.
*/
function guessLanguage pText,pHints
   get URL merge(kGuessLanguageUrl)
   return it & cr & the result
end guessLanguage

On Fri, Jun 15, 2018 at 8:19 AM Eric A. Engle via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I am trying to make a call to the yandex translate api for a stack i am
> working on.
> i could do this pretty handily in HTML but I want to do it in livecode.
>
> I tried working with this but using yandex api instead of google
>
>
> https://stackoverflow.com/questions/35957054/is-it-possible-to-create-a-translator-in-livecode-for-my-app-which-translates-an
>
> no joy; this got me no further.
>
> https://forums.livecode.com/viewtopic.php?t=14451
>
>
> thanks for any ideas. yandex api is here
> https://tech.yandex.com/translate/
>
> ___
> use-livecode mailing list
> use-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: scancodes

2018-06-11 Thread Mike Bonner via use-livecode
Don't think of a key press and key release as if they should be 2 different
can codes, instead think of them as as being state changes.  Like a light.
Send power to the lightbulb, the light is on. Remove power from the bulb,
the light is off.  The bulb is still the same bulb.   Same with the
keyboard and keycodes.. The light is on! (key pressed)  The light is off!
(key released)  The identifier for the key (the scancode) remains the
same.  Or from a livecode perspective.. Click and hold a button and on
mousedown, report the target.  on mouseup, the same target is reported due
to a state change.  Click begun (mousedown)  click completed (mouseup).  So
no, the scancodes shouldn't be different.  (If you play with an arduino,
the same applies there.  Checking and changing pin states, setting a
voltage high, or low, but the pin assignment remains the same, only its
state changes from high to low, IE on to off)


On Mon, Jun 11, 2018 at 12:51 PM, Richmond Mathewson via use-livecode <
use-livecode@lists.runrev.com> wrote:

> So . . . messing around, as one does, I started to think about scancodes:
> that is to say, signals sent by USB devices (and others)
> when keys are pressed . . .
>
> The main reason for this is that if I have this sort of code in a LiveCode
> stack:
>
> on rawKeyDown RD
>  put RD
> end rawKeyDown
>
> on rawKeyUp RU
>   put RU
> end rawKeyUp
>
> RD and RU will be the same,
>
> while the actual scancodes sent from the keyboard to the computer should
> be different for
> keyDown and keyUp.
>
> I realise that this is fairly silly unless one wants one's program to do
> different things from a keyDown to a keyUp, and that there are
> comparatively straightforward
> ways to ensure this without accessing the scancodes.
>
> Notwithstanding . . .
>
> Richmond.
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Area of regular polygon triangles

2018-06-07 Thread Mike Bonner via use-livecode
Cool!

On Thu, Jun 7, 2018 at 5:08 PM, David Epstein via use-livecode <
use-livecode@lists.runrev.com> wrote:

> While trying Mike Bonner's suggestion of "manual" measuring, I learned the
> answer:  a regular polygon whose official length is L and width is W is
> inscribed in the oval whose length is L and width is W.  So for an
> equilateral triangle the area will be 3/4 * 3^.5 * R^2 (where R = L = W).
>
> David Epstein
> ___
> use-livecode mailing list
> use-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: Area of regular polygon triangles

2018-06-06 Thread Mike Bonner via use-livecode
If you need to use the box method, and the control rect isn't perfect,  it
might be easier to create the rect on your own.  Go through the points and
find the topmost, left most, rightmost, bottom most coordinates and that
gives you your box.  Alternatively, if you just want the area and don't
care how you get it the equation is pretty straightforward.

area
=
A
x
(
B
y
−
C
y
)
+
B
x
(
C
y
−
A
y
)
+
C
x
(
A
y
−
B
y
)
2
where Ax and Ay are the x and y coordinates of the point A etc..   I have a
stack that does this while dragging points around, it works well enough.

On Wed, Jun 6, 2018 at 5:14 PM, David Epstein via use-livecode <
use-livecode@lists.runrev.com> wrote:

> If a regular polygon has 4 or 8 sides it seems to be inscribed so that all
> points touch the square defined by the object’s height and width, which
> means that it should be fairly easy to deduce the polygon’s area.
> But with 3 sides, the triangle appears slightly smaller than the maximum
> size that could fit into that square.  Is there some math that would give
> me the area of that triangle from the height and width of the square (i.e.,
> the official height and width of the polygon object)?
> David Epstein
> ___
> use-livecode mailing list
> use-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: SQL Help

2018-06-01 Thread Mike Bonner via use-livecode
if I understand correctly, and just off the top of my head, using "limit"
is one way to do this...
The sql pseudo code would be something like:  select * from yourtable order
by iStoreGrp descending where meterNum = 1 AND valveNum = 3 limit 1
This would grab all the rows, sort them by istoregrp and return the top
entry

On Fri, Jun 1, 2018 at 6:31 PM, William Prothero via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Folks:
> Maybe someone can answer this easily and save me some hair pulling. I know
> it’s google-able, but I’ve tried and know it’s going to be a trudge to get
> the right format.
>
> I want to make a query to a mySQL db that:
> The table is named: “valveFlowsA”
> I want the query to return the row with the maximum of a column named
> “iStoreGrp” when
> columns named “meterNum” and “valveNum” are specified. So, with meterNum
> =1 and
> valveNum =3, I would get the row for the maximum value of “iStoreGrp”.
>
> All of these columns are integers.
>
> If anybody has this query in their quiver of tools, please let me know.
> Thanks!
>
> Bill
>
> William A. Prothero
> http://earthlearningsolutions.org
>
> ___
> use-livecode mailing list
> use-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: UTF8 on LC server

2018-05-31 Thread Mike Bonner via use-livecode
oops, dyslexic typo on my part, sorry about that.

On Thu, May 31, 2018 at 6:33 PM, Alex Tweedly via use-livecode <
use-livecode@lists.runrev.com> wrote:

>
>
> On 01/06/2018 01:17, Mike Bonner via use-livecode wrote:
>
>> on-rev host is 7.0.1  you can get it with version()
>>
> Hmmm - I get 7.1.0 (on sage).
>
> And that might just be the problem with Unicode handling  I think it
> improved in LC v 8 upwards,  but that's an area I know nothing about.
>
> You can, I believe, ask on-rev support to upgrade you to a modern version
> for each domain (or install your own copy of LC Server.
>
> I've been tempted to submit an on-rev *bug* report that they are still
> using an obsolete, no-longer-supported version of LC Server. I really don't
> understand why they don't upgrade the default to at least 8.x STABLE.
> Perhaps preferably 9.x STABLE - if they really believe 9.x has a STABLE
> release.
>
>
> -- Alex.
>
> On Thu, May 31, 2018 at 6:14 PM, Tim Selander via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>>
>> Hi Kee and Alex,
>>>
>>> The original documents I'm working with are UTF8, so that's that I've
>>> been
>>> using. So converting them to UTF16 is recommended? I'll try that.
>>>
>>> Alex, desktop is version 8 something, and the server is the one installed
>>> on the on-rev host; can't remember what the key in $_Server for than info
>>> is, and Googling failed me this time...
>>>
>>> Tim Selander
>>>
>>> On 2018/06/01 8:55, kee nethery via use-livecode wrote:
>>>
>>> I’m assuming you are using “unicode” (aka UTF-16) and not UTF8 to do all
>>>> your transforming of the data?
>>>> Kee
>>>>
>>>> On May 31, 2018, at 4:46 PM, Tim Selander via use-livecode <
>>>>
>>>>> use-livecode@lists.runrev.com> wrote:
>>>>>
>>>>> Thanks, Kee.
>>>>>
>>>>> Actually, I had found the reference to codepoint in the dictionary and
>>>>> tried it. But it seems to work the same as character -- breaking
>>>>> kanji. My
>>>>> test code is "put codepoint 500 to 550 of variable1" and the webpage
>>>>> shows:
>>>>> �。こうして夕があり、朝があった。�  The beginning and ending kanji got split in half.
>>>>> Identical results to "put char 500 to 550."
>>>>>
>>>>> Tim Selander
>>>>>
>>>>> ___
>>>> use-livecode mailing list
>>>> use-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
>
___
use-livecode mailing list
use-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: UTF8 on LC server

2018-05-31 Thread Mike Bonner via use-livecode
on-rev host is 7.0.1  you can get it with version()

On Thu, May 31, 2018 at 6:14 PM, Tim Selander via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi Kee and Alex,
>
> The original documents I'm working with are UTF8, so that's that I've been
> using. So converting them to UTF16 is recommended? I'll try that.
>
> Alex, desktop is version 8 something, and the server is the one installed
> on the on-rev host; can't remember what the key in $_Server for than info
> is, and Googling failed me this time...
>
> Tim Selander
>
> On 2018/06/01 8:55, kee nethery via use-livecode wrote:
>
>> I’m assuming you are using “unicode” (aka UTF-16) and not UTF8 to do all
>> your transforming of the data?
>> Kee
>>
>> On May 31, 2018, at 4:46 PM, Tim Selander via use-livecode <
>>> use-livecode@lists.runrev.com> wrote:
>>>
>>> Thanks, Kee.
>>>
>>> Actually, I had found the reference to codepoint in the dictionary and
>>> tried it. But it seems to work the same as character -- breaking kanji. My
>>> test code is "put codepoint 500 to 550 of variable1" and the webpage shows:
>>> �。こうして夕があり、朝があった。�  The beginning and ending kanji got split in half.
>>> Identical results to "put char 500 to 550."
>>>
>>> Tim Selander
>>>
>> ___
>> use-livecode mailing list
>> use-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: LC >= 8 no more HC friendly?

2018-05-30 Thread Mike Bonner via use-livecode
Just curious, if you open with lc 5, and then save a copy as an lc stack,
can you then open it with the later version?  (and do the usual "messages
off" thing too of course)

On Wed, May 30, 2018 at 7:55 AM, Klaus major-k via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi friends,
>
> I am trying to open some old HyperCard stacks (thanks Jaqueline :-)
> and LC 8.1.9, 8.1.10 and 9.0 immediately and silently CRASH without notice
> after selecting hte file in hte open dialog, I only get the macOS crash
> report.
>
> Using LC 5.02, I can open the stacks without problem, except the usual
> errors
> when opening a HC stack (using reserved words for variables etc.)
>
> Any insights or hints?
>
>
> Best
>
> Klaus
>
> --
> Klaus Major
> http://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: Graphing Solution...

2018-05-27 Thread Mike Bonner via use-livecode
Actually, change 2 lines and I think it'll work better:
Line 932, change to:  updateGridRect(rectangle [gridLeft(), tPadding +
tNeededTop, mWidth - tPadding - mMaxYLabelWidth, gridBottom()])

Line 1061 change to: fill text tString at left of rectangle [tYRight +
gridPadding(),tY-20,tYRight + mMaxYLabelWidth + gridPadding(),tY+20] on
this canvas


On Sun, May 27, 2018 at 10:05 PM, Mike Bonner  wrote:

> I floundered around cluelessly with it for a bit, randomly changing a few
> things till I got something that seems to work.  I'm sure there are things
> I still misunderstand about this, and that I've added code that probably
> doesn't need to be there.  Also not sure if there will be issues with
> larger labels etc, but if you're interested, the modified stuff can be
> found here: https://www.dropbox.com/s/bsj0u87tlg54xt2/com.livecode.widget.
> linegraphyright.zip?dl=1
>
> If you do a diff of the stock lcb and the lcb in the zip archive, you can
> see all my (unremarked) floundering differences.  As it sits though, the
> default data comes up and displays fine.  Just checked with larger values,
> some of the numbers I poked in there should probably be increased a little,
> though i'm sure theres a better way to calculate such things.
>
> On Sun, May 27, 2018 at 9:28 PM, Brian Milby via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
>> Here is the link on GitHub...
>>
>> https://github.com/livecode/livecode/tree/develop/extensions
>> /widgets/graph
>>
>> On May 27, 2018, 10:24 PM -0500, Mark Wieder via use-livecode <
>> use-livecode@lists.runrev.com>, wrote:
>> > On 05/27/2018 07:15 PM, Glen Bojsza via use-livecode wrote:
>> > > Hi Brian,
>> > >
>> > > They are good ideas...I haven't done anything with widgets.
>> > >
>> > > How do I get access to the source code?
>> >
>> > The source file is graph.lcb, and where it's stored depends on what
>> > operating system you're working with.
>> >
>> > /Extensions/com.livecode.widget.linegraph
>> >
>> > so on my linux system, I've got it in
>> > /opt/livecodecommunity-9.0.0.x86_64/Extensions...
>> >
>> > and obviously it will be in different places on Windows and OSX.
>> >
>> > But beware that coding in LCB is quite different from "normal" LiveCode
>> > coding. Copy the source file, put it into its own folder somewhere, edit
>> > it (it's a text file), then open it in the extension builder and test
>> > the changes. Have fun.
>> >
>> > --
>> > 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: Graphing Solution...

2018-05-27 Thread Mike Bonner via use-livecode
I floundered around cluelessly with it for a bit, randomly changing a few
things till I got something that seems to work.  I'm sure there are things
I still misunderstand about this, and that I've added code that probably
doesn't need to be there.  Also not sure if there will be issues with
larger labels etc, but if you're interested, the modified stuff can be
found here:
https://www.dropbox.com/s/bsj0u87tlg54xt2/com.livecode.widget.linegraphyright.zip?dl=1


If you do a diff of the stock lcb and the lcb in the zip archive, you can
see all my (unremarked) floundering differences.  As it sits though, the
default data comes up and displays fine.  Just checked with larger values,
some of the numbers I poked in there should probably be increased a little,
though i'm sure theres a better way to calculate such things.

On Sun, May 27, 2018 at 9:28 PM, Brian Milby via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Here is the link on GitHub...
>
> https://github.com/livecode/livecode/tree/develop/extensions/widgets/graph
>
> On May 27, 2018, 10:24 PM -0500, Mark Wieder via use-livecode <
> use-livecode@lists.runrev.com>, wrote:
> > On 05/27/2018 07:15 PM, Glen Bojsza via use-livecode wrote:
> > > Hi Brian,
> > >
> > > They are good ideas...I haven't done anything with widgets.
> > >
> > > How do I get access to the source code?
> >
> > The source file is graph.lcb, and where it's stored depends on what
> > operating system you're working with.
> >
> > /Extensions/com.livecode.widget.linegraph
> >
> > so on my linux system, I've got it in
> > /opt/livecodecommunity-9.0.0.x86_64/Extensions...
> >
> > and obviously it will be in different places on Windows and OSX.
> >
> > But beware that coding in LCB is quite different from "normal" LiveCode
> > coding. Copy the source file, put it into its own folder somewhere, edit
> > it (it's a text file), then open it in the extension builder and test
> > the changes. Have fun.
> >
> > --
> > 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: Was: URGENT: MergGoogle no longer works on iOS: CLIENTS VERY UNHAPPY

2018-05-25 Thread Mike Bonner via use-livecode
 Curry-  don't know if such a thing would help your situation, but i'm
attaching a photo of my lift.  Its simply a relatively small i-beam solidly
anchored, a trolly to match, a 2000lb hoist (overkill) and a very simple,
self designed sling hooked to a home made spreader bar.  Lower it, sling in
front, spreader bar in back under my arms, push the button, and voila' I'm
levitating, at which point its easy to peter pan back and forth across the
room.  (Though I look like i'm ready to be processed at a butcher shop)
Compared to the cost of a "professional" ceiling lift, the cost was around
8K less before install costs (because you apparently can't just buy parts
here and DIY.)  Photo isn't great but here it is if LC will let it post.
Ignore the mess.

No go on attaching the photo, so heres the dropbox.
https://www.dropbox.com/s/5eckjh1hocpqeqx/IMG_2091.JPG?dl=1
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Was: URGENT: MergGoogle no longer works on iOS: CLIENTS VERY UNHAPPY

2018-05-25 Thread Mike Bonner via use-livecode
 Hey Sean,

While its true that the full details of what was going on weren't
available, there were 2 things that stood out to me from your previous
writings.  Large amounts of distress, and a monetary connection to the
distress.  I can't help with the distress directly, but it just makes sense
to me that sending a bit of financial care your way might help smooth out
this rough patch.  I myself have had to face down my pride issues and
accept help in the past.. well actually all the time due to my health
stuff.  If not for the care of people around me, my position would be much
much worse. The most recent hit to my pride was the loss of ability to self
transfer into my walk in tub, (a thing I learned the hard way.)  People who
care about me got together, designed, and installed a ceiling lift that
works amazingly well.  And I can do an engine swap in my bathroom.  (Its a
mite over-engineered.)  Just one example of people being awesome.

One thing I've taken to heart is a simple saying.  "Accepting the gift,
honors the giver."

If it will help, I'd be honored to assist a bit more, but now that we've
heard from you, I would prefer to leave that to your discretion.  If you
wish, you are welcome to send a direct email to me.

Take care of yourself,

Mike
___
use-livecode mailing list
use-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: on-rev choosing engine

2018-05-24 Thread Mike Bonner via use-livecode
Ah, that would explain it.  I'll install my own versions then. Thanks for
the help, much appreciated.

On Thu, May 24, 2018 at 2:06 PM, Matthias Rebbe via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I am pretty sure, that after the move from OHV to LiquidWeb the different
> server engines were not installed again.
>
> Matthias
>
>
> > Am 24.05.2018 um 21:46 schrieb Mike Bonner via use-livecode <
> use-livecode@lists.runrev.com>:
> >
> > Thanks, I'll try this and see what I can figure out.  It seems though
> that
> > the server engines aren't there. (not found) type errors.  Using the info
> > from that lesson, there should be an engine at
> > /cgi-bin/livecode-server-4.6.3 for example.  (or any version based on the
> > same format, with the exception of the default (7.0.1) which is at
> > /cgi-bin/livecode-server according to the lesson, and the irev version is
> > in a different place too.  )
> >
> > Then it goes on to give the example as in 4.6.3 which matches the
> > description of how things are named/placed.  But its not there.  When
> > running standard, no .htaccess, the livecode-server is located at
> >
> > /usr/local/cpanel/cgi-sys/livecodeserver-7.1.0/livecode-server
> >
> > So it appears that the lesson is wrong here too, and that the handler for
> > .lc files would point to /cgi-bin/livecodeserver-7.1.0/livecode-server
> > rather than as described.
> >
> > I thought maybe things were the same, so tried with
> > /cgi-bin/livecodeserver-4.6.3/livecode-server but thats a no.  I also
> did a
> > shell call, when doing shell("ls
> > /usr/local/cpanel/cgi-sys/livecodeserver-7.1.0/  the files are there as
> > expected.   When doing the same for livecodeserver-6.4.3 the directory
> > doesn't exist. All this would be made easier if I had permission to ls
> > /usr/local/cpanel/cgi-sys/ to look at whats there, but thats not
> possible.
> >
> > I'm guessing the scriptalias points to /usr/local/cpanel/cgi-sys/ so if
> > anyone has a clue how things are actually named for LC server versions
> > underneath that, that actually work, I'd appreciate the info. Otherwise,
> > I'll msg support and ask there.
> >
> >
> > On Thu, May 24, 2018 at 12:53 PM, Matthias Rebbe via use-livecode <
> > use-livecode@lists.runrev.com> wrote:
> >
> >> You could try to use this method for .htaccess
> >>
> >> Options +ExecCGI
> >> Action custom-livecode /cgi-bin/livecode-server/livecode-server
> >> 
> >> SetHandler custom-livecode
> >> 
> >>
> >>
> >>
> >> Please note, that if you have several add-on domains and each domain
> uses
> >> its own root folder and you want to use the custom livecode server
> >> installation with each domain,  you have to put livecode server and
> >> .htaccess into each root folder.
> >>
> >>
> >> Regards,
> >> Matthias
> >>
> >>> Am 24.05.2018 um 17:32 schrieb Mike Bonner via use-livecode <
> >> use-livecode@lists.runrev.com>:
> >>>
> >>> Has anyone had luck using an .htaccess to change the engine used with
> >>> onrev?  I'm hoping to override 7.0.1 (the default version it seems)
> with
> >> a
> >>> more recent version, but the information here:
> >>> http://lessons.livecode.com/m/4070/l/41105-how-do-i-choose-
> >> which-livecode-server-engine-to-use-with-on-rev
> >>> doesn't seem to work.  I even tried the older version used in the
> example
> >>> (4.6.3) and its not found.  If it works for others, i'm thinking there
> is
> >>> something munged in my account specifically.  If you DO have it
> working,
> >>> i'd appreciate an example so that I can duplicate it to test.
> >>>
> >>> Thanks!
> >>> ___
> >>> use-livecode mailing list
> >>> use-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
>
___
use-livecode mailing list
use-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: on-rev choosing engine

2018-05-24 Thread Mike Bonner via use-livecode
Thanks, I'll try this and see what I can figure out.  It seems though that
the server engines aren't there. (not found) type errors.  Using the info
from that lesson, there should be an engine at
/cgi-bin/livecode-server-4.6.3 for example.  (or any version based on the
same format, with the exception of the default (7.0.1) which is at
/cgi-bin/livecode-server according to the lesson, and the irev version is
in a different place too.  )

Then it goes on to give the example as in 4.6.3 which matches the
description of how things are named/placed.  But its not there.  When
running standard, no .htaccess, the livecode-server is located at

/usr/local/cpanel/cgi-sys/livecodeserver-7.1.0/livecode-server

So it appears that the lesson is wrong here too, and that the handler for
.lc files would point to /cgi-bin/livecodeserver-7.1.0/livecode-server
rather than as described.

I thought maybe things were the same, so tried with
/cgi-bin/livecodeserver-4.6.3/livecode-server but thats a no.  I also did a
shell call, when doing shell("ls
/usr/local/cpanel/cgi-sys/livecodeserver-7.1.0/  the files are there as
expected.   When doing the same for livecodeserver-6.4.3 the directory
doesn't exist. All this would be made easier if I had permission to ls
/usr/local/cpanel/cgi-sys/ to look at whats there, but thats not possible.

I'm guessing the scriptalias points to /usr/local/cpanel/cgi-sys/ so if
anyone has a clue how things are actually named for LC server versions
underneath that, that actually work, I'd appreciate the info. Otherwise,
I'll msg support and ask there.


On Thu, May 24, 2018 at 12:53 PM, Matthias Rebbe via use-livecode <
use-livecode@lists.runrev.com> wrote:

> You could try to use this method for .htaccess
>
> Options +ExecCGI
> Action custom-livecode /cgi-bin/livecode-server/livecode-server
> 
> SetHandler custom-livecode
> 
>
>
>
> Please note, that if you have several add-on domains and each domain uses
> its own root folder and you want to use the custom livecode server
> installation with each domain,  you have to put livecode server and
> .htaccess into each root folder.
>
>
> Regards,
> Matthias
>
> > Am 24.05.2018 um 17:32 schrieb Mike Bonner via use-livecode <
> use-livecode@lists.runrev.com>:
> >
> > Has anyone had luck using an .htaccess to change the engine used with
> > onrev?  I'm hoping to override 7.0.1 (the default version it seems) with
> a
> > more recent version, but the information here:
> > http://lessons.livecode.com/m/4070/l/41105-how-do-i-choose-
> which-livecode-server-engine-to-use-with-on-rev
> > doesn't seem to work.  I even tried the older version used in the example
> > (4.6.3) and its not found.  If it works for others, i'm thinking there is
> > something munged in my account specifically.  If you DO have it working,
> > i'd appreciate an example so that I can duplicate it to test.
> >
> > Thanks!
> > ___
> > use-livecode mailing list
> > use-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


on-rev choosing engine

2018-05-24 Thread Mike Bonner via use-livecode
Has anyone had luck using an .htaccess to change the engine used with
onrev?  I'm hoping to override 7.0.1 (the default version it seems) with a
more recent version, but the information here:
http://lessons.livecode.com/m/4070/l/41105-how-do-i-choose-which-livecode-server-engine-to-use-with-on-rev
doesn't seem to work.  I even tried the older version used in the example
(4.6.3) and its not found.  If it works for others, i'm thinking there is
something munged in my account specifically.  If you DO have it working,
i'd appreciate an example so that I can duplicate it to test.

Thanks!
___
use-livecode mailing list
use-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: Would Anyone Like a Ring Tone At End of Standalone Built?

2018-05-20 Thread Mike Bonner via use-livecode
Hey that's cool!  And it works well.

On Sun, May 20, 2018 at 1:22 PM, Matthias Rebbe via use-livecode <
use-livecode@lists.runrev.com> wrote:

> You could add a StandaloneSaved handler to your stack which is send to the
> mainstack when it was saved as a standalone.
> You could add the code for playing into that handler. Maybe easier than
> hacking the IDE?
>
> Regards,
> Matthias
>
>
>
> > Am 20.05.2018 um 05:29 schrieb Sannyasin Brahmanathaswami via
> use-livecode :
> >
> > with Android, it fast enough, but building to iOS … I have enough time
> to do email…
> >
> > I you use spaces.
> > You won't knon when the build is finished.
> >
> > Would any else like a ring tone when the SA is finished?
> >
> > I wonder if I could hack the IDE to do that..
> >
> > BR
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
> ___
> use-livecode mailing list
> use-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: PDF

2018-05-13 Thread Mike Bonner via use-livecode
I ended up using pdftotext, it worked like a charm. (Though I had to look
up how to send it a file list using find..  Too long away from the shell.)
I now have a little app that can do a word search for matching files and
show either the extracted text, or the original pdf using the browser
widget.

As far as being on the "make pdfs go away" bandwagon, yes I am.
Unfortunately, they're still used all over the place.  Insurance companies
autogenerate a huge amount of pdf reports, some of them built live through
horribly slow clunky awful (insert a bunch of other words here to describe
how NOT enjoyable it is to use their websites) that then eventually (after
going through huge amounts of different screens, get to the end result)
hand you a pdf./endInsuranceWebsiteVent

Reminds me of when I worked as phone support for a "large computer
manufacturer".. When there was a workflow issue, and slow call times due to
waiting on page loads for vantive.. The answer usually ended up being..
"Hey, its already slow so lets add 3 more required page loads that can take
forever to complete especially on busy days, thereby slowing things down
even more..."  /endPhoneSupportVent

I seem to be on a "KISAF" kick lately.  Keep It Simple And Fast

On Sun, May 13, 2018 at 8:30 AM, R.H. via use-livecode <
use-livecode@lists.runrev.com> wrote:

> To extract text from a PDF document, I am using a command line tool on
> Windows which is available also for Linux based systems called Xpdf.
>
> It was working well, using shell() on LiveCode Community 8x, but tested
> only in the IDE on Windows.
>
> It should work with Linux and Mac as well.
>
> If PDFs just contain images where the text is in the image, you need to
> first run it through character recognition program. Since I found that
> different tools generate different results when converting image characters
> in PDF to embedded text, I still find that Acrobat from Adobe is doing the
> best job.
>
> I needed this since some people had sent huge lists of numerical data in
> PDF which were impossible to extract, and the manual method could taken
> weeks. Also, it is helpful for building Document Management Systems where
> words within associated documents need to be indexed.
>
> Converting PDF to .docx formats (Word) usually does not give good results.
> The resulting documents are quite unclean. Extracting the text also does
> not necessarily result in a meaningful text if the original PDF is not
> structured with clearly separated paragraphs, headlines, etc. ideally in
> one top-to-bottom and left-to-right flow. So, a lot of manual work will
> often be required.
>
> Nevertheless, I can not see that PDF will lose ground as the standard for
> many years to come. There are possibly billions of documents in PDF around?
> What should replace it? And people are still printing.
>
> Xpdf can generate a pure text file that can be read from LiveCode and
> processed further.
>
> *Open Source Xpdf*
>
> http://www.xpdfreader.com/download.html
>
> https://en.wikipedia.org/wiki/Pdftotext
> Command line tools in Xpdf
>
> The open source Xpdf toolkit also includes several command line tools which
> perform various functions on PDF files:
>
>- *pdftotext*: converts PDF to text
>- *pdftops*: converts PDF to PostScript
>- *pdftoppm*: converts PDF pages to netpbm (PPM/PGM/PBM) image files
>- *pdftopng*: converts PDF pages to PNG image files
>- *pdftohtml*: converts PDF to HTML
>- *pdfinfo*: extracts PDF metadata
>- *pdfimages*: extracts raw images from PDF files
>- *pdffonts*: lists fonts used in PDF files
>- *pdfdetach*: extracts attached files from PDF files
>
> Cross-platform
>
> All of Xpdf tools are available for Linux, Windows, and Mac.
>
> The viewer (xpdf / XpdfReader) uses the Qt toolkit.
> Roland
> ___
> use-livecode mailing list
> use-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: PDF

2018-05-12 Thread Mike Bonner via use-livecode
Thanks Richard.  This helps cut my search down considerably.  I had already
set up an ubuntu vm on my unraid server, so I should be able to get
something going. Much appreciated.

On Sat, May 12, 2018 at 2:08 PM, Richard Gaskin via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Mike Bonner wrote:
>
> > I haven't needed to do this before, but is there a (relatively) easy
> > way to extract the text from a bunch of pdf files?  I'm hoping I can
> > build some indexes for the boatload of files I want to go through
> > (THough, I guess I could bipass LC and just grep my heart out)
> >
> > Any suggestions?
>
> Long term:
>
> Per Postel's Law, reduce the stockpile of PDFs littering humanity's
> infosphere by generating none except in the increasingly rare cases where
> no other format is a better choice.
>
> PDF is an archaic format held over from the days when nearly all display
> devices had screens at least as wide as a printed page.  Back in the '90s,
> when it was popularized, a fixed-size format emulating a printed piece of
> paper was not an unreasonable thing to do.
>
> But times have changed.  We rarely kill trees just to read anymore, so the
> bounds of a printed page are approaching meaninglessness.
>
> This becomes critically important for delivering an enjoyable reading
> experience when we consider that an ever-smaller minority of our time is
> spent on screens large enough to accommodate that size.
>
> Many of our screens are much smaller, and moreover they vary enough to
> make any single fixed size needlessly cumbersome.
>
> Attempting to read PDFs on a phone ranges from mildly annoying to
> prohibitively frustrating.
>
> That unnecessary pain is easily replaced these days with modern formats
> that reflow text to fit any of the many devices we might be using at any
> given moment.
>
> There's a good argument for using EPub as that foundation.
>
> But that's a long-term solution, and while I believe it's an inevitability
> as mobile use continues to grow it won't solve your need in the
> here-and-now., so:
>
>
> Short term:
>
> The Linux universe has many good command-line solutions available for
> extracting text from PDFs easily and efficiently, like this one:
> https://www.howtogeek.com/228531/how-to-convert-a-pdf-file-
> to-editable-text-using-the-command-line-in-linux/
>
> For those Win10 Pro users who can be convinced the tick a checkbox, the
> entire universe of the Ubuntu shell is now available.
>
> macOS also includes utilities for this, but I don't believe the same ones
> (at least not without installing an independent package manager like
> Homebrew.
>
> --
>  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


Re: PDF

2018-05-12 Thread Mike Bonner via use-livecode
That is pretty darn easy.  Sure makes me wish!

On Sat, May 12, 2018 at 1:36 PM, Paul Dupuis via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I hear you. Too bad though because with XPDF, the function to fetch all
> the text from a PDF is just:
>
> function pdfText pFile
>   local tUnicodePageText, tUnicodeDocumentText
>   create inv group "pdfViewer" in this card
>   XPDFViewer_Open "pdfViewer",the windowID of this stack
>   XPDFViewer_Set "pdfViewer","filename",pFile
>   put XPDFViewer_Get("pdfViewer","pageCount") into pageCount
>   repeat with pageNumber=1 to pageCount
> XPDFViewer_Unicode "pdfViewer",pageNumber,tUnicodeText
> put tUnicodeText after tUnicodeDocumentText
>   end repeat
>   XPDFViewer_Close "pdfViewer"
>   delete group "pdfViewer"
>   return textDecode(tUnicodeDocumentText,"UTF16")
> end pdfText
>
> Maybe LiveCode will have a sale some day in the future that will meet
> your price point.
>
> For other who may have a Business License or just interested in what you
> COULD do with XPDF, I am speaking about it at this Thursdays's LiveCode
> Global.
>
> On 5/12/2018 2:30 PM, Mike Bonner via use-livecode wrote:
> > Ty Paul.  Unfortunately, a business license is way outside my level of
> > affordability.  Looking into alternative methods to generate the index
> now,
> > though I'd still love to find an lc way to do it.
> >
> > On Sat, May 12, 2018 at 11:30 AM, Paul Dupuis via use-livecode <
> > use-livecode@lists.runrev.com> wrote:
> >
> >> If you have a Business License, you can use the XPDF external available
> >> with those editions for doing that.
> >>
> >> On 5/12/2018 12:58 PM, Mike Bonner via use-livecode wrote:
> >>> I haven't needed to do this before, but is there a (relatively) easy
> way
> >> to
> >>> extract the text from a bunch of pdf files?  I'm hoping I can build
> some
> >>> indexes for the boatload of files I want to go through.  (THough, I
> >> guess I
> >>> could bipass LC and just grep my heart out)
> >>>
> >>> Any suggestions?
> >>> ___
> >>> use-livecode mailing list
> >>> use-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
>
___
use-livecode mailing list
use-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: PDF

2018-05-12 Thread Mike Bonner via use-livecode
Ty Paul.  Unfortunately, a business license is way outside my level of
affordability.  Looking into alternative methods to generate the index now,
though I'd still love to find an lc way to do it.

On Sat, May 12, 2018 at 11:30 AM, Paul Dupuis via use-livecode <
use-livecode@lists.runrev.com> wrote:

> If you have a Business License, you can use the XPDF external available
> with those editions for doing that.
>
> On 5/12/2018 12:58 PM, Mike Bonner via use-livecode wrote:
> > I haven't needed to do this before, but is there a (relatively) easy way
> to
> > extract the text from a bunch of pdf files?  I'm hoping I can build some
> > indexes for the boatload of files I want to go through.  (THough, I
> guess I
> > could bipass LC and just grep my heart out)
> >
> > Any suggestions?
> > ___
> > use-livecode mailing list
> > use-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


PDF

2018-05-12 Thread Mike Bonner via use-livecode
I haven't needed to do this before, but is there a (relatively) easy way to
extract the text from a bunch of pdf files?  I'm hoping I can build some
indexes for the boatload of files I want to go through.  (THough, I guess I
could bipass LC and just grep my heart out)

Any suggestions?
___
use-livecode mailing list
use-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: Active window and mouse location

2018-05-10 Thread Mike Bonner via use-livecode
Oh, one other option for windows would be vbscript.   Unfortunately, I
don't think you can "do myScript as vbscript" because (according to the
dictionary) the required objects aren't available to livecode using that
method.  You can however, create a .vbs file with a script that should be
able to bring your app to the front.  Put the file somewhere accessible,
and use launch document to run it.  There are threads on this in the forum,
I'll re-locate them if you are interested in the idea.

On Thu, May 10, 2018 at 9:14 AM, Mike Bonner  wrote:

> Hmm Just a curiosity question to further the experiment if you don't
> mind..   I had been thinking you could use the "click" command to bring
> things to front, but if its not in front you can't do that.  So out of
> curiosity.. If you set it to a system window so that its in front of
> everything, and then use the click command (click at x,y) then
> un-systemwindow it, does it retain focus?  I'd test here, but for some
> reason it behaves differently for me.  (It sounds like your autohotkey
> answer is still the better option.)
>
> On Thu, May 10, 2018 at 8:13 AM, Douglas Ruisaard via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
>> More specifically, if I increase the "wait", the desired windows comes to
>> the foreground, the wait expires and then it "retreats" back behind the
>> other window(s) to its original placement.  Neat trick for a timed "pop-up"
>> window.  Without the "false" reset, the window remains as the foreground
>> window FOREVER... blocking any other windows or pop-up (e.g. "answer")
>> windows if they appear behind this foreground window.  THAT in turn means
>> that you have to kill the foreground window in order to proceed so
>> don't try this trick at home, kids!
>>
>> Nonetheless, an interesting command.. one which I will consider using in
>> another place and time.
>>
>> Thanks again,
>> Doug
>>
>> Douglas Ruisaard
>> Trilogy Software
>> (250) 573-3935
>>
>> > Hmm. Not sure whats up then.  doing the systemwindow trick pops things
>> to the front for me from behind
>> > a browser of whatever happens to be in front, so no clue why it won't
>> work for you.  (unless the
>> > window that it is behind is a system window itself)
>> >
>> > On Wed, May 9, 2018 at 3:34 PM, Douglas Ruisaard via use-livecode <
>> use-livecode@lists.runrev.com>
>> > wrote:
>> >
>> > > Thanks, Mike... but this doesn't make my LC screen active... it does
>> > > flicker it but leaves it in buried under the top window.
>> > >
>> > > I'll check out those links, Lagi... thanks for the research
>> > >
>> > > Thanks to Bob und Klaus for the "Launch" suggestion ... however, I
>> > > don't want to open, launch or startup anything, I just need the LC
>> > > window which is displaying the card processing to become the top-most
>> > > window ... so I'm not sure exactly what I would use as the "document"
>> in the launch command.
>> > > I will, however, keep this in mind for other purposes.
>> > >
>> > > As expected, a VERY simple, one-line script to AutoHotKey did the
>> trick...
>> > > which can be compiled into a standalone executable... and then
>> shell'd to.
>> > > Only thing is that it isn't cross-platform... windows only.  If I find
>> > > the time, I'll try Bob's suggestion for the Apple.
>> > >
>> > > Many Thanks!
>> > > Doug
>> > >
>> > >
>> > > Douglas Ruisaard
>> > > Trilogy Software
>> > > (250) 573-3935
>> > >
>> > > >
>> > > > While the solution is not perfect, you can have your script set the
>> > > > systemwindow of stack "stackname" to true wait 1 tick set the
>> > > > systemwindow of stack "stackname" to false
>> > > >
>> > > > (Saw this on the forums at one time or another, think the thanks go
>> > > > to
>> > > Lagi)
>> > > >
>> > > > The only negative of this method is the flicker as it goes system,
>> > > > then back again.
>> > > >
>> > > >
>> > > > --
>> > > >
>> > > >
>> > >
>>
>>
>> ___
>> use-livecode mailing list
>> use-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: Active window and mouse location

2018-05-10 Thread Mike Bonner via use-livecode
Hmm Just a curiosity question to further the experiment if you don't
mind..   I had been thinking you could use the "click" command to bring
things to front, but if its not in front you can't do that.  So out of
curiosity.. If you set it to a system window so that its in front of
everything, and then use the click command (click at x,y) then
un-systemwindow it, does it retain focus?  I'd test here, but for some
reason it behaves differently for me.  (It sounds like your autohotkey
answer is still the better option.)

On Thu, May 10, 2018 at 8:13 AM, Douglas Ruisaard via use-livecode <
use-livecode@lists.runrev.com> wrote:

> More specifically, if I increase the "wait", the desired windows comes to
> the foreground, the wait expires and then it "retreats" back behind the
> other window(s) to its original placement.  Neat trick for a timed "pop-up"
> window.  Without the "false" reset, the window remains as the foreground
> window FOREVER... blocking any other windows or pop-up (e.g. "answer")
> windows if they appear behind this foreground window.  THAT in turn means
> that you have to kill the foreground window in order to proceed so
> don't try this trick at home, kids!
>
> Nonetheless, an interesting command.. one which I will consider using in
> another place and time.
>
> Thanks again,
> Doug
>
> Douglas Ruisaard
> Trilogy Software
> (250) 573-3935
>
> > Hmm. Not sure whats up then.  doing the systemwindow trick pops things
> to the front for me from behind
> > a browser of whatever happens to be in front, so no clue why it won't
> work for you.  (unless the
> > window that it is behind is a system window itself)
> >
> > On Wed, May 9, 2018 at 3:34 PM, Douglas Ruisaard via use-livecode <
> use-livecode@lists.runrev.com>
> > wrote:
> >
> > > Thanks, Mike... but this doesn't make my LC screen active... it does
> > > flicker it but leaves it in buried under the top window.
> > >
> > > I'll check out those links, Lagi... thanks for the research
> > >
> > > Thanks to Bob und Klaus for the "Launch" suggestion ... however, I
> > > don't want to open, launch or startup anything, I just need the LC
> > > window which is displaying the card processing to become the top-most
> > > window ... so I'm not sure exactly what I would use as the "document"
> in the launch command.
> > > I will, however, keep this in mind for other purposes.
> > >
> > > As expected, a VERY simple, one-line script to AutoHotKey did the
> trick...
> > > which can be compiled into a standalone executable... and then shell'd
> to.
> > > Only thing is that it isn't cross-platform... windows only.  If I find
> > > the time, I'll try Bob's suggestion for the Apple.
> > >
> > > Many Thanks!
> > > Doug
> > >
> > >
> > > Douglas Ruisaard
> > > Trilogy Software
> > > (250) 573-3935
> > >
> > > >
> > > > While the solution is not perfect, you can have your script set the
> > > > systemwindow of stack "stackname" to true wait 1 tick set the
> > > > systemwindow of stack "stackname" to false
> > > >
> > > > (Saw this on the forums at one time or another, think the thanks go
> > > > to
> > > Lagi)
> > > >
> > > > The only negative of this method is the flicker as it goes system,
> > > > then back again.
> > > >
> > > >
> > > > --
> > > >
> > > >
> > >
>
>
> ___
> use-livecode mailing list
> use-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: Active window and mouse location

2018-05-09 Thread Mike Bonner via use-livecode
Hmm. Not sure whats up then.  doing the systemwindow trick pops things to
the front for me from behind a browser of whatever happens to be in front,
so no clue why it won't work for you.  (unless the window that it is behind
is a system window itself)

On Wed, May 9, 2018 at 3:34 PM, Douglas Ruisaard via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Thanks, Mike... but this doesn't make my LC screen active... it does
> flicker it but leaves it in buried under the top window.
>
> I'll check out those links, Lagi... thanks for the research
>
> Thanks to Bob und Klaus for the "Launch" suggestion ... however, I don't
> want to open, launch or startup anything, I just need the LC window which
> is displaying the card processing to become the top-most window ... so I'm
> not sure exactly what I would use as the "document" in the launch command.
> I will, however, keep this in mind for other purposes.
>
> As expected, a VERY simple, one-line script to AutoHotKey did the trick...
> which can be compiled into a standalone executable... and then shell'd to.
> Only thing is that it isn't cross-platform... windows only.  If I find the
> time, I'll try Bob's suggestion for the Apple.
>
> Many Thanks!
> Doug
>
>
> Douglas Ruisaard
> Trilogy Software
> (250) 573-3935
>
> >
> > While the solution is not perfect, you can have your script
> > set the systemwindow of stack "stackname" to true
> > wait 1 tick
> > set the systemwindow of stack "stackname" to false
> >
> > (Saw this on the forums at one time or another, think the thanks go to
> Lagi)
> >
> > The only negative of this method is the flicker as it goes system, then
> > back again.
> >
> >
> > --
> >
> >
>
>
> ___
> use-livecode mailing list
> use-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 turn off editor formatting

2018-05-09 Thread Mike Bonner via use-livecode
If there isn't an option to turn off autocomplete, my guess is you're using
a version that didn't give you the choice.  I'm using the most recent 9.
Turned off brackets and bracket hiliting, turned off the live error
checking and auto complete.   All I have on is control structure complete,
and auto formatting.  Thankfully this helps with the windows 10 slow down
issues enough to make things bearable.

On Wed, May 9, 2018 at 3:23 PM, Brian Milby via use-livecode <
use-livecode@lists.runrev.com> wrote:

> It is all under the Edit... Options menu of the SE.
> On Wed, May 9, 2018 at 4:07 PM Bob Sneidar via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
> > No work. First, there does not seem to be an option for turning off
> > auto-complete. Also, turning off auto-format seems to not effect anything
> > much.
> >
> > Bob S
> >
> >
> > > On May 9, 2018, at 12:23 , Mike Bonner via use-livecode <
> > use-livecode@lists.runrev.com> wrote:
> > >
> > > In the scripteditor window, click the edit menu, options, then
> > > enable/disable the things you wish.
> >
> >
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to turn off editor formatting

2018-05-09 Thread Mike Bonner via use-livecode
In the scripteditor window, click the edit menu, options, then
enable/disable the things you wish.

On Wed, May 9, 2018 at 1:08 PM, William Prothero via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Folks:
> I know there must be a way to turn off the part of the IDE editor
> auto-formatting that adds quotes and spare brackets to arrays, without
> turning off auto indent, which I like. I find myself deleting the extra
> quotes and brackets so often that I would turn it off if the autoformat
> checkbox in the preferences didn’t also turn off the auto indent, which I
> like.
>
> Is it possible to keep auto indent, but lose the rest of the autoformat
> stuff?
>
> I’m using LC 9
>
> Bill
>
> William A. Prothero
> http://earthlearningsolutions.org
>
> ___
> use-livecode mailing list
> use-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: imagedata and alpha byte

2018-05-09 Thread Mike Bonner via use-livecode
Already assuming that you know which pixel you wish to modify, (like if you
want to modify pixel 25 in pixel row 3, that would be pixel 75.. I
think..)  you would need to do something like the following..

--first, put the current alphadata into a variable.
put the alphadata of img "myImg" into tAlpha

-- then modify the alphadata for the pixel in question
put numtochar(0) into char 75  of tAlpha -- 0 is transparent, 255 is
completely opaque
-- change all necessary pixels here then
-- set the image to the new alphadata
set the alphadata of img "myImg" to tAlpha

On Wed, May 9, 2018 at 11:59 AM, jbv via use-livecode <
use-livecode@lists.runrev.com> wrote:

> On Wed, May 9, 2018 7:51 pm, Richmond Mathewson via use-livecode wrote:
> > The inevitable question has to be why you are doing that in such a
> > fiddly sort of way.
> >
> > Richmond.
> >
>
> It would be too long to explain, but in short some users of a client
> app will modify pixels of images that will then be exported as PNG to
> a server and then displayed in a website.
> I have successfully modified the alpha channel of images with php for
> years, and am just wondering why this doesn't work in LC...
>
>
> ___
> use-livecode mailing list
> use-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: Active window and mouse location

2018-05-09 Thread Mike Bonner via use-livecode
While the solution is not perfect, you can have your script
set the systemwindow of stack "stackname" to true
wait 1 tick
set the systemwindow of stack "stackname" to false

(Saw this on the forums at one time or another, think the thanks go to Lagi)

The only negative of this method is the flicker as it goes system, then
back again.

On Wed, May 9, 2018 at 9:32 AM, Douglas Ruisaard via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Thanks, as always, for the responses. Getting old means you forget about
> the differences between Commands and Functions... but anyway
> My MAIN question was whether there was a way to get LC to make a desktop
> window THE active, top-most window... next necessarily the LC's window (in
> my case) but ANY window for that matter.
>
> I'll be using a shell command out to an AUTOHOTKEY compiled script to
> switch to the desired desktop window but was wondering if there was a
> native LC way to do so.  BTW, anyone who hasn't heard or tried AutoHotKey,
> should do themselves a huge favor (favour in the British colonies) and
> explore its capabilities... which, I assure you, are myriad on Windows
> platforms.  There are similar tools I have NOT explored available on the
> Mac.
>
> However, before this thread evolves into a discussion about external
> scripting tools; please, if possible, let me know if anyone knows a LC-way
> to active a specific window on the desktop. ... ps... I am completely
> ignorant (and likely to remain so) regarding Java... so, if that is an
> option, I'd need a "seed" scripting suggestion as to how to start.
>
> Cheers!
> Doug
>
> Douglas Ruisaard
> Trilogy Software
> (250) 573-3935
>
> > In Windows 7, LC v8.1.9
> > Is there a way to make an LC "window" the active / top window on the
> desktop after making another
> > window on the desktop active?  I have an app which allows me to copy a
> portion of text from, say, a
> > Notepad window, into the clipboard.  A timed loop within my LC script
> then pulls the clipboard text
> > into an LC field and starts an analysis of the contents of that field.
> THAT works great.  But then I
> > need the LC window to become the active window after the analysis is
> done and displayed on my LC
> > window, so I can manipulate the various controls I have on it.
> >
> > Of course I can "manually" click on the LC window to activate it but I
> was wondering if there is a way
> > to do so in LC script.  I've tried "focus on field xxx" (where xxx is a
> field in my displayed LC
> > window), "set the screenMouseLoc to the loc of this stack", "go to this
> stack" and a variety of "click
> > at" commands... none of these make the LC window the top active window
> on the desktop.  The Notepad
> > (or whatever) window stays as the top, active window.
> >
> > On a somewhat related note, how do you "set" the mouse location within
> an LC window?  I know and use
> > the "set the screenMouseLoc to the loc of this stack" but an equivalent
> "set the MouseLoc to the loc
> > of this stack" or "set the mouseLoc to "650,420"" generates an error of
> "Properties: token is not a
> > property) near "mouseLoc", char 10" when trying to save the code.  Seems
> odd that I have to use FULL
> > screen coordinates to set the mouse location rather than relative ones
> to the stack.
> >
> > Douglas Ruisaard
> > Trilogy Software
> > (250) 573-3935
> >
> >  > The "screenMouseLoc" is a property, but the "mouseLoc" is a  >
> function.You cannot set a function.
> >  >
> >  > Why this was wrought this way is anybody's guess.
> >
> > If memory serves mouseLoc was implemented as a function for
> compatibility with HyperCard, which
> > offered no way to move the mouse cursor.
> >
> > When the opportunity came up to make a global version, it seems the
> choice to make that one a property
> > was simply because a property is more useful, allowing both getting and
> setting.
> >
> > --
> >   Richard Gaskin
> >   Fourth World Systems
> >   Software Design and Development for the Desktop, Mobile, and the Web
> >   
> >   ambassa...@fourthworld.comhttp://www.FourthWorld.com
> >
> >
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Sean?

2018-05-08 Thread Mike Bonner via use-livecode
Thank you Dan

On Tue, May 8, 2018 at 10:13 AM, Dan Brown via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I just received word from Sean's family, he is safe and is coping with last
> week's difficult events
>
> On Tue, 8 May 2018, 15:40 prothero--- via use-livecode, <
> use-livecode@lists.runrev.com> wrote:
>
> > Folks,
> >
> > I second what Lagi posted. A donation may not only provide needed funds,
> > but sends a message to Sean, and all on this list, that we are a
> community
> > that care not only about the product we are creating, but the folks who
> are
> > creating it. That message is sent, whether the donation is 5 or 100.
> >
> > Best,
> > Bill
> >
> > William Prothero
> > http://earthlearningsolutions.org
> >
> > > On May 8, 2018, at 5:35 AM, Lagi Pittas via use-livecode <
> > use-livecode@lists.runrev.com> wrote:
> > >
> > > Hi Mark,
> > >
> > > Gofundme are very credible and trustworthy.
> > >
> > > I contacted them and they said I can change who the beneficiary is - to
> > his
> > > spouse or other family member.
> > > So the correct people will get the money whatever the situation - God I
> > > hate having to think about the worst case.
> > >
> > > I thought the same when  I set it up but the what the heck (words to
> that
> > > effect) I lose £100 so what - my family will still be OK.
> > >
> > > Everybody, if you can  please give  what you can  afford now, not the
> > > minimum that will make you feel that you have done your bit. It will go
> > to
> > > the correct people - this isn't PayPal who holds money on a whim.
> > >
> > > Regards Lagi
> > >
> > >
> > >
> > >
> > >
> > > On 5 May 2018 at 01:18, Mark Wieder via use-livecode <
> > > use-livecode@lists.runrev.com> wrote:
> > >
> > >>> On 05/02/2018 11:14 AM, Lagi Pittas via use-livecode wrote:
> > >>>
> > >>> Hi All
> > >>>
> > >>> I have set it up - but I want to have the money go directly to Sean
> > >>>
> > >>> Ive just read that if I put seans email address in it will send him
> an
> > >>> invite so he will be the only one able to withdraw funds.
> > >>>
> > >>> I am waiting his acceptance but I think we can add to it without him
> > >>> accepting -I HAVE NO WAY OF WITHDRAWING MONEY FROM THIS ACCOUNT.
> > >>>
> > >>>
> > >>> https://www.gofundme.com/scemergency
> > >>>
> > >>
> > >> So... has anyone heard from Sean yet?
> > >> I'm reluctant to put money into a gofundme account that is
> nonrefundable
> > >> if nobody can access the funds. That seems like a bottomless pit.
> > >>
> > >> --
> > >> 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
> ___
> use-livecode mailing list
> use-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 Share

2018-05-02 Thread Mike Bonner via use-livecode
put the database into a property, then put it out when the stack opens.

On Wed, May 2, 2018 at 1:49 PM, Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi all and thanks for the response. I got the account set up, but the
> sample stack comes with an sqlite database, so I zipped it up, but I am
> unable to attach zipped files! I could work around it by converting the
> sqLite database to an array, then to a memory database, but this is fairly
> restrictive. Often I link images to icons, and I would be unable to include
> the folder with the image files.
>
> Bob S
>
>
>
> > On May 2, 2018, at 12:42 , Mark Wieder via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > On 05/02/2018 12:37 PM, Mike Bonner via use-livecode wrote:
> >> If you go to "sample stacks" from the livecode bar, on the upper right
> you
> >> can either log in or sign up. Sign up to create an account, at which
> point
> >> you should be good to go.
> >
> > Heh. Mike beat me to it.
> >
> > --
> > 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: Livecode Share

2018-05-02 Thread Mike Bonner via use-livecode
If you go to "sample stacks" from the livecode bar, on the upper right you
can either log in or sign up. Sign up to create an account, at which point
you should be good to go.

On Wed, May 2, 2018 at 1:25 PM, Paul Hibbert via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I’ve had this problem in the past and I’m sure I used the password reset
> to fix it (within the LC share option), but I’m away from my Mac until late
> tomorrow, so I can’t test right now. I’ll check as soon as I get home.
>
> Paul
>
> > On May 2, 2018, at 11:13 AM, Bob Sneidar via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Hi all.
> >
> > I'm trying to share a stack for the first time, but I'm having
> difficulty. I tried the Share This Stack... option in the File menu, but it
> takes me to a Login, and my Livecode Login doesn't seem to work for this.
> If I go right to livecodesh...@runrev.com, there is no place to create a
> login!
> >
> > Bob S
> >
> >
> > ___
> > use-livecode mailing list
> > use-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: Down a leafy lane or up queer street?

2018-04-29 Thread Mike Bonner via use-livecode
Did you declare it as a global on the card also?  You have to declare it
for every context that it will be used.  Stack, card, if you use it in a
button script, wherever.

If you've declared it in a card script, and set its value, but then use it
WITHOUT declaration all you get back is the text of the name (IE route66)

The reason you can see the value when checking it from the message box, is
that it is executing the commands as if they were in the context of the
stack script.

To test what I mean, create a script in a button with the following:

on mouseup

put "undeclared variable:" && tUndeclared -- shows tUndeclared in the
message box

local tDeclared

put cr & "Declared but un-set variable:" && tDeclared after msg -- no value
shown, tDeclared exists but is empty

put "value set" into tDeclared

put cr & "Declared and value set to: " & tDeclared after msg -- tdeclared
exists and now has a value

end mouseup

On Sun, Apr 29, 2018 at 12:15 PM, Richmond Mathewson via use-livecode <
use-livecode@lists.runrev.com> wrote:

> OK: finally I have sorted out the problem.
>
> It seems that IFF I have this in my cardScript:
>
> globalroute66
>
> onpreOpenCard
>
> putspecialFolderPath("resources") & "/assets/img/" intoroute66
>
> everything works.
>
> What I would like to know is:
>
> Why does THAT script & the declaration of a global NOT work when it
> resides in the stackScript?
>
> Richmond.
>
>
> On 29/4/2018 8:56 pm, Richmond Mathewson wrote:
>
>> So, I have corrected the specialFolderPath as per your instructions.
>>
>> But I am still going wrong as my source for the imgData of img "p1" is
>> still
>> listed asroute66p1.png . . .
>>
>> Richmond.
>>
>> On 29/4/2018 8:01 pm, J. Landman Gay via use-livecode wrote:
>>
>>> In the IDE, specialFolderPath("resources") points to the folder
>>> containing the working stack. In a standalone it points to the folder
>>> containing files you've included in the Copy Files pane of the standalone
>>> builder.
>>>
>>> Therefore, there will never be a folder specialFolderPath("resources") &
>>> "/Desktop/..." unless you have created a Desktop folder inside the one
>>> holding your stack. The correct path would be
>>> specialFolderPath("resources") & "/Obfuscated/May 2018/assets/img/"
>>>
>>> --
>>> Jacqueline Landman Gay | jac...@hyperactivesw.com
>>> HyperActive Software | http://www.hyperactivesw.com
>>> On April 29, 2018 11:27:39 AM Richmond Mathewson via use-livecode <
>>> use-livecode@lists.runrev.com> wrote:
>>>
>>> I am being extremely stupid, and am getting so desperate I don't mind
 admitting it.

 I have a stack containing a series of images that are 'empty' images
 with their
 sources set to an external folder.

 Now in my stackScript I have this:

 |global route66 on preOpenStack put specialFolderPath("resources") &
 "/Desktop/Obfuscated/May 2018/assets/img/" into route66 go to card
 "TITLE" end preOpenStack|

 and in my cardScript I have this:

 |on preOpenCard set the lockScreen to true  set the filename of
 img "p1" to empty --- set the filename of img "p1" to (route66 &
 "c1.png") set the blendlevel of img "p1" to 0  wait 3 ticks set
 the lockScreen to false end preOpenCard so, WHY cannot I see the target
 image, merely a horrible grey square? Richmond. |


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

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


Re: Q on Accessing multi-dimension arrays.

2018-04-26 Thread Mike Bonner via use-livecode
I had no clue you could do that!  Thank you!

On Thu, Apr 26, 2018 at 8:43 AM, Brian Milby via use-livecode <
use-livecode@lists.runrev.com> wrote:

> on mouseUp
>put "answer" into tA["firstkey"]["secondkey"]
>put "firstkey" into tPath[1]
>put "secondkey" into tPath[2]
>put tA[tPath]
> end mouseUp
>
> On Thu, Apr 26, 2018 at 9:16 AM, Alex Tweedly via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
> >
> > I have a (vague) memory that there is some way to do this ... but can't
> > remember and haven't had any luck searching for it 
> >
> >
> > I have a multi-dimension array, say created by
> >
> > put "answer" into tArray["firstkey"]["secondkey"]
> >
> > Is there some way or format to specify the array elements using the
> "path"
> > of the keys, rather than each one at its own level) ?
> >
> > i.e. something like (but obviously not exactly)
> >
> >   put tArray["firstkey,secondkey"]
> >
> > where each item/part of the key is interpreted s the next level in the
> > multi-dimension.
> >
> > Thanks
> >
> > Alex.
> >
> >
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> ___
> use-livecode mailing list
> use-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: Get only Pathname of a dragdropped Object

2018-04-22 Thread Mike Bonner via use-livecode
when you set the dragaction, it doesn't actually DO  the action.. All it
really does is a) set the prompt to the action you intend to do, and b)
send that info back to the source of the dragdrop. (not positive about that
second part)

So, if you have a button as the destination for your drag drop, in order to
allow the drop, you need a dragenter handler

on dragenter
   set the dragaction to copy
end dragenter

Then you need a dragdrop for the button also.

on dragdrop
 if the dragdata["files"] is not empty then
 -- this is where you do your processing
 -- dragdata["files"] contains a line delimited list
 -- of the files and folders dropped. (but not the files/folders
themselves)
 -- see a complete example below
 end if
end dragdrop



##
--Create a stack with a button and a field. Add the following script to the
button.

on dragenter
   set the dragaction to copy
end dragenter

on dragdrop
   if the dragdata["files"] is not empty then -- make sure there is
actually a file/folder dragdrop
  put the dragdata["files"] into tData -- put the file/folder list into
a temporary variable

-- Go through the list and determine whether each line
-- of the data is a folder or if it is a file
  repeat for each line tLine in tData
 if there is a folder tLine then put "Folder: " & tLine & cr after
tList
 if there is a file tLine then put "File: " & tLine & cr after tList
  end repeat
  delete the last char of tList
  sort lines of tList

-- put the list of dropped files and folders into the field
  put tList into field 1
  pass dragdrop
   end if
end dragdrop

On Sun, Apr 22, 2018 at 4:04 AM, Hillen Richard via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hello list,
>
> I´m looking for a solution to get the path to a Folder by dragdropping it
> into my (macOS)app without that the whole Folder is copied  in the
> drgdrop-process.
>
>
> Is there a solution?
>
>
> Thank you in advance,
> Richard..
>
>
>
> ___
> use-livecode mailing list
> use-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: Title Case

2018-04-21 Thread Mike Bonner via use-livecode
Not sure what you mean?
Also, definitely use one of the Andy versions to "case" your titles.  Much
more comprehensive solution.  The only edge case I can see would be
something like a title with a McGary type name, pretty much impossible to
account for without looking up every word in a names DB.


>
> not sure how the eye-candy will to take to
>
> This Is A Title
>
> This is an obscure UI case in which I can't get metadata from the data
> base, for a given audio that has been downloaded. So these "titles" come
> file names in the "My Audio"
>
> the-guru-chronicles-audiobook_10-Chapter-06.mp3
>
> becomes:
>
> The Guru Chronicles Audiobook, 10 Chapter 06
>
> in the UI… it already take times, adding a look up library will "kill" it.
>
>
___
use-livecode mailing list
use-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: Title Case

2018-04-20 Thread Mike Bonner via use-livecode
Something like this might work..

put "a create a sentence title" into tTitle
repeat with i = 1 to the number of truewords in tTitle
   put toupper(char 1 of trueword i of tTitle) into char 1 of trueword i of
tTitle
end repeat
put tTitle -- the adjusted case sentence

If you have words that you would rather not uppercase of course, you'll
have to check for those. (like of, the...) and whether or not the word is
the first.


On Fri, Apr 20, 2018 at 9:35 PM, Sannyasin Brahmanathaswami via
use-livecode  wrote:

> What to the simplest way to  "sentence case"
>
> a create a sentence title
>
> in use toUpper to convert to
>
> A Create A Sentence Title…
>
> BR
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-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 Column Labels

2018-04-18 Thread Mike Bonner via use-livecode
Should have been diffcompare(the script of tWorking, the script of tBroken,
1)
Typos galore.

On Wed, Apr 18, 2018 at 9:05 AM, Mike Bonner  wrote:

> I'm curious as to the differences..
> Bob, what do you get if you..
> put the behavior of group "workingdatagridname" into tWorking
> put the behavior of group "nonworkingdatagridname" into tBroken
> get dicompare(the script of tWorking,tBroken,1)
> put it
>
> On Wed, Apr 18, 2018 at 8:53 AM, Bob Sneidar via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
>> 1. Find a datagrid that does not exhibit the problem. In the message box
>> put:
>> put the behavior of group >
>> 2. Copy what's in the message
>>
>> 3. Go to the datagrid that is NOT working
>>
>> 4. In the message box type:
>> set the behavior of  to 
>>
>> Bob S
>>
>>
>> > On Apr 17, 2018, at 23:36 , Terence Heaford via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>> >
>> > I’ve had a look at various behaviours but rather then make a mess of
>> everything can you give a blow by blow of your actions please.
>> >
>> >
>> > Thanks
>> >
>> > Terry
>> >
>> >
>> >> On 17 Apr 2018, at 15:47, Bob Sneidar via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>> >>
>> >> As I mentioned, I get the behavior of a datagrid that IS working, then
>> set the behavior of the datagrid that ISN'T working to that behavior. I'm
>> not sure why but there seem to be more than one datagrid behavior object
>> floating around.
>> >>
>> >> Bob S
>>
>> ___
>> use-livecode mailing list
>> use-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 Column Labels

2018-04-18 Thread Mike Bonner via use-livecode
I'm curious as to the differences..
Bob, what do you get if you..
put the behavior of group "workingdatagridname" into tWorking
put the behavior of group "nonworkingdatagridname" into tBroken
get dicompare(the script of tWorking,tBroken,1)
put it

On Wed, Apr 18, 2018 at 8:53 AM, Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> 1. Find a datagrid that does not exhibit the problem. In the message box
> put:
> put the behavior of group 
> 2. Copy what's in the message
>
> 3. Go to the datagrid that is NOT working
>
> 4. In the message box type:
> set the behavior of  to 
>
> Bob S
>
>
> > On Apr 17, 2018, at 23:36 , Terence Heaford via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > I’ve had a look at various behaviours but rather then make a mess of
> everything can you give a blow by blow of your actions please.
> >
> >
> > Thanks
> >
> > Terry
> >
> >
> >> On 17 Apr 2018, at 15:47, Bob Sneidar via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >>
> >> As I mentioned, I get the behavior of a datagrid that IS working, then
> set the behavior of the datagrid that ISN'T working to that behavior. I'm
> not sure why but there seem to be more than one datagrid behavior object
> floating around.
> >>
> >> Bob S
>
> ___
> use-livecode mailing list
> use-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: Posting to LiveCode Server

2018-04-18 Thread Mike Bonner via use-livecode
Can you share the code to the page you're actually posting to?  Its
sounding like its not actually returning any output, causing a 500 internal
error.  Just to let you test, I set up a quick and dirty page at
http://guidezone.info/test.lc
The code in the page is as follows.

"
   end repeat
else
   put "Error: No data posted" -- gotta put somethingto avoid a 500 error
end if
?>

To test it, I used the following in a button.
put "Accept: text/plain" & CR after tHeaders
put "Content-Type: application/x-www-form-urlencoded" & CR after tHeaders
set the httpHeaders to tHeaders

put liburlformdata("name","Chi","gender","male","color","black") into
tPostData

put tPostData & cr --so that I can see the generated post string

post tPostData to "http://guidezone.info/test.lc;

put it && the result after msg


This works for me, though as I said, I don't have tsnet.  You're welcome to
do test runs against my url if you like. If it works for me as written, and
not for you, i'd be pointing my finger at tsnet.

On Wed, Apr 18, 2018 at 7:01 AM, Alex Tweedly via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Not quite sure what you're trying to do ... or why you use such a
> complicated URL in the client code.
>
> Changing it to simply
>
> *get URL "https://api01.triviamatic.tv/round_create.lc;
> *
>
> will work fine, as will
>
> *post*emptyto"https://api01.triviamatic.tv/round_create.lc;
>
>
> -- Alex.
>
>
>
> On 18/04/2018 11:50, Todd Fabacher via use-livecode wrote:
>
>> Any Help will be appreciated...
>>
>> Normally we use Node.js, but we are trying to get LiveCode server working.
>> We are doing a simple test:
>>
>> 
>>
>>
>> If I put the URL in a browser I get back, "It works"
>>
>> https://api01.triviamatic.tv/round_create.lc
>> > ound_create.lc=D=hangouts=1524117219848000
>> =AFQjCNFvW3yaTcJjQ9bGpWgi3CYh1mQwGA>
>>
>>
>> *put* "Accept: text/plain" & CR after tHeaders
>> *put* "Content-Type: application/x-www-form-urlencoded" & CR after
>> tHeaders
>> *set* the httpHeaders to tHeaders
>> *put*"fullname=chi=male=black" into tArgList
>> *post* tArgList to URL "https://api01.triviamatic.tv/round_create.lc
>> > ound_create.lc=D=hangouts=1524117219848000
>> =AFQjCNFvW3yaTcJjQ9bGpWgi3CYh1mQwGA>
>> "
>> *put* the result into tError
>> *put* it into tFormResults
>>
>>
>> The tError is:  tsneterr: (52) Empty reply from server
>>
>> and tFormResults is null
>>
>>
>> I need some help ASAP. This is SUPER frustrating!!
>>
>> --Todd Fabacher
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-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: name resolution stinker

2018-04-11 Thread Mike Bonner via use-livecode
Not sure if this will be userful, but would placing the following script in
your stack (or frontscript I guess) work easier?

command amIHere pName
try
   dispatch "imHere" to group pName of the current card
catch tError
   return false
end try
end amIHere

command imHere
   return true
end imHere

Might be cheating using try this way, but I think it should work pretty
well.

If the dispatch fails due to object (or in this case, background) not found
error, you get false, if the dispatch is handled you get true.

On Wed, Apr 11, 2018 at 10:23 AM, Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I used DO to evaluate the statement and of course that works, but any
> reference to group  fails
> to resolve.
>
> I worked around this anomaly (which I vaguely recall I've run into before)
> by using
> there is a group tDataGrid of tCurrentCard
>
> tDatagrid is the short name of the datagrid
> tCurrentCard is the long id of the card the datagrid is on
>
> Apparently you cannot reference an object using it's full id, but you can
> reference an object using it's short name and the long id of the parent! I
> find this odd, but oh well.
>
> Bob S
>
>
> > On Apr 11, 2018, at 09:08 , Bob Sneidar via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Ok here is a real stinker.
> >
> > put quote & tDataGrid & quote && "of" && tCurrentCard into tGridLongName
> > put (there is a group tGridLongName) into tGroupExists
> > if not tGroupExists then next repeat
> >
> > tGridLongName resolves to:
> > "dgsites" of card id 1002 of stack "Sites" of stack
> "/Users/bobsneidar/Documents/Livecode Projects/Forms Generator 8/Forms
> Generator 8.livecode"
> >
> > When in the message box I type:
> > put there is a group "dgsites" of card id 1002 of stack "Sites" of stack
> "/Users/bobsneidar/Documents/Livecode Projects/Forms Generator 8/Forms
> Generator 8.livecode"
> >
> > I get true.
> >
> > But the code:
> > put (there is a group tGridLongName) into tGroupExists
> >
> > returns false. tGridLongName is not resolving in this statement.
> >
> > Is this another use case for DO?
> >
> > Bob S
>
>
> ___
> use-livecode mailing list
> use-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 to Speech

2018-04-06 Thread Mike Bonner via use-livecode
Check the result and see if there is an error message.  What OS/Platform?
I use revspeak to talk to an amazon echo since it speaks more clearly than
I do. (Had it set up for a while so that I could have it talk to my echo
while I was in another room using a rev http stack.)  I'm on windows, but
think that last time I tried it on mac, it worked fine there as well.

On Fri, Apr 6, 2018 at 4:45 PM, William Prothero via use-livecode <
use-livecode@lists.runrev.com> wrote:

>
> Folks:
> I’m wondering if there is any text to speech capability in livecode. There
> are references to it when I do a Google search, but I don’t get any sound
> when I do:
>
>   on mouseUp
> revSpeak "Hello, How are you?"
> end mouseUp
>
> I don’t get any sound.
>
> I would want to use it for more than a simple alert. Is this practical?
>
> Best,
> Bill
>
> William A. Prothero
> http://earthlearningsolutions.org
>
> ___
> use-livecode mailing list
> use-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: Standalone Settings Frustration

2018-04-04 Thread Mike Bonner via use-livecode
Just a guess, but if it happens again, I'd look at "the filename of stack
 and if its not what you want, change it. ( I can think of
another few possible ways that it might be forced to change, but this would
probably be the easiest)

On Wed, Apr 4, 2018 at 6:22 PM, William Prothero via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Never mind:
> I fiddled enough so that the splash stack finally let go of the old name
> with the blank line.
> Bill
>
>
> > On Apr 4, 2018, at 5:19 PM, William Prothero via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Folks:
> > I am on livecode 9.0.0 app, Mac 10.13.3. I have a splash stack and
> several stacks that it loads.
> >
> > I have one stack I originally named “MAP Display”. I was having troubles
> making a standalone, as the file seemed to not be found. So, I figured
> maybe it doesn’t like blanks in the stack name. So, I changed the stack
> name in as many places as I could find, to “MAPDisplay”.  When I do: “put
> the short name of this stack”, I get “MAPDisplay”, no blanks. However, in
> the stackfiles of the splash app, the name with the blank in it keeps
> returning. Very frustrating. Somehow the splash stack is keeping and
> refusing to part with the name with the blank.
> >
> > This is the line containing the blank.
> > MAP Display,resources/datastacks/MAPDisplay.livecode
> >
> > I’ve done “set the stackfiles of stack mySplashStackName to “” and added
> back in the files. Yet, the name keeps reappearing with the blank.
> >
> > What the heck?
> >
> > Bill
> >
> >
> >
> > William A. Prothero
> > http://earthlearningsolutions.org
> >
> >
> > ___
> > use-livecode mailing list
> > use-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: memory databases fail in Windows

2018-04-03 Thread Mike Bonner via use-livecode
Yes please!

###I hear ya'.  I find myself tempted way more than I have time for to
write an xquery-like library for working with arrays.  We could sure use
one.###



On Tue, Apr 3, 2018 at 2:12 PM, Richard Gaskin via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Bob Sneidar wrote:
>
> >> On Apr 3, 2018, at 11:38 , Richard Gaskin wrote:
> >>
> >> What is the goal?
> >>
> >> Arrays and memory-based SQLite are both in-memory stores with hashed
> >> access.  I'm guessing there's something more to this use-case than my
> >> limited thinking currently grasps.
> >
> > You would be correct. :-)
> >
> > I posted a little while ago that I wrote some code to gather certain
> > properties of all the objects on a card into an array. Converting that
> > array into a memory database allows me to find all the objects that
> > are for example, visible and groups and then get the top, left, bottom
> > and right of each of these objects (because I passed those in a list
> > to the thing that generates the array).
> >
> > Essentially it's for finding things in an array. You might say I could
> > do the same thing by iterating through all the elements of an array,
> > but what if I wanted to do multiple queries? It's easier for me to
> > write SQL queries than it is to code repeat loops.
>
> I hear ya'.  I find myself tempted way more than I have time for to write
> an xquery-like library for working with arrays.  We could sure use one.
>
> --
>  Richard Gaskin
>  Fourth World Systems
>  Software Design and Development for the Desktop, Mobile, and the Web
>  
>  ambassa...@fourthworld.comhttp://www.FourthWorld.com
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


  1   2   3   4   >