Re: Flash Talks - 3 slots remaining

2022-04-05 Thread Alex Tweedly via use-livecode

Do you need to be in front of the running machine ?

Could you maybe video the machine going through its sequence - then 
record your voice-over later (either muting or turning down the machine 
audio, whichever is better) ?


(Or, to put it another way, I have no real idea :-) but I'm sure Heather 
can help you.


Alex.

On 05/04/2022 18:54, Craig Newman via use-livecode wrote:

How is that done? From my phone with a cameraman? The talk would only make 
sense with me in front of the running machine itself, making noise.

Craig


On Apr 5, 2022, at 1:41 PM, Andre Garzia via use-livecode 
 wrote:

I think this is very interesting. I’d love to watch a flash talk on it.

Sent from my iPhone


On 5 Apr 2022, at 18:38, Craig Newman via use-livecode 
 wrote:

Heather.

I probably am one of the oddest LC users. Entirely for either my own use or for 
my company. Only once did I sell a system commercially.

But I do use LC to control three very different machines in our shop. Would it 
be of any interest to anyone to see one of these in operation?

Regards,

Craig Newman  (dunbarx)




On Apr 5, 2022, at 12:54 PM, Heather Laine via use-livecode 
 wrote:

Dear Good Folks of the Use-list,

I'm in the final throes of scheduling our upcoming online conference on 25-27th 
April. Its looking great! Multiple fabulous talks have come in, there is loads 
of rich content, we have panels, keynotes and workshops galore! We're just 
missing 3 flashtalks to round out the Flash Talks section on Day 3. I know at 
least 3 of you good people can speak for a mere 7 minutes on your topic of 
choice. Roll up roll up... and send me a talk submission :) Pretty please?

https://livecode.com/global/apply-to-speak/ 


It's going to be a great event.

Warmest Regards to all,

Heather

P.S. Where is the conference schedule to be seen, I hear you ask? Right here:

https://livecode.com/global/schedule/

Heather Laine
Customer Services Manager and Conference Organizer Extraordinaire
LiveCode Ltd
www.livecode.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: Flash Talks - 3 slots remaining

2022-04-05 Thread Alex Tweedly via use-livecode

Sounds fascinating - I'd love to hear about that.

Alex.

On 05/04/2022 18:36, Craig Newman via use-livecode wrote:

Heather.

I probably am one of the oddest LC users. Entirely for either my own use or for 
my company. Only once did I sell a system commercially.

But I do use LC to control three very different machines in our shop. Would it 
be of any interest to anyone to see one of these in operation?

Regards,

Craig Newman  (dunbarx)




On Apr 5, 2022, at 12:54 PM, Heather Laine via use-livecode 
 wrote:

Dear Good Folks of the Use-list,

I'm in the final throes of scheduling our upcoming online conference on 25-27th 
April. Its looking great! Multiple fabulous talks have come in, there is loads 
of rich content, we have panels, keynotes and workshops galore! We're just 
missing 3 flashtalks to round out the Flash Talks section on Day 3. I know at 
least 3 of you good people can speak for a mere 7 minutes on your topic of 
choice. Roll up roll up... and send me a talk submission :) Pretty please?

https://livecode.com/global/apply-to-speak/ 


It's going to be a great event.

Warmest Regards to all,

Heather

P.S. Where is the conference schedule to be seen, I hear you ask? Right here:

https://livecode.com/global/schedule/

Heather Laine
Customer Services Manager and Conference Organizer Extraordinaire
LiveCode Ltd
www.livecode.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: CSV to TSV (was Re: Tools & techniques for one-off consolidation of multiple 'similar' CSV files?)

2022-04-05 Thread Alex Tweedly via use-livecode

Hi Keith,

that code will fail for any commas which occur within quoted entries - 
they will be wrongly converted to TABs


I'd suggest getting cvsToTab (a community effort by Richard Gaskin, me 
and a whole host of others over the years) as a good starting place, and 
perhaps finishing place. It will handle most CSV oddities (not all of 
them - that is provably impossible :-).


This does an efficient walk through the data, remembering whether it is 
inside or outside quoted entries, and hence handles commas accordingly.


https://github.com/macMikey/csvToText/blob/master/csvToTab.livecodescript

Alex.

On 05/04/2022 17:02, Keith Clarke via use-livecode wrote:

Hi folks,
Thanks all for the responses and ideas on consolidating multiple CSV files into 
- much appreciated.

Ben - Thank you for sharing your working recipe. This lifted my spirits as it 
showed I was on the right path (very nearly!) and you moved me on a big step 
from where I was stuck.

My script was successfully iterating through folders and files, with filtering 
to get a file list of just CSVs with their paths for onward processing. I’d 
also identified the need to maintain registers of (growing) column names, 
together with  a master row template and a mapping of the current file’s column 
headers in row-1 to the master to put align output columns. I got stuck when I 
set up nested repeat loops for files, then lines, then items and was trying to 
deal with row 1 column headers and data rows at the same time, which got rather 
confusing. Separating the column name processing from parsing row data made 
life a lot simpler and I’ve now got LC parsing the ~200 CSV files into a 
~60,000 row TSV file that opens in Excel.

However… I’m getting cells dropped into the wrong columns in the output file. 
So, I’m wondering if delimiters are broken in my CSV-to-TSV pre-processing. Can 
anyone spot any obvious errors or omissions in the following...
-- convert from CSV to TSV

replace tab with space in tFileData -- clear any tabs in the content before 
setting as a delimiter

replace quote & comma & quote with tab in tFileData -- change delimiter for 
quoted values

replace comma with tab in tFileData -- change delimiter for unquoted values

replace quote with "" in tFileData -- clear quotes in first & last items

set the itemDelimiter to tab

Best,
Keith

___

use-livecode mailing list
use-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: playrate & templateimage

2022-03-30 Thread Alex Tweedly via use-livecode



On 30/03/2022 22:18, Klaus major-k via use-livecode wrote:



At least on a Mac. Is this also the case on Windows?

could someone please test it and report here?
Thank you!

really noone has a minute to test? :-(


Oh, I have a minute. Unfortunately, I don't have a 'Windows".

Alex.

P.S. Actually, I think it's "fortunately I don't have a Windows" :-)


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


Re: Speed up a slow loop

2022-03-09 Thread Alex Tweedly via use-livecode

Hmmm - I have to correct myself :-)

It's not 110; there are 144 digraphs on a 5x5 board

 - nine centre tiles each have 8 neighbours

 - four corner tiles each have 3 neighbours

 - twelve remaining edge tiles each have 5 neighbours

giving 72 + 12 + 60 - so 144 pairs (already including both directions 
for each adjacency).


Now if you allow edge-to-edge wrapping (i.e. from the top right tile you 
can move to the right - and find yourself back on the top left, etc.) 
then there are simply 25 * 8 pairs - but then you've moved a long way 
from genuine Boggle rules :-)


Alex.

On 09/03/2022 23:09, Alex Tweedly via use-livecode wrote:
Yes, Quentin's allowing for diagonals (that's how the number of 
digraphs on a 5x5 board gets up to 110).


And it's probably a good idea, allowing an even finer filter - if you 
aren't doing the boardwalk method..


If you do use the boardwalk to generate the exact list of words, you 
get no benefit from single-letter or digraph filtering, because the 
tree-walk is constrained to only those valid "next char"s, and so 
implicitly avoids using those non-present digraphs.


Oh - so many different ways to do things, all interesting, and all 
good for some variation of the problem.



btw - that reminds me - back when I used to play real, physical Boggle 
with friends, we often played variants of the word rules; either


 - you can reuse the same tile later in a word (e.g.
Y  L  A
X  E  T

would allow "lately" as a word.

OR

- you can double-up on a tile (e.g. M I L would allow 'mill')
(more important if you're British than if you're American :-)

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: Speed up a slow loop

2022-03-09 Thread Alex Tweedly via use-livecode
Yes, Quentin's allowing for diagonals (that's how the number of digraphs 
on a 5x5 board gets up to 110).


And it's probably a good idea, allowing an even finer filter - if you 
aren't doing the boardwalk method..


If you do use the boardwalk to generate the exact list of words, you get 
no benefit from single-letter or digraph filtering, because the 
tree-walk is constrained to only those valid "next char"s, and so 
implicitly avoids using those non-present digraphs.


Oh - so many different ways to do things, all interesting, and all good 
for some variation of the problem.



btw - that reminds me - back when I used to play real, physical Boggle 
with friends, we often played variants of the word rules; either


 - you can reuse the same tile later in a word (e.g.
Y  L  A
X  E  T

would allow "lately" as a word.

OR

- you can double-up on a tile (e.g. M I L would allow 'mill')
(more important if you're British than if you're American :-)

Alex.



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


Re: Speed up a slow loop

2022-03-08 Thread Alex Tweedly via use-livecode


On 08/03/2022 07:27, Neville Smythe via use-livecode wrote:

I believe there were two problems: a) the original search search algorithm was 
too slow, and b) when implemented on certain devices the app went into an 
unusable state. Both problems were caused by the wordlist being stored being 
too large (275K words for a file size of  2.5 MB). The second issue we are 
pretty sure was Virtual Memory swap space thrashing.


I guess I'm not convinced about VM space thrashing being the problem, 
certainly not due to the wordlist. It's 2.5 Mb - i.e. 0.02% of the real 
RAM in a Pixel 5. There may be something else in the app making the 
total VM space very large - but the wordlist wouldn't do it on its own.




An alternative is to use an sqlite database, always an option which should be 
considered when handling large data. This completely removes the issue of 
having the wordlist in memory, and at the same time provides an extremely fast 
search engine, so was worth exploring as a solution to both problems.  Storing 
the words in a db single table with an index on initial letter and word length, 
or as lots of tables, one for each initial and length (!), both return a result 
for a search for a word in a small fraction of a millisecond, so definitely 
this would be a viable solution which would handle all letter distributions.
Sounds cool. I'd like to see an example of how this would be created and 
used (I'm very much a SQL novice).

There is however a downside: both methods produce a db file size of 7.1 MB for 
the SOWPODS wordlist, which rather bloats the app footprint, even when you 
discount the text file version of the wordlist which no longer needs to be 
stored.
You could do the opposite. Store the wordlist (700Kb compressed), and 
decompress/populate into the SQLite database on initial run.

But now, speaking of databases, I have a question. I have an update to my 
nsScriptDatabase stack which I want to upload to the Sample Stacks. Because it 
really should be compiled to a standalone, I really need to upload a pair of 
stacks, a launch stack and one to hold data which can one modified by the user. 
But it would seem a sample stack must be a single item. What to do?


Yep -this is a big drawback of the Sample Stacks system.

Maybe you could make a single app, which contains the two desired stacks 
as custom props.


(Sometimes it's easier to type code than to describe it :-)
In your preparation, you'd do:
 put URL ("binfile:launchstack.livecode") into tmp
 set the cLaunch of me to compress(tmp)
 put URL ("binfile:userdatastack.livecode") into tmp
 set the cUser of me to compress(tmp)

And then when the user downloads your sample stack, it does the inverse 
to create the two local stacks, with an info box telling them about it.


Alex.

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


Re: Speed up a slow loop

2022-03-07 Thread Alex Tweedly via use-livecode



On 06/03/2022 22:56, J. Landman Gay via use-livecode wrote:


The board walk took 179 ms for all 108 words because I ditched my old, 
juvenile, inefficient code and swiped yours. :) As Bill requested, 
I've marked all the stuff I used with credits for the people who 
suggested or provided code, so you're in there. The two most impactful 
changes were your board walk and Quentin's filtered dictionary idea, 
but there are also other improvements.


Oh, well, if you've got the fast boardwalk code in there anyway, that 
opens up another possibility (with one caveat).


The boardwalk will find all valid words on the board. So that list of 
words can be used as the "dictionary" for the user's guesses - and now 
you have a "dictionary" of only a few hundred words, rather than than 
the many thousands of either the original or the filtered dictionaries.


And it's worth saying that the fast boardwalk only explores those 
potential words that are on the board, so there's no need to filter the 
dictionary for it.


The caveat - a user guess which isn't in the word list found by the 
boardwalk can be either "not a word" or "a word, but not present on the 
board", and you don't know which. If your UI needs to distinguish 
between those cases, you'd need to do another step of checking these 
(hopefully very few) failure cases against the full dictionary.


Alex.


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


Re: Speed up a slow loop

2022-03-06 Thread Alex Tweedly via use-livecode
Another thought on this problem; I think worth discussing even if the 
various suggestions so far have already got you a solution. I think it's 
a general observation ...


You don't really care how long it takes to do this.
What you care about is how long the user has to wait for your (the 
app's) response.


So don't wait until the user has found all their possible words (i.e. 
the app is doing effectively nothing for the 30 seconds or so that the 
user gets for each board). Check each word as they type it, and store 
the result. Then, when the 30-sec timer is up, you will have only one or 
two last words to test - all the others have already been checked.


So you never care about how long it takes to check 50 or so words 
against the dictionary - you check 49 of them one-at-a-time during the 
time you are otherwise idle. And the user has only to wait for the 
negligible delay while you check one or two words.



Alex.


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


Re: Speed up a slow loop

2022-03-06 Thread Alex Tweedly via use-livecode


On 06/03/2022 06:35, J. Landman Gay via use-livecode wrote:


Combined with Ken's suggestion to use "difference", looking up a list 
of about 50 words in the filtered dictionary reduces the time from 2-4 
seconds to about 40 ms. It varies, depending on a lot of things, but 
it's fast enough that you don't notice. That's on my Pixel 5; on the 
Mac a lookup takes 5ms. And I can do it all in LC script.



5ms !?!

I did a (very simple) test  (see code below)

 - take the whole sowpods.txt file (267k words)

 - create a set (i.e. split by CR as set)

 - look up 50 randomly chosen words + 5 non-words (just in case failed 
searches were expensive).


Doing this 100 times takes 6-10 ms (on an old MacBook Pro).

Could you maybe post the code that you're using that takes 5ms ?


I love these little speed contests we have here. Thank you.


Alex.



on mouseup
   local tmp, tNumberOfLines, tNumberOfLoops
   local tWords, tAWords, tTries

   put the cWords of me into tWords
   if tWords is empty then
  put URL ("file:" & specialfolderpath("resources") & 
"/sowpods.txt") into tWords

  set the cwords of me to tWords
  put "From file"  into fld "F"
   else
  put "using custom property"  into fld "F"
   end if

   put tWords into tAWords
   split tAWords by CR as set

   repeat with I = 1 to 50
  put random(the number of lines in tWords) into tmp
  put line tmp of tWords  after tTries
   end repeat
   repeat with I = 1 to 5
  put "azazaz"  after tTries
   end repeat

   put 100 into tNumberofLoops

   local t1, t2, tCount, tTotal

   --   put the millisecs into t1
   --   repeat tNumberOfLoops times
   --  put 0 into tCount
   --  repeat for each line L in tTries
   -- if L is among the lines of tWords then add 1 to tCount
   --  end repeat
   --   end repeat
   --   put the millisecs into t2
   --   put tCOunt && "iterate lines" && t2-t1  after fld "F"

   put the millisecs into t1
   repeat tNumberOfLoops times
  put 0 into tCount
  put 0 into tTotal
  repeat for each line L in tTries
 add 1 to tTotal
 if tAWords[L] then add 1 to tCount
  end repeat
   end repeat
   put the millisecs into t2
   put tCount && "of" && tTotal && "each element" && t2-t1  after 
fld "F"



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: Chart widget and axes which are time values.

2022-02-25 Thread Alex Tweedly via use-livecode

Sorry Scott, I can't be of any help.

I hadn't tried anything like that before - and trying it in response to 
your email, I have no success at all; cannot get a transparent 
background. So maybe a mild confirmation that there's a problem, but 
nothing better than that.


Alex.


On 23/02/2022 02:23, scott--- via use-livecode wrote:

Alex, I’m replying off list because my ulterior motive is to ask you a question.

Argh.  I see, after re-reading your post, that my remarks are useless.

I’ve been spending a bit of time trying to replace my old chartsEngine library with the 
new chart widget. I haven’t tried any of the commands that wrap JSON. So, ultimately I 
have no answer to your question. I’ve used the more simplistic COMMA delimited [ set the 
csvData of widget "Chart" to tCSVData ].  (The TAB delimited one seems to work 
also.)

One thing that sometimes made a difference about what displayed was using: [ set the 
lockChartUpdates of widget "Chart" to “true” ] before messing with the widget and then [ 
set the lockChartUpdates of widget "Chart" to “false” ] when I was done.

I suspect that you have tried this already but...

Using [ put 
"cats"&"19"&"dogs"&"12"&&"gerbils"&"5"&&"wombats"&"9"
 into tCSVData ]  puts “cats, dogs, gerbils and wombats” along the X-axis for me.

I found that:  [ set the dataLabels of widget "Chart" to 
"Cats,Dogs,Gerbils,Wombats” ]  would also set the X-axis labels if it matched up with the 
number of data points.


My question for you, since you’ve been messing with the widget, is about 
setting the alpha / transparency of the chartBackgroundColor property. Only one 
time have I seen it work as expected from the property inspector and never have 
I been able to produce a transparent background by script. I was wondering if 
you had tried this property. (I posted about this in bugzilla and the 
mothership asked me to create a separate bug report because it worked fine for 
them… I don’t have a problem creating a bug report, it just seemed odd that it 
absolutely doesn’t work for me.)

--
Scott Morrow

Elementary Software
(Now with 20% less chalk dust!)
web   https://elementarysoftware.com/
email sc...@elementarysoftware.com
booth1-360-734-4701
mobile   1-360-920-0715
--





On Feb 22, 2022, at 5:54 AM, Alex Tweedly via use-livecode 
 wrote:

I've been trying to use the new chart widget, but no success yet.

All the charts I want to do have times (or dates) along the X axis.

I can see that any options which have not been wrapped in LC can be set by 
doing something like:

put the chartJSONOptions of widget "mine" into tA
put "time" into tA["scales"]["x"]["type"]
set the chartJSONOptions of widget "mine" to tA

but this still gives me

 Error: This method is not implemented:
 Check that a complete date adapter is provided.


and I have no idea how to provide a date adapter from LC.

Has anyone else tried date/times with more success ?

(The chart.js documentation implies there is a default adapter - so nothing 
should need to be done. It also talks about installing JS libraries for other 
adapters - but I don't quite get it).

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


Chart widget and axes which are time values.

2022-02-22 Thread Alex Tweedly via use-livecode

I've been trying to use the new chart widget, but no success yet.

All the charts I want to do have times (or dates) along the X axis.

I can see that any options which have not been wrapped in LC can be set 
by doing something like:


   put the chartJSONOptions of widget "mine" into tA
   put "time" into tA["scales"]["x"]["type"]
   set the chartJSONOptions of widget "mine" to tA

but this still gives me

    Error: This method is not implemented:
    Check that a complete date adapter is provided.


and I have no idea how to provide a date adapter from LC.

Has anyone else tried date/times with more success ?

(The chart.js documentation implies there is a default adapter - so 
nothing should need to be done. It also talks about installing JS 
libraries for other adapters - but I don't quite get it).


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


Re: Creating a simple menu

2022-01-08 Thread Alex Tweedly via use-livecode



On 08/01/2022 13:14, Alex Tweedly via use-livecode wrote:


I think you mean "[...] menu is not an option in the list of styles in 
the dictionary".


I meant to say "in the list of styles in the drop-down list, although it 
is in the dictionary"


Hope that wasn't confusing.

Apart from that, the answer remains  can be done in script or msg box.

Alex.


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


Re: Creating a simple menu

2022-01-08 Thread Alex Tweedly via use-livecode

caveat - I've never done any of this in real life :-)

On 08/01/2022 03:41, David Squance via use-livecode wrote:

Hi all,
I want to create a mock-up of a web site, so some menus are required. It’s 
something I’ve done very little with, and the last was years ago. I’m an 
infrequent  LC user, anyway, though have dabbled with it since it’s beginnings. 
According to the User Guide (this with version 10):

Button Menus

You can create a button menu by dragging out one of the menu controls from the tools 
palette. However,if you want to create one by script, the easiest is to create a button 
and set the style of the button to "menu". Next, you can set the menuMode of 
the button to the appropriate menu type. You can either set the menuMode in a handler, or 
use the Type menu in the button's property inspector to set the menu type.


However, if I create a button, menu is not an option in the list of styles.


I think you mean "[...] menu is not an option in the list of styles in 
the dictionary".


But in a script (I did it in the message box), you can do

set the style of button "bbb" to "menu"

and it does change the style, and subsequent 'put the style of btn 
"bbb"' does say 'menu', so I think it has worked.



And what do the “menu controls” in the tools palette look like?

Sorry, no idea.


I’m sure I’m missing something pretty basic, but I am definitely missing it. I 
guess I can copy and paste a menu button from an old stack, and change its 
attributes, or work around it with a bunch of hidden buttons, but there must be 
a more streamlined approach than that.


afaict, you can indeed do what you need in a script - set the style, 
etc. - and once you've done that, you then get different options in the 
Property Inspector.


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


ANN: BoggleSolver now on sample stacks

2022-01-02 Thread Alex Tweedly via use-livecode

I've put a little 'game' up on "sample stacks", and also on the web.

It "solves" Boggle style puzzles, i.e. you give it a 5x5 grid of 
letters, and it finds all words within it, following the prescribed 
rules - words are formed by moving to adjacent (including diagonal) grid 
positions, and you cannot re-use a grid position within a word. You can 
modify the input field, and click on "Solve it" to see the new results.


The list of words is that used by Jacqueline in her JQBoggle game.

The UI is very basic - but there is one clever (I think) thing within 
it. It uses a dictionary of words which is a hierarchical 
character-by-character array, so it represents not only "what is a word" 
but also "what can be the initial substring of a word", and therefore it 
can prune the search tree immediately. This takes the time to solve a 
puzzle down from approx 10 - 50 minutes using a simple dictionary, to 
around 40 millisecs.


NB I have also built a Web-based standalone version of it using 10.0.0 
(dp1), which can be found at


https://www.tweedly.org/BoggleSolver/BoggleSolver.html

Note - the "Load URL ..." portion does not yet work in the web version. 
Loading is fairly slow, but the run times re (IMHO) impressive - 80msecs 
against the 40msecs or so running in the IDE. I am very impressed by the 
performance of this early web implementation.


Having a 'solver' like this opens up possible new games such as:

1. given we have 25 grid positions, and 25 letters (omitting 'Q'), what 
arrangement of letters gives the most, or least, words.


2. given a random selection of letters, what arrangement gives 
most/least words.


3. (a 2-player game) given an arrangement of letters, change one letter 
and increase the number of words that can be formed; score the value of 
the increase (or decrease), playing alternately, until neither player 
can get a positive score change.


Alex.


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


Re: Sorting cards problem, and a link

2022-01-01 Thread Alex Tweedly via use-livecode

Not sure if I understand it properly, but 

cards 1 and 2 (i.e. the index and the current choice) do not have a 
field "title"


If I do a **sort card by field "title" ** then the cards come out 
unsorted (or improperly sorted, not sure).


I added a field "title" to each of the first 2 cards, then it seems to 
sort properly.


It's getting late, so I can't look at it more tonight - but I suspect 
the "sort cards" is crapping out somehow / somewhere when it hits a "No 
such object" error on the missing field of  a card.


I don't know if you can simply add an invisible, disabled field "title" 
on those extra cards (as I did for this simple test), or whether you 
need to set the "marked" for only the relevant cards ...


Alex.

On 01/01/2022 23:45, J. Landman Gay via use-livecode wrote:
Hi Alex, thanks so much for volunteering. There's a Dropbox transfer 
here:




The stack is huge, 8K+ cards. I told him he needs a database but he 
doesn't want to go there yet. In general it seems to work okay, at 
least for now. The stack was created 30 years ago in HC, he imported 
it to SuperCard, and now needs to move to LC. The original scripts 
were very minimal, I added a few more and cleaned up the visual 
appearance. I wrote an export script that he ran in SuperCard, and 
then imported the file to the new LC stack, creating cards along the way.


The HC and SC stacks sorted correctly. Only LC fails.

The first 13 cards always sort to the front of the stack which is 
where he wants them. They shouldn't, but they do, so okay. Go to one 
of the recipe cards and choose to sort by category.


 - The first 13 cards have no category so they don't move. Good.
 - The next cards, up to about 50, remain sorted by title
 - The following cards do sort by category, with each category 
alphabetical (good)


Sort by title seems to work okay. If you can't duplicate the above, 
sort by title first and then by category.


My question is, why don't "The Cheese Board" and "The Fruit Bowl" sort 
to the Ts when sorting by title? We don't want them to, but how come 
they don't? If you notice that Breakfast is out of order, it's because 
there's a space in front of the category name. He did that on purpose 
to keep it at the front.


I checked for spaces and other invisible characters in the title and 
category fields and didn't find any.


It's just weird. Thanks very much for taking a look, I'm at a loss.

Jacque



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


Re: Sorting cards

2022-01-01 Thread Alex Tweedly via use-livecode
I'd be happy to look - but my knowledge is entirely LC - never touched 
HC, so that may prevent me seeing something relevant.


Suggestions (that you may have tried already :-) :

1. loop through the cards: put the short ID of this card & TAB & field 
"title" ... after myVariable


then try sorting the items of myVariable.

That might tell you whether there's something odd in or about the 
fields, or whether it's card-specific.


2. Take advantage of the stable sort.
  For those cards that shouldn't move, add a specific custom property / 
value.

  Then, after sorting the way you want the cards, do an additional
 sort cards descending by myNewProperty
  to move those not-to-be-moved ones to the front, and leave all the 
others in their proper order.


Or, feel free to email the stack to me off-list and I'll poke at it.

Alex.

On 01/01/2022 20:10, J. Landman Gay via use-livecode wrote:
I'm still not having much luck with this. Everything works as expected 
except that the first 50 cards or so simply don't move. I can't find 
anything different about them that would explain it.


Anyone out there have an inclination to take a look and find what I'm 
missing? There's nothing confidential about the stack.



On 12/31/21 12:05 AM, J. Landman Gay via use-livecode wrote:
Thanks for all the ideas, guys. I seem to get the most consistent 
results if I sort by the short ID of each card and then follow that 
with the sort for category or title. Because the data was imported 
from a text file, the original order is the order of the card IDs.


What threw me originally is that some cards don't sort in the order I 
expect. A category that starts with B is sorted before a category 
that starts with A. I assume the categories retain their original 
order when they collect matching cards. A few cards with blank 
categories sort to the front (good) but when sorted by title they 
remain at the front even though the titles all start with "The". 
That's okay because they are summary cards that should be at the 
front, but I'm not sure why they stay there during an alphabetical 
title sort instead of moving to the Ts. I didn't find any leading 
spaces or invisible characters.







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


Re: Sorting cards

2021-12-30 Thread Alex Tweedly via use-livecode



On 30/12/2021 19:38, J. Landman Gay via use-livecode wrote:
Thanks for the reply. I understand how it works, my question is how to 
make it not work that way. :) Basically, I don't want the sub-sort.


The 'sub-sort' will only have any effect if there are cards with 
identical values for the "title" field; if teh titles are unique, then 
previous sorts will be totally irrelevant.


If there are duplicate values in the title field, then those cards will 
remain in the same relative orderas they were before that sort; if 
that's not desired, then you could do either of the versions you 
included below - either randomize or put back into original (ID) order 
first.




On the other hand, something may have gone wrong when sorting by the 
first field because the order didn't change at all -- it was like I 
never executed the command. I need to investigate that.



Yeah, it sounds like that's the problem.

[  ] Nope, except for once. I don't know why it worked only once. 
I'll poke around, but the question still stands for reference: how do 
we avoid the sub-sort? Maybe one of the two examples above is the way.



Short answer: you don't, you can't. :-)
When you "sort by field title" you are going to get stable order for 
those cards with identical titles. You can control the fine detail of 
that (obscure corner?) case by pre-sorting appropriately - either 
random, or short ID, or category, or 


Alex.


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


Re: Sorting cards

2021-12-30 Thread Alex Tweedly via use-livecode
You shouldn't need to ignore the previous sort. The second sort 
over-rides the first; it's only when looking at those cards which have 
the same value for the second field that the previous sorting applies.


So if we have

A2 B1 A1 C3

If we sort by char 2 of each, we would get    B1 A1 A2 C3 (nb - all with 
a 1, then all with a 2, ...)


and THEN sort by char 1 of each, we get   A1 A2 B1 C3 (all A then all B 
then all ..., )


If we have A2 B1 A1 C3 and sort by char 1 of each, we get A2 A1 B1 C3 
(all As before Bs, ...  and within the As they remain in the same order 
as they were).


Hmmm - not sure if that's clear or not.

Other way to think of it : a stable sort means that items which have 
matching keys remain in the same relative position.


Alex

(P.S. you're perhaps mixing up "first" and "second" - if want them 
"properly" sorted, you do the less important one (minor) first, then the 
major one. Hope that doesn't muddy it any more.)



On 30/12/2021 06:41, J. Landman Gay via use-livecode wrote:
I am converting an old stack to LC and it needs to sort cards by one 
of two fields. LC does stable sorts, so if I sort by field 1 it works, 
and then if I sort later by field 2 it retains the original sort and 
does a sub-sort. I don't want that. What's the best way to ignore the 
previous sort order?


I've tried a number of things with no luck.



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


Re: Infection Simulation

2021-12-29 Thread Alex Tweedly via use-livecode

That's really cool - thanks.

Improvements ?   How much time do you have :-)

1. Visual display of contagion zone while running.

2. Recovery. After being infected for some length of time, an individual 
stops being infectious; either it dies, and becomes a static black dot, 
or recovers and becomes a white dot again. Probably different times for 
each of those to happen.  And obviously a control for the likelihood of 
recovery vs death.


3.  Probabilistic infection. Rather than always infect another which 
comes within reach, make that a probability of infection.


4. Viral load. Make the probability as above follow a bell curve over 
time, as the individual becomes more infected, then recovers.


5. Simulate superspreader events. Maybe introduce short-term "gravity" 
that attracts individuals within a range together - and hence if one is 
already infected they infects lots of others.


And I could go on almost forever :-)
Thinking of features is orders of magnitude easier and quicker than 
implementing them :-)


Thanks again,

Alex.


On 29/12/2021 03:37, Roger Guay via use-livecode wrote:

I just uploaded a stack called “Infection" to Sample Stacks which might be a 
little fun (in a scary way) for some of you. It’s a Monte Carlo simulation wherein a 
number of individuals randomly moving about in an enclosed space, are infected by a 
single randomly infected individual. I welcome any feedback that might lead to more 
accuracy in or improvement to this model.

Cheers,
Roger
___
use-livecode mailing list
use-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 downloads VERY slow

2021-12-22 Thread Alex Tweedly via use-livecode

OK, memory lane time.

Before we had 1200 baud modems, we used to use acoustic couplers. I 
often used one to call from the main office (England) to our US office, 
at a mind-blowing 300 baud.


Problem was, in those days (1978 I think), even voice transatlantic 
calls were hit or miss. Often you got a undersea cable connection 
(slight delay and echo, but you could have an almost normal 
conversation), other times you got a satellite connection (usually 
little or no echo but very high latency, making conversation frustrating).


The acoustic coupler call would fail if you got the wrong kind of 
connection, so we'd usually wait until the middle for the night to make 
it more likely we'd get a successful call.


Ah fond memories of the days when I could stay up till 3am and still 
function the next day :-)


Alex.

On 23/12/2021 00:41, Martin Koob via use-livecode wrote:

I must be in the really ancient fogey range.

I remember 1200 baud modems.  In the late ’80s a teacher at our high school in 
Wawa, Ontario got his hands on one. It was the size of an air fryer. Our 
computer club at the school hooked it up to a Commodore PET 2001 and tried to 
connect to Compuserve.  Long waits listening to modem squeals but we never 
managed to get connected then.  We were in Wawa which is on the north shore of 
Lake Superior so maybe the phone connection was not good enough.
Here is the state of the art then, 
http://www.technofileonline.com/texts/2400modem88.html 


I also remember my Apple GeoPort modem with my Mac Quadra 660AV I think.  
https://apple.fandom.com/wiki/GeoPort 

 From the above article here are GeoPort speeds.
GeoPort Telecom Adapter M1694LL/B - 14.4 kilobaud 
 (kbps)
GeoPort Telecom Adapter (II) M2117LL/A - 28.8 kilobaud 
 (kbps)
GeoPort Telecom Adapter II M5438LL/A - 33.6 kilobaud 
 (kbps)

Martin



On Dec 22, 2021, at 4:02 PM, Ralph DiMola via use-livecode 
 wrote:

I just downloaded both the Mac and Win32 simultaneously via the download page 
in about a minute. Using “SpeedTest”, I get 110Mb/sec.

 I remember when got our first t1(1.544mb/sec) and thought we were styling 
ridiculous 

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net

-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of 
William Prothero via use-livecode
Sent: Wednesday, December 22, 2021 3:34 PM
To: JJS via use-livecode
Cc: William Prothero
Subject: Livecode downloads VERY slow

Folks:
When I download an update to Livecode, it takes hours. I’m wondering why. 
Locally, using “SpeedTest”, I get 160Mb/sec internet speeds. Could it be the 
livecode server that serves the updates? Just wondering.

Best,
Bill

William Prothero
waproth...@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


Re: [ANN] Release 9.6.6 RC-1

2021-12-21 Thread Alex Tweedly via use-livecode


On 21/12/2021 15:27, panagiotis m via use-livecode wrote:

Hello Mike,


When a runtime error occurs in a context where the script debugger

cannot run, the error dialog will be displayed rather than failing silently
Before LC 9.6.6 rc1, runtime errors in moveStack and resizeStack were
ignored, because for some reasons deep in the engine, if they were not
ignored, LC was freezing and eventually crashing. This behavior has now
changed, and these errors are caught in an error dialog window, rather
than failing silently.


Thank you, thank you, thank you.

This hits me all the time, when I mess up something in a resizeStack 
handler.


Of course, knowing that, I should test resizeStack handlers properly.  hmph.

Alex.


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


Re: How to get a hilitedElement value from a Tree View's arrayData?

2021-12-21 Thread Alex Tweedly via use-livecode

Hmmm - maybe I'm missing something, but 

Can't you use the feature of "using a numeric-indexed array as key" ?

(AFAIK it's an undocumented feature, except in the original release 
notes for 5.x, which are no longer on the downloads site, and which I 
can't find my copy of - so if anyone has them, could they re-post 
somewhere. This feature allows you to use a numeric-indexed array as a 
key, equivalent to presenting a set of keys:


put "a,b,c" into tA
split tA by comma
-- now we have tA[1]="a", tA[2]="b", tA[3]="c"
put "def" into tArray[tA]
-- now tArray["a"]["b"]["c"] = "def"

So, where Brian's code does


put the hilitedElement of the target into tElement
put 0 into tIndex
repeat for each item tItem in tElement
   add 1 to tIndex
   put tItem into tReference[tIndex]
end repeat
set the htmltext of field "ItemText" to tArray[tReference]


that should be equivalent to

put the hilitedElement of the target into tElement
split tElement by comma
set the htmltext of field "ItemText" to tArray[tElement]

Alex.

P.S. I also apologise for not looking at this earlier; I saw an earlier 
email and thought to myself "Hmmm. I bet that's a case for that weird 
array feature :-), and went looking for my copy of the release notes; 
when I failed to find them, I forgot to look further into it.




On 21/12/2021 15:19, Brian Milby via use-livecode wrote:


I saw this originally and meant to dig a bit.  Sorry for causing additional 
work for you.  Here is a widget script that does pretty much what you are doing 
but leverages a way of array access that isn’t obvious.

https://github.com/bwmilby/DocEditorPlus/blob/master/DocEditorPlus_Scripts/stack_DocEditorPlus_widget_id_1008.livecodescript

You should not need to use a case statement.  In my case the value was HTML in 
one case but plain text otherwise.

It is part of a more involved stack, but the card with this widget may be 
helpful for your purposes.

Thanks,
Brian

Sent from my iPhone


On Dec 21, 2021, at 6:38 AM, Keith Clarke via 
use-livecode  wrote:

Hi folks,
For future reference, below is how I managed to get this sorted. The solution 
seems rather ugly, but it works for the fixed depth of Tree View data I’m 
interested in.

The root cause seems to be down to the way LiveCode handles array keys passed in 
from variables. It doesn't seem possible to define a complete multidimensional 
array in as a text string (as one might build URLs with parameters). Rather, 
variables seem to be recognised and processed only if passed in for each individual 
array key, within its square brackets. Furthermore, the square brackets seem to 
need to be present in the markup of the array access call - hence the ugly switch 
statement with explicit cases for each level of Tree View depth rather than 
something more dynamic & generic...
on hiliteChanged

put the arrayData of control "Tree" into tTreeData

put the hilitedElement of control "Tree" into tHilitedElement

// Identify element depth

put the number of items in tHilitedElement into tDepth

put 0 into tLevelCount

repeat for each item tKey in tHilitedElement

add 1 to tLevelCount

put tKey into tLevel[tLevelCount]

put "[tLevel[" & tLevelCount & "]]" after tElement

end repeat

// Build array key to show element value in field

switch tDepth

case 1

put tTreeData[tLevel[1]] into field "Test"

break

case 2

put tTreeData[tLevel[1]][tLevel[2]] into field "Test"

break

case 3

put tTreeData[tLevel[1]][tLevel[2]][tLevel[3]] into field "Test"

break

end switch

end hiliteChanged

I’m sure the experienced developers here would find cleaner ways to achieve 
this but this hack works and I can get back to evaluating the data accessible 
from the PDF widget! :)

Best,
Keith


On 20 Dec 2021, at 21:13, Keith Clarke via 
use-livecode  wrote:

I’m using the Tree View widget to provide a quick and dirty read-only display 
of the various arrays of information that can be extracted from the PDF Widget.

Each PDF page contains too much text to read & understand within the constraints of 
a single line in a Tree View control. So, on highlighting an element in the Tree View, 
I want to display its value - such as arrayData[“Pages”][“1”][“text”] - into a field to 
read the detail extracted. (Currently I’m putting it into the message box as an interim 
step, as I tend to build & debug my scripts line by line and this is as far as I’ve 
got!)

I may have misread the docs but it seems that when a Tree View element is 
hilited, one doesn’t get immediate access to the element’s value. Instead, one 
has to jump through hoops, by handling the hilitedElement, which returns the 
nested keys of the element. So, I’m simply trying to convert this 
comma-separated list to an array reference, so that I can get the value 
associated with this key.

If I’ve missed a simple means to access the Tree View element’s value directly 
‘on click', I’ll gladly change course!
Best,
Keith


On 20 Dec 2021, at 20:46, J. Landman Gay via 
use-livecode  wrote:


Re: Smile for Christmas.

2021-12-16 Thread Alex Tweedly via use-livecode


On 16/12/2021 18:25, Rick Harrison via use-livecode wrote:

Combining two arrays is nice, but it really shouldn’t spell correct “color” to 
“colour”.


No, it doesn't Rick. It's just a typo in the example in the dictionary.

I mentioned it because it made me smile when I noticed it - a tiny 
example of our not-so-common language between the two sides of the ocean :-)


Alex.

The example in question :


*local*tLeft, tRight*
put*"green"intotLeft["color"]*
put*"left"intotLeft["align"]*
put*"blue"intotRight["color"]*
put*"100"intotRight["width"]

*union*tLeft withtRight

*# RESULT**
# tLeft["colour"] = "green"
# tLeft["align"] = "left"**
# tLeft["width"] = "100"*





On Dec 16, 2021, at 12:55 PM, Alex Tweedly via 
use-livecode  wrote:

Not only does it combine two arrays, but apparently it also spell-corrects "color" to 
"colour" !!

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


Smile for Christmas.

2021-12-16 Thread Alex Tweedly via use-livecode

I was just reading the dictionary entry for 'union'.

Not only does it combine two arrays, but apparently it also 
spell-corrects "color" to "colour" !!


Alex.


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


Re: open socket on start up and can't close

2021-12-15 Thread Alex Tweedly via use-livecode

Could it be remote debugging ?

Which version / license are you using ?

Alex.

On 15/12/2021 19:26, RobEppich via use-livecode wrote:

Downloaded and run Livecode 9.6.5, type “put the opensockets” and a socket is 
open, 65463. Close socket 65463 and put the opensockets again and result is 
65466.

Close the socket that is opened on startup always results in another socket 
being opened. This was not the case in 9.6.3 and previous versions. Can someone 
verify this?

Also have checked 10.0 dp 1 and same issue is there.

Thanks
Rob Eppich
___
use-livecode mailing list
use-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: Ghost in the Machine?

2021-12-12 Thread Alex Tweedly via use-livecode

Peter,

I think the piece of info we are all missing (or guessing wrongly about) is:

the existing club membership system - is it a web-based system, or an app that 
runs on your desktop.

We're all kind of assuming it's a web page, but I now suspect maybe it isn't.

If it is a web page - then the answers so far are all relevant, and should be 
straightforward to try out.

[My suggestion re. the browser widget still feels like the "right official" way 
to do it - but personally I'd look at the html and see if I could POST the correct info - 
i.e. what Richard said :-)  ]

If it's a custom app, then it's a very different question - and I currently 
have no idea. If so, please say a little bit more about the custom app, or put 
up a screenshot / video somewhere.

Alex.

On 12/12/2021 18:29, Peter Reid via use-livecode wrote:

Thanks Alex, Dan & Tom for responding to this, but I suspect that I didn't 
explain things well enough, let me elaborate…

1. Periodically we have small batches of new members joining a club. We have 
their details in a CSV file which we'd normally think of doing some kind of 
batch upload.

2. However, the existing club membership system doesn't have a batch load 
facility only an on-screen form (such as the following) to be typed in:

+-+
|  Surname:[.]   Firstname(s):[...]   Initials:[..] 
  |
|   
  | 
|   Address:[.]   Town:[.]   Phone: [.] 
  |
|   [.]   Postcode:[.]   Mobile:[.] 
  |
|   
  |
|   Email:[]   GiftAid:[x]   Payment:(o)Bank  ( )Chq
  |
+-+

3. We want a way to upload a group of new members by 'driving' the input 
fields, i.e. our app would click into each field, checkbox, radiobox and 'type' 
in the details.

4. We don't have access to the membership system's coding, it's one off the 
shelf. We just want do what we might have attempted some years ago, during the 
terminal/command line days! In those old days, we'd redirect the stdin, stdout, 
stderror.

So my query is really as follows:
a) is this kind of 'channel' redirection possible, can we send mouse clicks, 
type keys to enter text into fields etc?
b) has anyone done something like this?
c) does anyone have any methods and/or code they can let me have for this?

My overview of what's required is as follows (assuming no show-stoppers):
- I make an overlay map, transparent everywhere except where there are input fields – 
this could be an actual map with "X"s over entry fields, spaces elsewhere, but 
might simply be a list of objects expressed as coordinate rectangles
- we take the name of a field, 'Surname' say, and lookup its location on the 
screen
- we position our virtual mouse to click into the location where the equivalent 
field can be found
- we enter its value as virtual keystrokes and click the 'tab' key to move to 
the next input object

Any idea whether this is possible and any code examples?!

Thanks.

Peter
___
use-livecode mailing list
use-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: Ghost in the Machine?

2021-12-08 Thread Alex Tweedly via use-livecode

Hi Peter,

just checking if I have understood this right.

I think you have a website / webpage which allows the user to view / 
update a single entry (i.e. "manual on-line form with 20+ fields").


If that is the case, I'd consider writing an app to take in the file of 
rows of details, and insert that using a browser widget. See 
https://forums.livecode.com/viewtopic.php?t=33074 or other similar 
discussions.  (Not done it myself, but looks reasonably straightforward).


Alex.

On 08/12/2021 14:05, Peter Reid via use-livecode wrote:

I'm trying to provide an upload facility for an existing on-line club 
membership app. This app has a bulk loading facility for initial set up and is 
designed for whole database configuration. In addition the app provides a 
manual on-line form with 20+ fields making up a member's record.

Ideally my user would use a facility to upload 1 or more files with rows of 
details , each row containing a collection of all the inputs for my user to 
use. Sadly, there's no bulk loading facility, so the user has to type in most 
of the details from the membership form.

So here comes the 'Ghost' bit, is it possible to make an LC app that mimics 
keyboard and mouse inputs as if the user was there interacting with the on-line 
form? If I can do this my user would have a file of inputs which they could 
send to the membership database, sit back and watch the ghostly app 'type' and 
'mouse click' their way through completing the on-line form.

Any suggestions please?

Peter
--
Peter Reid
Loughborough, UK


___
use-livecode mailing list
use-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: Project browser docs

2021-12-06 Thread Alex Tweedly via use-livecode

Thanks Matthias - found it.

It looks like it's not for me - I use too much nesting of groups and 
can't handle a non-hierarchical view:-)


Alex.

On 06/12/2021 13:01, matthias rebbe via use-livecode wrote:

Before the Project Browser was introduced  Application Overview was the tool to 
get an overview of all loaded stacks, its substacks, cards and all objects on 
that cards.
You can now find it under Plugins->revApplicationOveriew.

Regards,
Matthias

Am 06.12.2021 um 13:49 schrieb Alex Tweedly via use-livecode 
:

On 06/12/2021 04:14, J. Landman Gay via use-livecode wrote:


I prefer the horizontal layout in the Application Overview, but i thought I'd 
give the PB another try now that I'm working on a simpler project. It's too 
unweildy for multi-stack projects with lots of controls.


Sorry, dumb question time - what is the "Application Overview" ?

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: Project browser docs

2021-12-06 Thread Alex Tweedly via use-livecode

On 06/12/2021 04:14, J. Landman Gay via use-livecode wrote:

I prefer the horizontal layout in the Application Overview, but i 
thought I'd give the PB another try now that I'm working on a simpler 
project. It's too unweildy for multi-stack projects with lots of 
controls.



Sorry, dumb question time - what is the "Application Overview" ?

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


Re: Control of Text Fields.

2021-11-10 Thread Alex Tweedly via use-livecode

"focusedObject" - wow, who knew ?  :-)

So it's been helpful for me.
(Some day I really will read the dictionary thoroughly).

Alex.

On 10/11/2021 03:38, Roger Guay via use-livecode wrote:

Alex and Richmond,

This discussion has been very helpful. Thank you! Please see my latest post on 
the forums where I offer my Formulator stack that seems to work, partly I think 
because I don’t lock the text of the multiple fields in my stack. Who woulda 
thunk?

https://forums.livecode.com/viewtopic.php?f=7=36444 
<https://forums.livecode.com/viewtopic.php?f=7=36444>

Cheers,

Roger



On Nov 7, 2021, at 5:51 PM, Alex Tweedly via use-livecode 
 wrote:


On 07/11/2021 11:36, Richmond via use-livecode wrote:

No hard feelings.

See what I have got up to over on the Forums, and

https://forums.livecode.com/viewtopic.php?f=7=36444

PLEASE, feel free to pull the thing to bits.


I don't want to "pull the thing to bits". Like you, I enjoy seeing "competing" 
multitude of ways to do things - I can learn from them all.

But I did have a quick look, so I'll just point out a small number of nitpicks.

1. the whole 'locktext' thing is weird, and causes various anomalies.
When I first open the stack, and click in the field, I can type digits and have 
them appear in the field, as you'd expect. But once I've clicked on an 
'arrow-emulator' the field becomes locked and one can no longer type in 
characters.  Clicking *outside* the field will then free it up again, so typing 
becomes possible.

2. disappearing iBeam.

If I position the ibeam in the middle of the text in the field, and use one of 
the arrow emulator buttons, the iBeam  moves properly - but then disappears 
(perhaps when the 'locktext' is set true).

3. incorrect entry position.

As in 2 above, although the ibeam was last seen in the correct place after using the 
">" button to move it to the right, if I then click on a digit button, that 
digit appears at the end of the field, not where it should have gone

4. Incorrect arrow key emulation (same problem as I mentioned in the previous 
email).

If you select a chunk of text in the field, then use the left-arrow emulator 
button, the ibeam is positioned before the *last* character of the selection, 
instead of before the first.


There were a couple of others, omitted for brevity. I've created a modified 
version your stack with my suggested handlers, and will attempt to upload it to 
the forum later.

Then there was another issue which I haven't tackled - it would mean changing 
lots of very similar tiny scripts, and is too tedious.

5. character input should replace any selection

Just like in a regular field, if there is an active selection, typing a 
character (or clicking a digit button, should *replace* it, not simply add the 
newly typed (or clicked) digit.


I've taken my earlier handler suggestion, and broken the bits of code out into 
individual button scripts, which removes the apparent complexity that you 
disliked earlier. As far as I know, no problems have yet been found with that 
approach. As one example, the code for left-arrow emulator would be


  on mouseUp
focus on field "fWORK"
put word 2 of the selectedchunk into tFirst
put word 4 of the selectedchunk into tLast
select before char (min(tFirst, tLast)) of fld "fWORK"
end mouseUp

I've uploaded this revised version on the forum thread.

Best wishes,  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: Clicking around . . .

2021-11-08 Thread Alex Tweedly via use-livecode

Hi Richmond,

I of course agree that shouldn't happen - but I've not been able to 
reproduce it.


I tried :

create new stack
create field
put text into it, then position insertion cursor within that text
 (ibeam is flashing)
use Property Inspector to set locktext to true
    (ibeam is no longer visible)

click outside the stack
    (no change - ibeam still invisible)
click back inside stack (but outside field)
    (no change - ibeam still invisible)
click inside field
    (no change - ibeam still invisible)

check in Property Inspector - locktext is still true.


Can you maybe try those steps - or say exactly what steps you did to see 
the problem in the first place.


(btw - MacOs 10.13.6, LC 9.6.4)

Alex.

On 08/11/2021 11:15, Richmond via use-livecode wrote:
Well . . . this is a sort of side-effect at my fooling around with 
calculators:


If I have a field on a card that has the lockText set to true and
I click outwith the stack that lockText is set to false . . .

I feel this should NOT happen:

Probably because if I click outside a LibreOffice document, a GIMP 
document or a TextEdit document


(the 3 apps I use most often apart from LiveCode)

that click does NOT affect those documents at all.

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: Control of Text Fields.

2021-11-07 Thread Alex Tweedly via use-livecode


On 07/11/2021 11:36, Richmond via use-livecode wrote:

No hard feelings.

See what I have got up to over on the Forums, and

https://forums.livecode.com/viewtopic.php?f=7=36444

PLEASE, feel free to pull the thing to bits.

I don't want to "pull the thing to bits". Like you, I enjoy seeing 
"competing" multitude of ways to do things - I can learn from them all.


But I did have a quick look, so I'll just point out a small number of 
nitpicks.


1. the whole 'locktext' thing is weird, and causes various anomalies.
When I first open the stack, and click in the field, I can type digits 
and have them appear in the field, as you'd expect. But once I've 
clicked on an 'arrow-emulator' the field becomes locked and one can no 
longer type in characters.  Clicking *outside* the field will then free 
it up again, so typing becomes possible.


2. disappearing iBeam.

If I position the ibeam in the middle of the text in the field, and use 
one of the arrow emulator buttons, the iBeam  moves properly - but then 
disappears (perhaps when the 'locktext' is set true).


3. incorrect entry position.

As in 2 above, although the ibeam was last seen in the correct place 
after using the ">" button to move it to the right, if I then click on a 
digit button, that digit appears at the end of the field, not where it 
should have gone


4. Incorrect arrow key emulation (same problem as I mentioned in the 
previous email).


If you select a chunk of text in the field, then use the left-arrow 
emulator button, the ibeam is positioned before the *last* character of 
the selection, instead of before the first.



There were a couple of others, omitted for brevity. I've created a 
modified version your stack with my suggested handlers, and will attempt 
to upload it to the forum later.


Then there was another issue which I haven't tackled - it would mean 
changing lots of very similar tiny scripts, and is too tedious.


5. character input should replace any selection

Just like in a regular field, if there is an active selection, typing a 
character (or clicking a digit button, should *replace* it, not simply 
add the newly typed (or clicked) digit.



I've taken my earlier handler suggestion, and broken the bits of code 
out into individual button scripts, which removes the apparent 
complexity that you disliked earlier. As far as I know, no problems have 
yet been found with that approach. As one example, the code for 
left-arrow emulator would be



 on mouseUp
   focus on field "fWORK"
   put word 2 of the selectedchunk into tFirst
   put word 4 of the selectedchunk into tLast
   select before char (min(tFirst, tLast)) of fld "fWORK"
end mouseUp

I've uploaded this revised version on the forum thread.

Best wishes,  Alex



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


Re: Control of Text Fields.

2021-11-07 Thread Alex Tweedly via use-livecode



On 07/11/2021 09:01, Richmond via use-livecode wrote:
I did not mean "competing" in the sense of "b*gger you", I meant it in 
the

sense of healthy competition.


Yeah, so did I.

And if it came across any other way, then I wholeheartedly apologise.

Sorry Richmond.

Alex.


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


Re: Control of Text Fields.

2021-11-06 Thread Alex Tweedly via use-livecode


On 06/11/2021 19:04, Richmond via use-livecode wrote:

My competing version is now "up":

https://forums.livecode.com/viewtopic.php?f=7=36444=210241#p210241

Richmond.


Don't you mean "my cooperating version ..."; surely the use-list is 
about helpful cooperatin and collaborative suggestions, not about 
competing :-)



But having said that:  your "left-arrow' emulation gets it wrong if 
there is a chunk selection active.


left-arrow should position the iBeam to the left of the selection, while 
this code positions it to the left of the rightmost character of the 
selection.


Alex.



On 5.11.21 23:08, Alex Tweedly via use-livecode wrote:


On 05/11/2021 20:18, Roger Guay via use-livecode wrote:
Alex, I did not see that and it is not in my mailbox. Would you 
please send it again?


Thanks,
Roger


Here it is again, below.

Or download the sample stack at 
https://tweedly.org/downloads/calcbuttons.livecode


 - not as pretty as Richmond's, doesn't even have all the digits ...)

Previously I said:

Here's an expanded snippet. The input is in a field called "fInput", 
the buttons are all in a group, and handled by the group script 
(saves having many tiny almost identical scripts).


The script  uses the name of the target - but since I would never, 
ever have a control named as a number, the digit buttons use their 
label instead.


If the user cannot select a chunk of text then some of this could be 
shortened.




on mouseup
   if the target = me then
  -- click in the background in the group
  exit mouseup
   end if
   local tChunk
   focus on fld "fInput"
   put the selectedchunk into tChunk
   if the label of the target is a number then
  put the label of the target into the selectedchunk
  exit mouseUp
   end if
   local tFirst, tLast
   put word 2 of tChunk into tFirst
   put word 4 of tChunk into tLast
   switch the short name of the target
  case "go left"
 select before char (min(tFirst, tLast)) of fld "fInput"
 break
  case  "go right"
 select after char (max(tFirst, tLast)) of fld "fInput"
 break
  case "Del"
 -- remove the selection, or the char *after* the ibeam
 if tFirst <= tLast then
    put empty into char tFirst to tLast of fld "fInput"
 else
    put empty into char (tFirst) of fld "fInput"
 end if
 break
  case "BS"
 -- remove the selection, or the char *before* the ibeam
 if tFirst <= tLast then
    put empty into char tFirst to tLast of fld "fInput"
 else
    put empty into char (tFirst-1) of fld "fInput"
 end if
 break
 -- all the other keys !!
  default
   end switch
end mouseup


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: Control of Text Fields.

2021-11-05 Thread Alex Tweedly via use-livecode


On 05/11/2021 20:18, Roger Guay via use-livecode wrote:

Alex, I did not see that and it is not in my mailbox. Would you please send it 
again?

Thanks,
Roger


Here it is again, below.

Or download the sample stack at 
https://tweedly.org/downloads/calcbuttons.livecode


 - not as pretty as Richmond's, doesn't even have all the digits ...)

Previously I said:

Here's an expanded snippet. The input is in a field called "fInput", the 
buttons are all in a group, and handled by the group script (saves 
having many tiny almost identical scripts).


The script  uses the name of the target - but since I would never, ever 
have a control named as a number, the digit buttons use their label 
instead.


If the user cannot select a chunk of text then some of this could be 
shortened.




on mouseup
   if the target = me then
  -- click in the background in the group
  exit mouseup
   end if
   local tChunk
   focus on fld "fInput"
   put the selectedchunk into tChunk
   if the label of the target is a number then
  put the label of the target into the selectedchunk
  exit mouseUp
   end if
   local tFirst, tLast
   put word 2 of tChunk into tFirst
   put word 4 of tChunk into tLast
   switch the short name of the target
  case "go left"
 select before char (min(tFirst, tLast)) of fld "fInput"
 break
  case  "go right"
 select after char (max(tFirst, tLast)) of fld "fInput"
 break
  case "Del"
 -- remove the selection, or the char *after* the ibeam
 if tFirst <= tLast then
    put empty into char tFirst to tLast of fld "fInput"
 else
    put empty into char (tFirst) of fld "fInput"
 end if
 break
  case "BS"
 -- remove the selection, or the char *before* the ibeam
 if tFirst <= tLast then
    put empty into char tFirst to tLast of fld "fInput"
 else
    put empty into char (tFirst-1) of fld "fInput"
 end if
 break
 -- all the other keys !!
  default
   end switch
end mouseup


Alex.

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


Re: Control of Text Fields.

2021-11-05 Thread Alex Tweedly via use-livecode
Hi Roger. Don't know if you've seen the script I posted around 6 hour 
ago ("expanded snippet").


It does the correct forward / backward key movements, and also 
implements both "backspace" (delete the char to the left of the iBeam) 
and "delete" (remove the char to the right of the ibeam) as well as 
properly handling the case where there is a text selection rather than 
just an ibeam (i.e. both delete the selection, but not any characters 
outside that selection).


Alex..


On 05/11/2021 18:37, Roger Guay via use-livecode wrote:

Very good, Richmond. It’s impressive how quickly you piss around! And, it’s 
close but no cigar . The arrow keys on the keyboard move the ibeam in a field 
w/o highlighting any text. And, the Delete key deletes the char in front of the 
iBeam. I thought this would be easy to duplicate in LC, but maybe not??.

Why do I want to emulate these keys? Well at this point, It has become a 
challenge and I like challenges. BTW, the calculator that I am inspired to 
replicate is found in Mac Good Grapher which is bundled with the Mac. The Good 
Grapher Calculator has back and forward buttons and a Delete button that 
operate exactly as the keyboard ones

Thanks for playing with this,

Roger


On Nov 5, 2021, at 10:15 AM, Richmond via use-livecode 
 wrote:

Pissed around a bit:

https://forums.livecode.com/viewtopic.php?f=7=36444

Love, Richmond.

On 5.11.21 15:59, Roger Guay via use-livecode wrote:

I want them to do exactly the same thing that the keyboard keys do!! IOW, I 
want to emulate the delete key and the back and forward keys.

Roger


On Nov 5, 2021, at 12:33 AM, Richmond Mathewson via use-livecode 
 wrote:

Surely the script depends on what you want those buttons to do.

On Fri, 5 Nov 2021 03:41 Roger Guay via use-livecode, <
use-livecode@lists.runrev.com> wrote:


Thanks, Alex. Sorry I didn’t make myself clear. I’m building a calculator
stack with forward and back arrow buttons and a Delete button. What's the
script for these buttons?

Roger


On Nov 4, 2021, at 5:53 PM, Alex Tweedly via use-livecode <

use-livecode@lists.runrev.com> wrote:

Hi Roger,

I'm not sure I properly understand your question.

here's a code snippet the moves the insertion point (in this sample,

typing an 'f' moves it forward, 'b' moves it back). (Note this also works
if there is some text selected - it moves the insertion to just after the
selection, just like the arrow key does).

on keydown p
   local t
   switch p
  case  "f"
 put word 4 of the selectedchunk into t
 select after char (t+1) of me
 break
  case "b"
 put word 2 of the selectedchunk into t
 select before char (t-1) of me
 break
   end  switch
end keydown

To then delete the char in front of it, you'd do something like

   put empty into char (t+1) of me

Hope that's close enough to what you were asking, or at least gives you

a starting place  :-),

Alex.

On 04/11/2021 20:49, Roger Guay via use-livecode wrote:

I simply want to be able to move the insertion iBeam in a focused field

left and right, one char at a time (just like the left and right arrows
keys), and then to delete the char in front of it (just like the Delete
key). The dictionary was again of no use to me. Can someone please provide
sample scripts?

Thanks,
Roger
___
use-livecode mailing list
use-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


___
use-livecode mailing list
use-livecode@lists.runrev.com
P

Re: Control of Text Fields.

2021-11-05 Thread Alex Tweedly via use-livecode

OK, so I was close, but didn't get the cigar.

Here's an expanded snippet. The input is in a field called "fInput", the 
buttons are all in a group, and handled by the group script (saves 
having many tiny almost identical scripts).


The script  uses the name of the target - but since I would never, ever 
have a control named as a number, the digit buttons use their label instead.


If the user cannot select a chunk of text then some of this could be 
shortened.




on mouseup
   if the target = me then
  -- click in the background in the group
  exit mouseup
   end if
   local tChunk
   focus on fld "fInput"
   put the selectedchunk into tChunk
   if the label of the target is a number then
  put the label of the target into the selectedchunk
  exit mouseUp
   end if
   local tFirst, tLast
   put word 2 of tChunk into tFirst
   put word 4 of tChunk into tLast
   switch the short name of the target
  case "go left"
 select before char (min(tFirst, tLast)) of fld "fInput"
 break
  case  "go right"
 select after char (max(tFirst, tLast)) of fld "fInput"
 break
  case "Del"
 -- remove the selection, or the char *after* the ibeam
 if tFirst <= tLast then
    put empty into char tFirst to tLast of fld "fInput"
 else
    put empty into char (tFirst) of fld "fInput"
 end if
 break
  case "BS"
 -- remove the selection, or the char *before* the ibeam
 if tFirst <= tLast then
    put empty into char tFirst to tLast of fld "fInput"
 else
    put empty into char (tFirst-1) of fld "fInput"
 end if
 break
 -- all the other keys !!
  default
   end switch
end mouseup


Alex.


On 05/11/2021 01:39, Roger Guay via use-livecode wrote:

Thanks, Alex. Sorry I didn’t make myself clear. I’m building a calculator stack 
with forward and back arrow buttons and a Delete button. What's the script for 
these buttons?

Roger


On Nov 4, 2021, at 5:53 PM, Alex Tweedly via use-livecode 
 wrote:

Hi Roger,

I'm not sure I properly understand your question.

here's a code snippet the moves the insertion point (in this sample, typing an 
'f' moves it forward, 'b' moves it back). (Note this also works if there is 
some text selected - it moves the insertion to just after the selection, just 
like the arrow key does).


on keydown p
local t
switch p
   case  "f"
  put word 4 of the selectedchunk into t
  select after char (t+1) of me
  break
   case "b"
  put word 2 of the selectedchunk into t
  select before char (t-1) of me
  break
end  switch
end keydown

To then delete the char in front of it, you'd do something like

put empty into char (t+1) of me

Hope that's close enough to what you were asking, or at least gives you a 
starting place  :-),

Alex.

On 04/11/2021 20:49, Roger Guay via use-livecode wrote:

I simply want to be able to move the insertion iBeam in a focused field left 
and right, one char at a time (just like the left and right arrows keys), and 
then to delete the char in front of it (just like the Delete key). The 
dictionary was again of no use to me. Can someone please provide sample scripts?

Thanks,
Roger
___
use-livecode mailing list
use-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: Control of Text Fields.

2021-11-04 Thread Alex Tweedly via use-livecode

Hi Roger,

I'm not sure I properly understand your question.

here's a code snippet the moves the insertion point (in this sample, 
typing an 'f' moves it forward, 'b' moves it back). (Note this also 
works if there is some text selected - it moves the insertion to just 
after the selection, just like the arrow key does).



on keydown p
   local t
   switch p
  case  "f"
 put word 4 of the selectedchunk into t
 select after char (t+1) of me
 break
  case "b"
 put word 2 of the selectedchunk into t
 select before char (t-1) of me
 break
   end  switch
end keydown

To then delete the char in front of it, you'd do something like

   put empty into char (t+1) of me

Hope that's close enough to what you were asking, or at least gives you 
a starting place  :-),


Alex.

On 04/11/2021 20:49, Roger Guay via use-livecode wrote:

I simply want to be able to move the insertion iBeam in a focused field left 
and right, one char at a time (just like the left and right arrows keys), and 
then to delete the char in front of it (just like the Delete key). The 
dictionary was again of no use to me. Can someone please provide sample scripts?

Thanks,
Roger
___
use-livecode mailing list
use-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: Number of items

2021-10-25 Thread Alex Tweedly via use-livecode

One. The three dots are an ellipsis, not a period :-) :-)

On 25/10/2021 20:32, J. Landman Gay via use-livecode wrote:

On 10/25/21 1:00 PM, Alex Tweedly via use-livecode wrote:


On 25/10/2021 17:43, J. Landman Gay via use-livecode wrote:
Delimiters signify the end of a unit, like a period at the end of a 
sentence. The delimiter basically "belongs" to the string preceeding 
it.



So I wonder how many sentences this reply might contain ...


Three. :P

Technically speaking, of course.



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


Re: Number of items

2021-10-25 Thread Alex Tweedly via use-livecode



On 25/10/2021 17:43, J. Landman Gay via use-livecode wrote:
Delimiters signify the end of a unit, like a period at the end of a 
sentence. The delimiter basically "belongs" to the string preceeding it.



So I wonder how many sentences this reply might contain ...

:-)

Alex.


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


Re: Sample stacks / revOnline [was: Re: Suggestion: Non-Appbuilding Community Edition]

2021-09-30 Thread Alex Tweedly via use-livecode
They're only used for uploading or editing stacks that you want to 
share. (Oh, now that I think about it, maybe also to rate a stack from 
someone else).


I thought about just removing those buttons from the plugin (IMHO, the 
upload/edit functions are fine as they are), but then I thought someone 
might spend time trying to find how to do those actions; better, I 
think, to have an obvious button which immediately tells you that the 
plugin doesn't support it.


The main reason for not including that functionality was that I felt it 
was just a bit "off" to have a plugin ask for your username/password; I 
was glad to find that there doesn't seem to much need to do that part.


Alex.

On 30/09/2021 18:50, Roger Guay via use-livecode wrote:

This is really nice and fast, Alex. Thanks again for doing this as I’ve always felt that LC’s 
Sample Stacks is a great and often overlooked resource save for it’s interface. I note that 
"Log In" and "Sign Up" do not work. Is there any value in those items?

Roger


On Sep 30, 2021, at 10:05 AM, Alex Tweedly via use-livecode 
 wrote:

Hmmm ... not sure why.

Easy way : https://www.tweedly.org/Downloads/samplestacks.livecode

Or: start the IDE, and  in the toolbar (4th or so from the right) is "Sample 
Stacks".

Then

  - select "View as: List"

  - select "All" on left hand side

  - select "Sort by: Date"

  - then reverse order the sort - and it's the most recent one !!


Or - select "Plugin" in the tags column (5th one down), then type "sample" in the search 
box and hit "Go"

Alex.


On 30/09/2021 16:17, Roger Guay via use-livecode wrote:

This sounds absolutely wonderful, Alex, except I can’t find it as you described.

Roger


On Sep 30, 2021, at 7:27 AM, Alex Tweedly via use-livecode 
 wrote:


On 30/09/2021 15:02, Alex Tweedly via use-livecode wrote:

On 06/09/2021 15:14, Kevin Miller via use-livecode wrote:


Upgrading this could be a very useful project. There is a lot of content in 
there but it has the issues you list.

So I had a look at what could be done just within the IDE for revonline. There's an old joke about 
a tourist in Ireland who realizes she(*) is lost, and ask for directions from an old farmer at the 
side of the road. "Well", says he, "if I wanted to go there, I wouldn't start from 
here."

I found the revonline scripts rather complex, and I couldn't easily see how to 
solve the issues mentioned previously, in that context. And the bottom line is 
that it's not a complex problem that needs to be solved. The login / register / 
upload features all work just fine - the problems are with the searching / 
browsing / filtering, and are generally related to either (very) poor 
performance or unclear UI.

In the end, I just couldn't produce worthwhile improvements, so instead I wrote 
a plugin that handles the searching / filtering / browsing / downloading parts, 
and which omits the login/upload parts entirely.

It can be downloaded from "Sample Stacks" in the IDE toolbar (it's called "Sample 
Stacks" and is tagged as IDE and Plugin). Install as a plugin in the usual way.

UI is very similar to the existing IDE version - simplified a bit.

  - search box automatically (and immediately) updates as you type, so the "Go" 
button was removed

- everything happens in < 1 second, so the progress bar was removed.

  - the grid/list choice was removed (the old 'list' stye was hard to use or 
understand)

  -  tags in the left-hand box are alphabetized

  - the grid is a single long scrolling group, rather than being paged and 
scrolled

There is one issue I haven;t tracked down yet - sometimes the scrolling using mousepad 
doesn't work initially; scrolling with the scrollbar seems to be enough to 
"revive" it.

Let me know if you try it and have any problems or suggestions.

Thanks

Alex.




(*) "she" is not sexist - had it been a man he would never have admitted to 
being lost and so would never have asked the question :-)



___
use-livecode mailing list
use-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
u

Re: Sample stacks / revOnline [was: Re: Suggestion: Non-Appbuilding Community Edition]

2021-09-30 Thread Alex Tweedly via use-livecode

Hmmm ... not sure why.

Easy way : https://www.tweedly.org/Downloads/samplestacks.livecode

Or: start the IDE, and  in the toolbar (4th or so from the right) is 
"Sample Stacks".


Then

 - select "View as: List"

 - select "All" on left hand side

 - select "Sort by: Date"

 - then reverse order the sort - and it's the most recent one !!


Or - select "Plugin" in the tags column (5th one down), then type 
"sample" in the search box and hit "Go"


Alex.


On 30/09/2021 16:17, Roger Guay via use-livecode wrote:

This sounds absolutely wonderful, Alex, except I can’t find it as you described.

Roger


On Sep 30, 2021, at 7:27 AM, Alex Tweedly via use-livecode 
 wrote:


On 30/09/2021 15:02, Alex Tweedly via use-livecode wrote:

On 06/09/2021 15:14, Kevin Miller via use-livecode wrote:


Upgrading this could be a very useful project. There is a lot of content in 
there but it has the issues you list.

So I had a look at what could be done just within the IDE for revonline. There's an old joke about 
a tourist in Ireland who realizes she(*) is lost, and ask for directions from an old farmer at the 
side of the road. "Well", says he, "if I wanted to go there, I wouldn't start from 
here."

I found the revonline scripts rather complex, and I couldn't easily see how to 
solve the issues mentioned previously, in that context. And the bottom line is 
that it's not a complex problem that needs to be solved. The login / register / 
upload features all work just fine - the problems are with the searching / 
browsing / filtering, and are generally related to either (very) poor 
performance or unclear UI.

In the end, I just couldn't produce worthwhile improvements, so instead I wrote 
a plugin that handles the searching / filtering / browsing / downloading parts, 
and which omits the login/upload parts entirely.

It can be downloaded from "Sample Stacks" in the IDE toolbar (it's called "Sample 
Stacks" and is tagged as IDE and Plugin). Install as a plugin in the usual way.

UI is very similar to the existing IDE version - simplified a bit.

  - search box automatically (and immediately) updates as you type, so the "Go" 
button was removed

- everything happens in < 1 second, so the progress bar was removed.

  - the grid/list choice was removed (the old 'list' stye was hard to use or 
understand)

  -  tags in the left-hand box are alphabetized

  - the grid is a single long scrolling group, rather than being paged and 
scrolled

There is one issue I haven;t tracked down yet - sometimes the scrolling using mousepad 
doesn't work initially; scrolling with the scrollbar seems to be enough to 
"revive" it.

Let me know if you try it and have any problems or suggestions.

Thanks

Alex.




(*) "she" is not sexist - had it been a man he would never have admitted to 
being lost and so would never have asked the question :-)



___
use-livecode mailing list
use-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: Sample stacks / revOnline [was: Re: Suggestion: Non-Appbuilding Community Edition]

2021-09-30 Thread Alex Tweedly via use-livecode


On 30/09/2021 15:02, Alex Tweedly via use-livecode wrote:

On 06/09/2021 15:14, Kevin Miller via use-livecode wrote:

Upgrading this could be a very useful project. There is a lot of 
content in there but it has the issues you list.


So I had a look at what could be done just within the IDE for revonline. 
There's an old joke about a tourist in Ireland who realizes she(*) is 
lost, and ask for directions from an old farmer at the side of the road. 
"Well", says he, "if I wanted to go there, I wouldn't start from here."


I found the revonline scripts rather complex, and I couldn't easily see 
how to solve the issues mentioned previously, in that context. And the 
bottom line is that it's not a complex problem that needs to be solved. 
The login / register / upload features all work just fine - the problems 
are with the searching / browsing / filtering, and are generally related 
to either (very) poor performance or unclear UI.


In the end, I just couldn't produce worthwhile improvements, so instead 
I wrote a plugin that handles the searching / filtering / browsing / 
downloading parts, and which omits the login/upload parts entirely.


It can be downloaded from "Sample Stacks" in the IDE toolbar (it's 
called "Sample Stacks" and is tagged as IDE and Plugin). Install as a 
plugin in the usual way.


UI is very similar to the existing IDE version - simplified a bit.

 - search box automatically (and immediately) updates as you type, so 
the "Go" button was removed


- everything happens in < 1 second, so the progress bar was removed.

 - the grid/list choice was removed (the old 'list' stye was hard to 
use or understand)


 -  tags in the left-hand box are alphabetized

 - the grid is a single long scrolling group, rather than being paged 
and scrolled


There is one issue I haven;t tracked down yet - sometimes the scrolling 
using mousepad doesn't work initially; scrolling with the scrollbar 
seems to be enough to "revive" it.


Let me know if you try it and have any problems or suggestions.

Thanks

Alex.




(*) "she" is not sexist - had it been a man he would never have admitted 
to being lost and so would never have asked the question :-)




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


Re: Sample stacks / revOnline [was: Re: Suggestion: Non-Appbuilding Community Edition]

2021-09-30 Thread Alex Tweedly via use-livecode

On 06/09/2021 15:14, Kevin Miller via use-livecode wrote:


Upgrading this could be a very useful project. There is a lot of content in 
there but it has the issues you list.

Kind regards,

Kevin


Some of these issues can easily be tackled as a community effort / 
project - but it's not clear to me how the more serious ones could be 
done without project leadership (or at least strong involvement) from LC 
Ltd. The ability to store things other than traditional stacks (e.g. 
widgets, script-only stacks, documentation pages, e-books, ...) and how 
that could be handled (or tested) on LC servers means they would need 
LCLtd to be heavily involved.


And the other half of that project (i.e. providing infrastructure 
support for library/LCS stacks) in the IDE/engine is certainly outside 
the scope of a community project. For me, this includes things like


 - standard place to keep stacks/libraries  (e.g., maybe, My 
Livecode/Libraries ?)


 - preference to change that in IDE, perhaps specialFolderPath("libraries")

 - naming scheme or convention (cf what was done for widgets)

 - a "require" or "include" mechanism for dependencies in libraries

 - integration into the dictionary (cf widgets again)

 - ability to add e.g. custom controls to the toolbar (cf widgets).

and no doubt many others that I haven't even thought of.

Without those, I think we will continue to struggle with a limited set 
of community-provided libraries and tools, compared to the rich 
ecosystem this *incredibly helpful* community should be able to provide.


But, getting my head own out of the clouds, I've had a look at this as a 
community project - see separate email.


For anyone who got this far - thanks for your patience :-),

Alex.



Kevin Miller ~ ke...@livecode.com ~ http://www.livecode.com/
LiveCode: Develop Yourself

On 06/09/2021, 14:11, "use-livecode on behalf of Alex Tweedly via use-livecode" 
 wrote:

 In the main thread, I mentioned that I found revOnline (aka "Sample
 Stacks"), but didn't say how or why. Here the answer to that ...

 It has:

 - no differentiation between 'libraries' and 'examples'

 - it has no support for script-only stacks, which is surely the way most
 libraries will be done nowadays.

 - a left hand scrolling box with ~90 'categories', in no particular
 order, no grouping

 - grid vs list view - list shows you a list, which is basically the same
 as a 1-wide grid rather than 2-wide, plus a larger view of some random
 other item (OK, it's not random - it simply doesn't update when it should)

 - updates when you click on the picture - but gives no cursor hint that
 you can do that

 - a drop-down list for sort order - which isn't sized adequately when
 you first open revonline

 - a 'search' box which must search something, but I don't know what.
 There is a sample stack called "Compare stack scripts", and which is
 tagged as "compare" - but isn't found if you search for "compare".

 - and I usually find things via "browser + google" (or similar) and the
 stuff in samples stacks isn't visible that way.

 H - maybe I've just found my next project :-)

 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: LiveCode 10 - what are your thoughts on the new features?

2021-09-08 Thread Alex Tweedly via use-livecode

On 2021-09-08 01:33, Alex Tweedly via use-livecode wrote:


But
 put [1, 2, 3 ] into tVar2
isn't clear to me. If it was in Python it would be a list - but LC
doesn't have 'lists'.

Is it equivalent to
   put true into tVar2[1]
   put true into tVar2[2]
   put true into tVar2[3]    ??



and then On 08/09/2021 08:50, Mark Waddingham via use-livecode wrote:

Yes.


But I'm not sure he meant it :-)

He went on to say

A sequence in LC is a numerically-keyed array where the keys range 
from 1...the number of elements.


Admittedly they are (currently) still implemented as a 'normal' array 
internally, but they do have different functionality in `repeat for 
each element` which iterates in numeric order, and not hash order.


This example gives a sequence - but only, basically, by coincidence. A 
better example would be


   put [4, 5, 7] into tV

Using the 'expansion' I used before - that would be equivalent to
   put true into tV[4]
   put true into tV[5]
   put true into tV[7]

not a sequence - and wouldn't preserve ordering in subsequent "repeat 
for each element".


I think that

   put [4, 5, 7] into tV

is actually equivalent to
   put 4 into tV[1]
   put 5 into tV[2]
   put 7 into tV[3]

But I'm happy to wait and try it out in the DP.

Alex.



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


Re: LiveCode 10 - what are your thoughts on the new features?

2021-09-08 Thread Alex Tweedly via use-livecode


On 08/09/2021 22:43, Mark Waddingham via use-livecode wrote:

However, if applied to something which is continuous (and perhaps more 
importantly something humans are not that great at accurately estimating - eg 
time) it rarely means two exactly...

After all when was the last time you said to someone - ‘I’ll just be a couple 
of minutes’ and were, indeed, exactly 120 seconds? ;)

If I say that, I'm more likely to actually be 120 minutes than 120 
seconds :-)


Alex.


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


Re: LiveCode 10 - what are your thoughts on the new features?

2021-09-07 Thread Alex Tweedly via use-livecode


On 07/09/2021 23:01, Martin Koob via use-livecode wrote:

Hi all.

There has been lots of discussion on the list and forums about the one part of 
Kevin’s announcement regarding the changes in licensing but nothing that I see 
on the other major part of the announcement — the new features coming in 
LiveCode 10.
Good idea for discussion - but we may be shooting in the dark, until 
either the DP or another sneak peek.

New Syntax in 10
Array Literals


Not sure I fully understand this one yet.
    put { "a": "b", "c":"d" } into tVar
seems clear - and is explained with an equivalent in existing code.

But
 put [1, 2, 3 ] into tVar2
isn't clear to me. If it was in Python it would be a list - but LC 
doesn't have 'lists'.


Is it equivalent to
   put true into tVar2[1]
   put true into tVar2[2]
   put true into tVar2[3]    ??

Or if not, then what is it equivalent to ?

But generally, I like the idea. Though it does just make me want to ask 
for more :-)


Why just constants ?

Why can't I say
    put { myvar: "first", anothervar: tWhatever } into tVar2   ?


Constant Expressions


About time. I trust you can actually do
   constant Kmin=100, kMax=200, kMid=(kmin+kmax)/2


Static Switch Optimization


Yes - good thing.I have a bunch of code (which I might not want to show 
in public), where this will make a significant difference. I was worried 
by the statement that "... recognises cases where all the cases are 
constant", but realised that you can always cover the other cases by 
putting them into a separate switch/if-then-else in the 'default' case.




Constant folding


I confess I assumed that was already there :-)

But I was disappointed to not see my two biggest 'constant' wishes

1. multi-line constants e.g. amongst other ways, Python's

put """line 1

line 2

line 3""" into tVar

2. global constants. Most compiled languages will allow an 'include' 
file which can specify constants, which you can then rely on to be 
defined properly (and the same) everywhere. So that's probably too much 
at odds with LC's model - but could be handled by 'protect' global 
variables (or, I'm sure, another 10 ways that Mark W. could think of).



Tail Expressions


I just don't understand this one, so no comment.


Anyway I am excited to see the first DP which is promised in the next couple of 
weeks.  My wife and I have an ongoing disagreement about the term 'couple of’ 
in terms of counting.  I say it means around 2 or 3ish.  She says it means 2. 
Further she says if you wanted to say 3 or 4 you would say ‘a few’.  So in this 
case I am hoping she is right and I am wrong and we do get the new DP in a 
couple of weeks and not a few weeks. :-)


That sounds like a 'couple' discussion I wouldn't want to get in the 
middle of. Even worse than whether a sign on the freeway/motorway saying 
"xyz next exit" means the immediately coming exit (i.e. 'this exit' or 
'next exit'), or the following one. Caused me no end of trouble when I 
first moved to the US :-)


Alex.

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


Re: Suggestion: Non-Appbuilding Community Edition

2021-09-06 Thread Alex Tweedly via use-livecode


On 06/09/2021 19:07, Lagi Pittas via use-livecode wrote:

The biggest error livecode has made all these years is not creating a
"working" storefront that doesn't look like it has been totally given up on.

Not sure that's the "biggest" - but yes, I agree it looks unloved.

Look at the addons created for XOJO  - and XOJO makes money on those


https://xojo.com/store/
https://www.monkeybreadsoftware.de/


I see a lot of add-ons (for an awful lot of money) for things that come 
built-in with Livecode.


(tongue in cheek) Maybe LCLtd should have the same add-ons page as Xojo, 
but each of them says


   "$0   already included"

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


Sample stacks / revOnline [was: Re: Suggestion: Non-Appbuilding Community Edition]

2021-09-06 Thread Alex Tweedly via use-livecode
In the main thread, I mentioned that I found revOnline (aka "Sample 
Stacks"), but didn't say how or why. Here the answer to that ...


It has:

- no differentiation between 'libraries' and 'examples'

- it has no support for script-only stacks, which is surely the way most 
libraries will be done nowadays.


- a left hand scrolling box with ~90 'categories', in no particular 
order, no grouping


- grid vs list view - list shows you a list, which is basically the same 
as a 1-wide grid rather than 2-wide, plus a larger view of some random 
other item (OK, it's not random - it simply doesn't update when it should)


- updates when you click on the picture - but gives no cursor hint that 
you can do that


- a drop-down list for sort order - which isn't sized adequately when 
you first open revonline


- a 'search' box which must search something, but I don't know what. 
There is a sample stack called "Compare stack scripts", and which is 
tagged as "compare" - but isn't found if you search for "compare".


- and I usually find things via "browser + google" (or similar) and the 
stuff in samples stacks isn't visible that way.


H - maybe I've just found my next project :-)

Alex.


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


Re: Suggestion: Non-Appbuilding Community Edition

2021-09-06 Thread Alex Tweedly via use-livecode

+1    Yes, speculation is fun, but probably not very useful :-)

On 06/09/2021 12:20, Andre Garzia via use-livecode wrote:

Let’s take a step back for a second and realise as a community we lack many 
things that other programming language communities have. We do have a very 
healthy mailing list, forum, and occasional conference. We’re all friends, and 
many of us have known each other for decades. Those are things that many, if 
not most, programming language communities do not have. And yet we have not 
fostered many of the ancillary things that most communities do.

* We have very few open source projects in the community, and the ones we have 
have very few contributors.
And I don't think they're well known, or advertised as willing (eager) 
to have new contributors.

* We have not build anything like a package manager to help us share code 
around. The IDE built-in extension store, and code sharing features are 
extremely simple.


Yes, we need a package manager and helpful conventions (where are 
libraries found to download, where do they reside on your system, how do 
they 'require' other libraries, etc. )


Re "The IDE built-in ...": Do you mean "sample stacks" ?
Or is there another extensions store and code sharing feature I've missed?

If it is "sample stacks" then I would 100% disagree about it being easy 
to use. But I'll put those comments in a separate email so it doesn't 
obscure the point here.



* We don’t have an ecosystem of tools and libraries around. We have some tools 
and some libraries.
* We don’t have many people writing blogs, making videos, writing books, and 
fostering the community.
* There are very few services and companies besides LiveCode Ltd offering 
products to the community.






The question is, who here wants to build stuff?


I think that having a package manager, and some infrastructure would be 
a huge step towards encouraging many people to build stuff. I do believe 
that the effort that went into LC Ltd supporting widgets (store, naming 
convention, add to toolbar, integrate to docs, ...) could, even should, 
be applied to script-only libraries and stacks. Or - we find some way to 
do that as part under Livecode.org


I know I have a few libraries that I could make public - but I'd be much 
happier, and more likely to finish up doing it - if there were some 
guidelines or support for how libraries should be placed, documented, etc.


revdocs - is that still around somewhere ?

Or is there a better alternative ?

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


Re: Suggestion: Non-Appbuilding Community Edition

2021-09-04 Thread Alex Tweedly via use-livecode


On 04/09/2021 15:36, David Bovill via use-livecode wrote:

So the question here is why not do the same here - keep a free-to-develop 
“trial version” without the compilation framework and tools. I’m curious to the 
reasoning. The cynic in me would say that the assumption is that there are too 
few developers in this (non-game) market who would need the compilation / 
stand-alone-builder functions - so while game developers and companies might 
pay for commercial Unity 3D licenses - that is not true for Livecode 
developers? I don’t / like / buy that argument - so I would love to here good 
reasons or not adopting a Unity 3D style licensing model?


I'm not familiar with Unity - so I'll answer just from a LC perspective 
(and in many ways just reinforce what Kevin said in his response to your 
original suggestion).


The problem with a free, no-app-builder version is that you can do so 
much with it.


You can make it easy (or even trivial) for anyone to install and run the 
stacks you create.


0. Either create your stack as a plugin, or create a plugin which gives 
a menu of apps to run.


Then instruct your users to:

1. Install LC (free-to-develop). LC's installation process is almost 
hands-free.


2. download/run a simple installer script or shell script which will put 
a stack into the (default location for) the plugins folder.


3. Run the IDE.

4. Follow the 3-click instructions to change the setting to start this 
plugin when LC starts up.


and you're done. It's not 100% as simple to install as a built app, but 
it's not rocket science.


And provided your stacks don't involve the menu system, users will 
probably not even notice that they're in the IDE. Design your app to 
look like it was "mobile-first" with its own menu built-in and 95% of 
your users would be happy.


Alex.



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


Re: Text encoding: summary of results and times.

2021-09-03 Thread Alex Tweedly via use-livecode

I went back and re-did the tests, checking on the results.

The file *is* UTF8, so I need to textDecode() it; if I don't, the result 
are simply wrong, and so the times are irrelevant.


1. Once it has been textDecoded(), i.e. is in internal format, and I run 
my algorithm it gets the correct results, taking 115.1 seconds.


2. BUT, if just before the algorithm is run, I do a textEncode(tStr, 
"UTF8") , it gets the correct results (identical to the above), but in 
only 3.3 seconds.


The code, in a zip file containing the test stack, SpellCheck Library, 
and the 'bible' and "war" sample textfiles, can be downloaded from


    https://www.tweedly.org/Downloads/SpellLib.gz

if anyone wants to look at it.

Alex.



On 03/09/2021 13:38, Alex Tweedly via use-livecode wrote:


On 03/09/2021 11:07, David V Glasgow via use-livecode wrote:

Alex states that put textEncode(tWHoleText, "UTF8") into tWholeText 
speeds replace up, but David B says LC internal format is UTF16.  
Doesn’t the 8 vs 16 difference matter?  Or matters less than other 
encodings?


I would regard that timing comparison with much suspicion. I was 
textEncoding() it inappropriately - I had just read it in from a file, 
so I *should* have been textDecoding() it. Therefore it is unclear 
whether the times I was seeing then are meaningful.


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: Text encoding.

2021-09-03 Thread Alex Tweedly via use-livecode


On 03/09/2021 11:07, David V Glasgow via use-livecode wrote:


Alex states that put textEncode(tWHoleText, "UTF8") into tWholeText speeds 
replace up, but David B says LC internal format is UTF16.  Doesn’t the 8 vs 16 difference 
matter?  Or matters less than other encodings?


I would regard that timing comparison with much suspicion. I was 
textEncoding() it inappropriately - I had just read it in from a file, 
so I *should* have been textDecoding() it. Therefore it is unclear 
whether the times I was seeing then are meaningful.


Alex.


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


Re: Put URL command

2021-09-02 Thread Alex Tweedly via use-livecode

I said :


try

  put URL "binfile:" & sourceURL into URL ("binfile:" & destinationURL)


No. Don't. I was wrong. That avoids the error message, but gets the 
wrong result. It gives you the content of the URL "binfile:" (i.e. 
empty) plus the value of the variable sourceURL



or, if you're cautious like me,

  put URL ("binfile:" & sourceURL) into URL ("binfile:" & 
destinationURL)


Yes. Do it this way. Use parens for URLs

Alex.


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


Re: Text encoding.

2021-09-02 Thread Alex Tweedly via use-livecode


On 02/09/2021 13:01, David Bovill via use-livecode wrote:

Thanks for the question Alex, I’m wrestling with the same issues - but so far 
got no responses from encoding gurus here :)

This is my understanding:

1) Yes its recommended to textEncode text that comes from outside into 
Livecode’s internal native format (which is utf16).  Livecode handles 
everything internally “transparently” from then on - which I guess means all 
usual language and control operations expect this utf16 internal format. My 
guess is this is why a few things have got slower as compared with early 
versions of Livecode.



Hi David, thanks for the suggestion. But I think you have (maybe) made 
the same mistake I made.


I blame it on the dictionary entry being truncated in one place and not 
as clear as it could be in others. The correct part to focus on is


that you explicitly*textEncode* any text you send outside LiveCode and 
textDecode all text received into LiveCode


i.e. you *decode* on the way in to Livecode (confirmed by the examples 
in the dictionary, not by the text description).


So the code I was using, sent earlier  in reply to Mark W's email said 
(something like):


  put URL ("file:" & specialFolderPath("home") & "/warpeace.txt") into 
tText

  ...
  put quote&"!?,.:;[]{}()£$¢%^&≤≥÷<>=+-…“‘”¡™#∞§¶*•ªº\/" into tList
  ...
   put textencode(pStr, "UTF8") into pStr

i.e.I encoded it on the way in.

It should have been

   put textDecode(pStr, "UTF8") into pStr

With that changed, my tiny test script works properly (and quickly). I 
haven't yet put this back into my actual app script - it's way past my 
bedtime :-), but I now expect it will be OK.


Mark - I hope this helps - and hopefully you can conclude there's no 
error, just some dictionary entries to improve. If (when) I confirm this 
in my actual app, I'll create a bugreport for the dictionary.


Alex.

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


Re: Put URL command

2021-09-02 Thread Alex Tweedly via use-livecode

try

 put URL "binfile:" & sourceURL into URL ("binfile:" & 
destinationURL)


or, if you're cautious like me,

 put URL ("binfile:" & sourceURL) into URL ("binfile:" & 
destinationURL)

Alex

On 03/09/2021 00:55, Peter Bogdanoff via use-livecode wrote:


put URL "binfile:" & sourceURL into URL "binfile:" & destinationURL


___
use-livecode mailing list
use-livecode@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 encoding.

2021-09-02 Thread Alex Tweedly via use-livecode


On 02/09/2021 18:34, Mark Waddingham via use-livecode wrote:

On 2021-09-02 12:12, Alex Tweedly via use-livecode wrote:

Sorry to drag us off the interesting topic of licensing :-) into some
Livecode question.

I know little or nothing about Unicode, text encodings, etc. - so my
question is indeed naive.

I have a text file (War & Peace from Project Gutenberg), about 3.4Mb.
The Mac describes it simply as "Plain text".


Do you have a link to the file handy?


https://www.gutenberg.org/ebooks/2600 and then chose "Plain Text UTF-8"

or directly to https://www.gutenberg.org/files/2600/2600-0.txt

(and then I saved that page to file).





When I read that into a variable, and then do
    replace tChar by SPACE in tWholeText
it takes between 1000 and 4000 millisecs - versus the 8-10 msecs I had
expected from other samples.

If I put in
    put textEncode(tWHoleText, "UTF8") into tWholeText
before the replace then it does indeed tae 8-10 msecs.


What exact code are you using in both cases? (including reading in the 
file, char you are replacing etc.)


   put URL ("file:" & specialFolderPath("home") & "/warpeace.txt") into 
tText


and then


   put quote&"!?,.:;[]{}()£$¢%^&≤≥÷<>=+-…“‘”¡™#∞§¶*•ªº\/" into tList
   -- put textencode(pStr, "UTF8") into pStr
   repeat for each char tChar in tList
  --  put the millisecs into t1
  replace tChar with space in pStr
  --  put the millisecs - t1 && tChar  after msg
  wait 0 millisecs with messages
  --  if the shiftkey is down then exit repeat
   end repeat

Obviously, comment those lines in or out as needed.
(NB yes the times I gave are for *each* char replace, not for the whole 
loop)


The character itself is the 'undefined/illegal codepoint' which has a 
different sequence of bytes for each of the main 
(UTF-8/16LE,BE/32LE,BE) encodings. If you do `hexdump -c | less` on 
the file, then if it is UTF-8 there will be three bytes before the T, 
or 4 if it is UTF-16.



Three characters, confirming the identification in the original webpage.

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


Text encoding.

2021-09-02 Thread Alex Tweedly via use-livecode
Sorry to drag us off the interesting topic of licensing :-) into some 
Livecode question.


I know little or nothing about Unicode, text encodings, etc. - so my 
question is indeed naive.


I have a text file (War & Peace from Project Gutenberg), about 3.4Mb. 
The Mac describes it simply as "Plain text".


When I read that into a variable, and then do
    replace tChar by SPACE in tWholeText
it takes between 1000 and 4000 millisecs - versus the 8-10 msecs I had 
expected from other samples.


If I put in
    put textEncode(tWHoleText, "UTF8") into tWholeText
before the replace then it does indeed tae 8-10 msecs.

Q1. What (if anything) am I losing by doing that ?

Q2. Is this the best alternative ?

Additional info - I just discovered that according to 'more' command 
line, the file start with :


The Project 

if that is useful.

Many 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


Re: LiveCode community edition is gone

2021-09-01 Thread Alex Tweedly via use-livecode
Thanks Curry. You are absolutely right, everything I said was about the starter 
plan, not the standard plan.

With that correction: “I am surprised there is no annual option on the starter 
(hobbyist) plan”.

Thanks, 
  Alex the hobbyist.

Sent from my iPhone

> On 1 Sep 2021, at 01:55, Curry Kenworthy via use-livecode 
>  wrote:
> 
> 
> Alex:
> 
> > I'm surprised there is no "annual payment" option
> > on the standard plan. The standard plan is also the hobbyist plan
> 
> "The LiveCode standard plan is an annual subscription which starts
> at $299 per deployment platform per year"
> 
> "LiveCode Starter Plan
> A great way to get started with LiveCode
> and for those who like to code as a hobby"
> 
> Best wishes,
> 
> Curry Kenworthy
> 
> Custom Software Development
> "Better Methods, Better Results"
> LiveCode Training and Consulting
> http://livecodeconsulting.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: LiveCode community edition is gone

2021-08-31 Thread Alex Tweedly via use-livecode


On 31/08/2021 19:28, Kevin Miller via use-livecode wrote:

You can only buy one plan time per person. Or if you are an organization, again 
you all need to be on the same plan. You can't buy two $9.99 platforms - 
Starter pricing is intended to be just that, to make it easy and accessible to 
get started.


I'm surprised there is no "annual payment" option on the standard plan. 
The standard plan is also the hobbyist plan, so some people will 
(rightly) remain on it forever, while knowing they intend to go on 
subscribing for the long term.


Personally, I wouldn't even care if there was a discount for paying 
annually - I just prefer not to have it cluttering up my credit card 
statement every month.


Alex.

P.S. I'll donate £20 to LC's favourite charity if someone at LC will 
take that annoying apostrophe out of "Pro's and business"

:-)


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


Re: [ANN] Organize - A daily task manager

2021-08-25 Thread Alex Tweedly via use-livecode

Hi Mark,

Looks great. I'm impressed - and inspired to have another try at getting 
past the hurdles and making an iOS app :-)

Any suggestions on how to get started would be welcome.

I'm not sure if I should send comments/suggestions directly to you, or 
to start on the list to encourage discussion. I'll start here for now.


1. (Always my first question :-)  Can I export the data if I want to 
move to another app ?

Or import ? (e.g. CSV, ...)

2. Is there a "move un-completed items to the next day" (i.e. to make it 
more like a traditional to-do list manager) ?


3. Blank items ?  From around 40sec - 1:10 sec there is a 'blank' item 
left on the screen while you do other things. Does it stay forever, or 
disappear if you move to another section ?


4. Your "left arrow' menu. Shouldn't that be (i.e. wouldn't iOS users 
expect that to be) a left-swipe to bring up the menu ?


Thanks

Alex.

On 25/08/2021 21:57, Mark Smith via use-livecode wrote:

I am very pleased to announce a wide-beta release of my first iOS app; Organize -- a daily 
to-do list manager. There is a demo on Youtube (https://youtu.be/LtQ5O1Qk80w 
) and you can download and install the (final) beta 
version here... (https://testflight.apple.com/join/AysRGtVv 
). A really big thanks to everyone who 
has helped me along the way (you all know who you are!!). I would be delighted to have 
anyone interested kick the tires and provide feedback, advice and suggestions.

Cheers,
Mark

___
use-livecode mailing list
use-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: Accumulating text is *VERY* slow in LC9 on Windows

2021-08-25 Thread Alex Tweedly via use-livecode

Crazy idea - totally untried  (sorry, I don't have a Win machine)


  put 1 into tLineCount
  repeat for each line tRow in tWorkTable
  put tRow into tNewTable[tLineCount]
      add 1 to tLineCount
  end repeat
  combine tNewTable using CR

Alex.


On 25/08/2021 18:15, Ben Rubinstein via use-livecode wrote:


Some 20 months ago, I reported that I was in a situation where an app 
written in 6.7 needed to be updated to access 64bit drivers, which 
meant updating to 9.5 - which displayed horrifying increase in 
processing time.


In fact I was able to put off the evil day - but now it has returned, 
and can be put off no longer. A process that normally takes 2 hours is 
currently taking 9. The core processing stage has gone from around ten 
minutes to over six hours.


After way too long, I've finally got down to at least one smoking gun; 
which is as simple as can be.


Part of what took me so long is a confusion; in production the process 
runs on Windows, but I develop on Mac. Although on Mac the overall 
process does take about a third longer in LC9 than LC6, the simple 
tests I've finally isolated actually run much _quicker_ in LC9 than 
LC6. So switching between LC6 and LC9 on Mac as I tried to isolate the 
issue was giving confusing signals. But unmistakeably it's *much* 
slower on Windows.


A simple routine which loops over a load of tab and return formatted 
data loaded from a TSV file, to truncate a particular field, had the 
following results processing a 70MB file of approximately 257,000 rows:


6.7.11 MacOS  9 seconds
6.7.11 Win32 10 seconds
9.6.3  MacOS  2 seconds
9.6.3  Win32    498 seconds

I simplified it down to this (pointless) loop which just rebuilds a 
table one line at a time:


   local tNewTable
   repeat for each line tRow in tWorkTable
  put tRow & return after tNewTable
   end repeat

with these results:

6.7.11 MacOS  8 seconds
6.7.11 Win32  7 seconds
9.6.3  MacOS  0 seconds
9.6.3  Win32    591 seconds

(there's obviously a lot of variability in these - both were running 
in IDE, on a logged-in computer, so stuff was probably going on in the 
background; but I know the overall effect is similar when built as 
standalone and running by schedule on an unattended machine. But the 
key thing is: for this task, LC9 is dramatically slower on Windows!)


Have others seen something like this?

When I posted about this before (thread: "OMG text processing 
performance 6.7 - 9.5") Mark Waddingham suggested that it might be to 
do with a hidden cost of binary<->text transforms. That makes some 
sense; but given that the text already exists, I'm wondering whether 
taking a line out of text would cause it to be transformed, only to be 
transformed again when appending? And in particular, why this would 
affect Windows only.


I have also added tests using "is strictly a binary string" in the 
code above, and this was true for neither input 'tWorkTable', nor the 
output 'tNewTable', nor any of the 257,00 extracted lines.


However it is definitely the accumulating of text that is the issue - 
simply looping over the lines - even with testing each one to see if 
it is "strictly a binary string" - is a second or less on Windows in LC9.


Has anyone had similar experiences? Suggestions for how this could be 
avoided?


Many thanks in advance,

Ben

___
use-livecode mailing list
use-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: Whatever happened to on-rev?

2021-08-19 Thread Alex Tweedly via use-livecode

Well, it's complicated -)

For me (Chrome on Mac), I get

on-rev.com   : redirects to livecode.com and all works ok

www.on-rev.com : gives error page (in French) and Error 403

https://on-rev.com : gives scary "connection is not private", etc. message

Alex.

On 20/08/2021 00:59, Bob Sneidar via use-livecode wrote:

I am getting an error that I do not have permission to access the site. I have 
a lifetime license.

Bob S



On Aug 19, 2021, at 16:54 , Jerry Jensen via use-livecode 
 wrote:

Eh, wot?
For me it redirects to https://livecode.com (in Safari on a mac).
.Jerry


On Aug 19, 2021, at 4:43 PM, Mark Wieder via use-livecode 
 wrote:

?
looks like it bit the dust.

http://on-rev.com/

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


Re: Most streamlined method to get data

2021-08-01 Thread Alex Tweedly via use-livecode
It looks like all the "thousand dollar+" amounts are quoted - i.e. it's 
an example of a regular CSV file - ugly but predictable.


Did you try the CSVToTab converter ?


https://github.com/macMikey/csvToText 



Alex.

On 01/08/2021 20:39, Skip Kimpel via use-livecode wrote:

So to give you a full sense of the ugliness of the CSV I am working with,
here it is:  (trying to add certain columns but because some columns have
multiple "thousand dollar+ amounts, it throws doing an item count.  Need to
get rid of all dollar signs (easy) and all the commas that are part of a
thousand+ dollar amount)
---


,3rd Party,Bakery,Bar,Catering,Delivery,Dine In,Drive Thru,Take
Out,,Vending,Total,

8:00 AM,$0.00,$0.00,$0.00,$0.00,$0.00,$0.00,$0.00,$406.43,,$0.00,$406.43,

9:00 AM,$0.00,$0.00,$0.00,$0.00,$0.00,$0.00,$0.00,$0.00,,$0.00,$0.00,

10:00 AM,$40.74,$0.00,$0.00,$0.00,$0.00,$52.41,$0.00,$200.69,,$0.00,$293.84,

11:00
AM,$538.14,$3.29,$0.00,$0.00,$0.00,$581.30,$0.00,$165.93,,$0.00,"$1,288.66",

12:00
PM,$184.11,$3.29,$0.00,$0.00,$0.00,$745.68,$0.00,$274.36,,$0.00,"$1,207.44",

1:00
PM,$89.06,$12.87,$0.00,$0.00,$0.00,$741.65,$0.00,$132.26,,$0.00,$975.84,

2:00
PM,$216.86,$12.47,$0.00,$0.00,$0.00,$604.86,$0.00,$90.32,,$0.00,$924.51,

3:00 PM,$160.69,$0.00,$0.00,$0.00,$0.00,$404.66,$0.00,$37.86,,$0.00,$603.21,

4:00
PM,$68.31,$33.71,$0.00,$0.00,$0.00,$349.46,$0.00,$323.34,,$0.00,$774.82,

5:00
PM,$286.31,$0.00,$0.00,$0.00,$0.00,$625.92,$0.00,$253.94,,$0.00,"$1,166.17",

6:00
PM,$500.66,$36.11,$0.00,$0.00,$0.00,$790.25,$0.00,$609.95,,$0.00,"$1,936.97",

7:00
PM,$224.81,$26.95,$0.00,$0.00,$0.00,"$1,038.03",$0.00,$137.17,,$0.00,"$1,426.96",

8:00 PM,$0.00,$0.00,$0.00,$0.00,$0.00,$55.46,$0.00,$7.10,,$0.00,$62.56,

9:00 PM,$0.00,$0.00,$0.00,$0.00,$0.00,$2.75,$0.00,$0.00,,$0.00,$2.75,

10:00 PM,$0.00,$0.00,$0.00,$0.00,$0.00,$0.00,$0.00,$0.00,,$0.00,$0.00,

Total,"$2,309.69",$128.69,$0.00,$0.00,$0.00,"$5,992.43",$0.00,"$2,639.35",,$0.00,"$11,070.16",

Page 1 of 1

On Thu, Jul 29, 2021 at 1:41 PM Mark Wieder via use-livecode <
use-livecode@lists.runrev.com> wrote:


On 7/29/21 9:24 AM, Ben Rubinstein via use-livecode wrote:

As grepophile, I'd go for some variation on

While I heartily approve of Ben's use of grep, here's another approach
using an array. Note that is somewhat specific to your data set, and
from the looks of the data my guess is that you're heading down the path
of csv madness.

on mouseUp pMouseBtnNo
 local tVar, tHeader, tCount, tOriginal

 put field 1 into tVar
 put line 1 of tVar into tHeader
 delete line 1 of tVar
 split tVar by cr

 repeat for each key tKey in tVar
# transform "$8,303.32" into "$8303.32"
repeat for each trueword tTrueWord in tVar[tKey]
   put tTrueWord into tOriginal
   replace comma with empty in tTrueWord
   replace tOriginal with tTrueWord in tVar[tKey]
end repeat
# now we can deal with commas as itemDelimiters
put 1 into tCount
repeat for each item tWord in tVar[tKey]
   put tWord into tVar[tKey][tCount]
   add 1 to tCount
end repeat
 end repeat # for each key tKey in tVar

 # now pick out the desired total
 local tTotal, tOffset
 put itemoffset("Total", tHeader) into tOffset
 put tVar[5][tOffset] into tTotal
 breakpoint
end mouseUp

--
   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: workaround for cut-off text in native scroller?

2021-06-02 Thread Alex Tweedly via use-livecode


On 02/06/2021 04:18, Mark Wieder via use-livecode wrote:


I do ok on resizing routines until it comes to groups. Then I always 
end up reinventing things: when and where to lock messages, how to get 
things resized in the right order so as not to undo what I just did...


If there are any rules of thumb I'd love to know them.

I can tell you mine - they work for me , but whether they work for you, 
or anyone else, is a different matter.


1. NEVER lock message just to handle resizing.
  If you need to do that, you're already in a heap of trouble :-)

2. ALWAYS (and I mean always) set the lockLoc of a group.
    Don't let those uppity groups change their size - you need to be in 
charge :-)


3. Work top-down in a (fairly) strict hierarchy. Let each level of 
card/group handle the layout of its component pieces, allocate space for 
them and "set the rect .." for each.


3a. Always resize/reposition things by setting their rect (not their 
top/left/width/...).
  Every time I try to use those seemingly-convenient shorter forms, 
I get in trouble :-)


4. Design in some logging mechanism so that if something is going wrong, 
you can easily turn on logging and see what is happening, across ALL 
your resizing group / controls.


5. In the very rare occasions where there is need to cross the hierarchy 
as above, do it explicitly (e.g. I have a convention of sometimes having 
a handler "presizecontrol" which returns a *preferred* size or minimum 
size, which the upper levels of the hierarchy can use to check what 
lower layer groups would like to be, can adjust their decisions 
accordingly - and then resize ("set the rect ..") accordingly.


Alex.



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


Re: 3-way slider control

2021-05-26 Thread Alex Tweedly via use-livecode

I'd prefer it like ...

On 26/05/2021 18:28, Paul Dupuis via use-livecode wrote:

What, like this:

on scrollbarDrag pNewPosition
  local tToolTip = "CiC only,both CiC and Source,Source only"
  set the thumbPosition of me to pNewPosition
  set the tooltip of me to "Text style changes will be applied 
to"&&(item pNewPosition+1 of tToolTip) 
    set the enabled of fld "CiC_Label" to (pNewPosition=0 or 
pNewPosition=1)
    set the enabled of fld "Src_Label" to (pNewPosition=1 or 
pNewPosition=2)

end scrollbarDrag

or, of course,

   set the enabled of fld "CiC_Label" to (pNewPosition <= 1)
   set the enabled of fld "Src_Label" to (pNewPosition >= 1)

All a matter of personal preference :-)

Alex.


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


Re: Bug, feature, or just something I need to program around?

2021-05-13 Thread Alex Tweedly via use-livecode

On 13/05/2021 20:25, Jim Lambert via use-livecode wrote:


In Notes if you are in one note then select a different note and execute 
Shift-Command-Right Arrow, you will see the same behavior. The insertion point 
moves to the end of the note without selecting any text.


I don't see that. If I move from one note to another by clicking on the 
'summary' for it, I then need to either click into the Note itself, or 
use the right-arrow to get into it. In either case, cmd-shift-arrow 
immediately does select the text.  (Notes version 4.5, 876.1, on MacOS 
1.13.6)


Is there maybe another way to move from Note to Note that I haven't found ?

Could you say *exactly* what you mean when you say "in one note then 
select a different note"?



In any case, Apple's HIG doesn't (AFAICS) specify anything, and autotab 
set to true gives me the behaviour I expect/like (for single-line 
fields, I will leave it false for multi-line fields).


It's mildly irritating that the selection anomaly exists, and also 
irritating that two behaviour changes are bundled into a single setting 
(autotab true = text pre-selection AND changes how "return"/"enter" are 
treated).


When I'm convinced I've got all the cases covered, I'll create a bug 
report for the former, and an enhancement request (for openfield to 
provide more info) to allow us to program around the latter.


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


Re: Bug, feature, or just something I need to program around?

2021-05-13 Thread Alex Tweedly via use-livecode

Thanks Jacque.

'autoTab' does indeed give a behaviour the same as I see in Apple's own 
apps (for single line fields, differs for multi-line fields), so I'll go 
with that for now.


And when I've got this all sorted out, I'll submit the issues as bug 
reports (3 I think, so far) and report them back here on the list for 
completeness.


Thank you all,

Alex.


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


Re: Bug, feature, or just something I need to program around?

2021-05-12 Thread Alex Tweedly via use-livecode

I don't follow you Jim.

Each Note in the Notes app is a multi-line field, and they all behave 
just the same as multi-line fields in LC (i.e what I think of as 
"properly" - TABbing into the field positions the cursor with nothing 
selected, and an immediate cmd-shift-arrow will select all characters 
after/before the cursor). (Though I couldn't find a way to TAB between 
Notes ??)


The only single line field I can see in the Notes app is the search box 
- and it has the same behaviour as single-line fields in Calendar, 
Contacts, etc. - i.e. TABbing into the single line field pre-selects the 
whole field, while clicking into it doesn't select anything. That seems 
consistent between Apple's apps that I can find, and both Safari and Chrome.


Alex.

On 12/05/2021 18:50, Jim Lambert via use-livecode wrote:

In a LC single line field (MacOS), the keys shift-cmd-rightarrow will
select from the current position to the end of the line, and add that to
the selection.

BUT if I TAB into the field the cursor is initially at the start of the
field and the key sequence above will move the cursor to the end
*without* selecting the characters.

At that point, shift-cmd-leftarrow will move it back to the start, still
without selecting any characters. But if you do "something else" (e.g.
left arrow, insert a char, delete a char, ...) then normal behaviour
resumes. If you click into the field, everything behaves itself.

Alex,

If you go to Apple's Notes and move from note to note, you'll see somewhat 
similar behaviors.
So perhaps it's expected.

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


Re: Bug, feature, or just something I need to program around?

2021-05-12 Thread Alex Tweedly via use-livecode
Thanks Sean - but the text cursor shouldn't always be at char 0. It is 
the first time you visit the field, but if you

 - visit the field
 - move the cursor within it
 - go off somewhere else
 - and later TAB back into that field,
the text cursor should be restored to wherever you left it. That is the 
current behaviour - the only problem is this cmd-shift-arrow failing to 
select text.


And it turns out that "select the selectedchunk" - which sounds like it 
should do nothing - actually leaves the cursor in the correct place, 
*and* fixes the cmd-shift-arrow selection problem.


Thanks again,

Alex.

On 12/05/2021 13:19, Sean Cole (Pi) via use-livecode wrote:

on openField
select char 0 of me
end openField

On Wed, 12 May 2021 at 09:03, Mark Smith via use-livecode <
use-livecode@lists.runrev.com> wrote:


Hi Alex, what sequence are you trying to do that won’t work? If you tab
into a field and then cmd-arrow (right or left) I think it restores the
“selection” behavior you are looking for ie. you can then shift-cmd-right
or left to select the chars. Would that be a work-around?


On May 11, 2021, at 9:22 PM, Alex Tweedly via use-livecode <

use-livecode@lists.runrev.com> wrote:

In a LC single line field (MacOS), the keys shift-cmd-rightarrow will

select from the current position to the end of the line, and add that to
the selection.

BUT if I TAB into the field the cursor is initially at the start of the

field and the key sequence above will move the cursor to the end *without*
selecting the characters.

At that point, shift-cmd-leftarrow will move it back to the start, still

without selecting any characters. But if you do "something else" (e.g. left
arrow, insert a char, delete a char, ...) then normal behaviour resumes. If
you click into the field, everything behaves itself.

Feels to me like a bug, but I'd be happy to be corrected.

And, if I need to - any suggestions how I could script around it ?

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


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


Re: Bug, feature, or just something I need to program around?

2021-05-12 Thread Alex Tweedly via use-livecode
Thanks Mark. Yes, it is in a sense a workaround - but it's a workaround 
the user see/does.


I was hoping to avoid the "surprise" when this one common case doesn't 
do what she/he would expect.


Oh - and I've just found the workaround


on openfield
   select the selectedchunk
end openfield
I'll open a bug report tonight, unless I can think of a reason why this 
behaviour is an advantage.


btw - many apps, particularly Apple's own apps for Mac, follow a 
different method. Tabbing into a single-line field will auto-select the 
entire field (multi-line fields don't), while clicking into them does 
not. I can't find a way to do that in LC - you get an 'openfield' 
message but there's no obvious way to tell whether the field was opened 
by a TAB or a click.


Alex.


On 12/05/2021 09:03, Mark Smith wrote:

Hi Alex, what sequence are you trying to do that won’t work? If you tab into a 
field and then cmd-arrow (right or left) I think it restores the “selection” 
behavior you are looking for ie. you can then shift-cmd-right or left to select 
the chars. Would that be a work-around?


On May 11, 2021, at 9:22 PM, Alex Tweedly via use-livecode 
 wrote:

In a LC single line field (MacOS), the keys shift-cmd-rightarrow will select 
from the current position to the end of the line, and add that to the selection.

BUT if I TAB into the field the cursor is initially at the start of the field 
and the key sequence above will move the cursor to the end *without* selecting 
the characters.

At that point, shift-cmd-leftarrow will move it back to the start, still without 
selecting any characters. But if you do "something else" (e.g. left arrow, 
insert a char, delete a char, ...) then normal behaviour resumes. If you click into the 
field, everything behaves itself.

Feels to me like a bug, but I'd be happy to be corrected.

And, if I need to - any suggestions how I could script around it ?

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


Bug, feature, or just something I need to program around?

2021-05-11 Thread Alex Tweedly via use-livecode
In a LC single line field (MacOS), the keys shift-cmd-rightarrow will 
select from the current position to the end of the line, and add that to 
the selection.


BUT if I TAB into the field the cursor is initially at the start of the 
field and the key sequence above will move the cursor to the end 
*without* selecting the characters.


At that point, shift-cmd-leftarrow will move it back to the start, still 
without selecting any characters. But if you do "something else" (e.g. 
left arrow, insert a char, delete a char, ...) then normal behaviour 
resumes. If you click into the field, everything behaves itself.


Feels to me like a bug, but I'd be happy to be corrected.

And, if I need to - any suggestions how I could script around it ?

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


Re: LiveCode convert seconds to dateItems - year is out by 19?

2021-05-11 Thread Alex Tweedly via use-livecode

I doubt it :-)  As a useless piece of info, it works OK for me.

I'd suggest printing out the tCreateDate and "the seconds" so you can 
compare.


Or, put the seconds into tCreateDate and convert it, just to see.

Alex.

On 11/05/2021 11:44, Keith Clarke via use-livecode wrote:

Hi folks,
What am I doing wrong with convert tCreateDate from seconds to dateItems…

I’m pulling the long files of files I created yesterday on a Mac and attempting 
to convert the creation date.

Whatever date type I choose, LiveCode reckons yesterday was in the year 2040. 
Did I oversleep?
Thanks
Keith
___
use-livecode mailing list
use-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: Enhancement request: show the execution contexts in debugger UI

2021-04-20 Thread Alex Tweedly via use-livecode
I will join in to support (as soon as I remember which password gives me 
access).


But I think it would be more useful to have this displayed as a "value" 
palette - similar to what you get when you double-click a variable - 
rather than another tabbed pane.


Alex.


On 20/04/2021 11:46, Andre Garzia via use-livecode wrote:

Hi Folks,

I’ve just submit an enhancement request to add a pane to the script editor to 
show the execution contexts in the debugger UI. I hope others feel like this is 
a good enhancement and will join in to support it.

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


Best
A
___
use-livecode mailing list
use-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 the dangers of automated refactoring

2021-04-14 Thread Alex Tweedly via use-livecode



On 14/04/2021 21:01, Ralph DiMola via use-livecode wrote:

Good question... I'm thinking it's the same reason that with strict compilation 
enabled a variable in a repeat loop does not have to be declared as a script 
local. If it is declared as a script local no shadow error occurs. A handler 
parameter in a way is the same as it doesn't need parameters to be declared.

What is the scope of the variable vs. the handler parameter when the handler is 
running? That's bigger question.


The parameter is different from the script-local variable (i.e. changing 
it within the handler changes the parameter, not the script-local).


(and, btw, the same non-reporting happens if it's a global shadowed by a 
parameter name).


Alex.




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


Re: On the dangers of automated refactoring

2021-04-14 Thread Alex Tweedly via use-livecode


On 14/04/2021 10:23, Andre Garzia via use-livecode wrote:

That is the main issue, the code was using the wrong hungarian-lite prefixes. 
You’d see something like

   on myHandler pDataA
 …
   end myHandler


But, lo and behold, on top of the script there would be something like

   local pDataA

Now, is that an argument to a handler? a script-local? It depends! Strict 
compilation mode doesn’t care about variable shadowing.


Never mind strict compilation mode, I think this should be a "compile" 
error anyway.


With or without strict-compilation :

  variable shadowing with a script-local and a handler-local is an error.

  variable shadowing with a parameter and a handler-local is an error.

why on earth is variable shadowing between a script-local and a 
parameter not also an error.


Alex.


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


Re: Find Replace in Script Editor with cr

2021-04-07 Thread Alex Tweedly via use-livecode


On 07/04/2021 16:46, Sean Cole (Pi) via use-livecode wrote:

FFS Alex,

I HAVE created a plugin! I was JUST trying to ask, can I insert a cr using
the replace field of the Find Replace ONLY.


And now I have too. And I found that fun and interesting. Thank you for 
triggering this interesting activity for me. I'm sorry that my telling 
the list about it caused you offence, and then caused you to   try your 
best to offend me. Sorry - you didn't really succeed.



I flipping already know how LC works for most other things. I dont need
explanations on how to suck effing eggs. Just answer the sodding question.

Answer nothing but this PLEASE.


OK. Any future question you ask, I will answer simply :"no".

Alex.


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


Re: Find Replace in Script Editor with cr

2021-04-07 Thread Alex Tweedly via use-livecode

Hi Sean,

I'm struggling a bit to understand how you intend to use this.

You give an example of


*if*  field "Level" begins with "Director" and field "UserDisplay" is not
empty and field "UserDisplay" is not "All Agents" and the label of button
"Status" is "All Sales"*then*
*put*  pidbQueryDatabase( "SELECT * FROM QGNew where UserID = '" & (fld
"UserID" of card 17 stack "QGv3") \
& "' AND DealerID = '" & (fld "DealerID" of card 1 stack "QGv3") \
& "' AND Status LIKE '%" & ("Sale") \
& "%' OR UserID = '" & (fld "UserID" of card 17 stack "QGv3") \
& "' AND DealerID = '" & (fld "DealerID" of card 1 stack "QGv3") \
& "' AND Status LIKE '%" & ("Connect") \
& "%'") into tMsg

BUT - that's no longer correct code; you need to add the "end if" after it.

I don't see how any find/replace is going to do that successfully.

You could tweak the script editor to allow some token to imply inserting 
a linefeed - but you'd still need to find the relevant end of statement 
and insert the 'end if' that you need.



So (unless I'm missing something) you will finish up doing a scripted 
solution. Also, I do believe you will want to have the ease of use of 
using the find/replace panel to select only those lines which are to be 
modified (otherwise you are likely to pull in a number of cases you 
don't want).


If it were me, I'd follow a process like :

1. identify the lines to be changed (parentheses for readability)

find/replace   (put then) --->  (put /*change*/ then)

2. use a plugin / frontscript to allow some weird key to trigger the 
changes.


Sample plugin (with thanks to Jacque for the outline)


on preOpenStack
   if the long name of this stack is among the lines of the 
frontscripts then

  put "---> passing" after msg
  pass preOpenStack
   else
  insert the script of this stack onto front
   end if
end preOpenStack

on commandKeyDown whichKey  from Jacqueline Landman Gay
   if ("editor field" is not in the name of the target and "script" is 
not in the name of the target) \

 or the shiftkey is not down
   then pass commandKeyDown

   local tSel, tNewSel
   if whichKey = "+" then
  select text of the target
  put the selection into tSel
  repeat for each line L in tSel
 if L contains "then /*change*/ put" then
    replace "then /*change*/ put" with "then " & CR & "put" in L
    replace ("& " & quote) with ("\" & CR & "   & " & quote) in L
    put CR & "end if" after L
 end if
 put L  after tNewSel
  end repeat
  set the text of the target to tNewSel
  select empty
   else
  pass commandKeyDown
   end if
   setEditorDirty
end commandKeyDown

private command setEditorDirty
   type space
   delete char (word 4 of the selectedchunk) of the target
end setEditorDirty




3. ??? the srcipt editor has lost the "coloization" of the script. There 
is (or used to be) some way to restore that for the entire script - but 
I can't remember it. Hitting 'TAB' does it for the current handler but 
not for the whole script.



So, I apologize - I've got carried away and provided a "creative" 
solution that is outside the remit of your question. So sue me :-)


But since I had just finished reading Andre's book on plugins and 
development tools, this seemed like a good opportunity to try out 
creating a plugin.


Alex.

On 07/04/2021 06:16, Sean Cole (Pi) via use-livecode wrote:

Hi all,
So, the semicolon example was only given as an oversimplification because
most of you didn't read the original post properly, jumped to the
wrong conclusion and then offered irrelevant answers. But then, the
oversimplification gathered the same results of people jumping to the wrong
conclusion by not reading the posts correctly. (It wasn't helped by my /n
\n typo that was jumped on and assumed to be where I was going wrong. It is
the paradox of this forum. Make it comprehensive, people get lost and lose
the point and give the wrong answer. Make it simple and they read more into
it and then equally get it wrong.

The code I deal with on a daily basis is infinitely more complex than a
simple - put the script of someThing into tscript; replace “;” with “;” &
cr in script; Set the script of someThing to tscript - and can do that kind
of thing in my sleep (as I often do, but infinitely more complex).

So, I KNOW all of these SCRIPTING techniques. I'm not interested! I can do
that. NOT A PROBLEM :)

BUT IN THE FIND/REPLACE PANEL !!!??

Can I use a return character (or a wildcard, escaped, coded form) in the
REPLACE field OF THE PANEL. - A simple question.

You CAN use RegEx in the FIND Field. In there you can SEARCH for \n ((I got
it right this time)) which refers to a line feed (or new line). BUT, you
CANNOT, it seems, as best I can find or from the comments made, use \n to
replace or insert a line feed.

In my scripts (the several thousands of them) there are NO (zero, none)
semicolons used to separate commands. It was used ONLY to help give you a

Re: How to get the path to the 'My Livecode' or the plugins folder?

2021-03-29 Thread Alex Tweedly via use-livecode
Not pretty, but if you know you have a particular plugin installed, then 
you can do


put the filename of stack "4wDevo" into tmp

and work from there; e.g. I get

/Users/alextweedly/Dropbox (Personal)/My Livecode/Plugins/4wDevo.livecode

Alex.

On 30/03/2021 00:06, matthias rebbe via use-livecode wrote:

Dear all,

is there a way to get the path to the 'My Livecode' or the 'Plugins' folder?

Searched now for more than 40 minutes and did not find anything about it?

Is there maybe a hidden variable / property available for this?


Regards
Matthias



-
Matthias Rebbe
Life Is Too Short For Boring Code


___
use-livecode mailing list
use-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: New(?) Idea for Standalones

2021-03-29 Thread Alex Tweedly via use-livecode


On 29/03/2021 22:11, Roger Guay via use-livecode wrote:

Thanks, Alex. Unfortunately it comes up with the “No Entry” sign on this 
machine.

Roger


I'm not exactly sure what message this is, or when it happens. But this 
sounds like "Fortunately, ..." because I think it means you have an app 
that hits a brickwall of permission on your own machine - so we can look 
at it in more detail without bothering your wife's many multiple windows.


It's hard to describe these things in words - hence my suggestion of a 
Zoom call where you can screen-share and let others watch (and suggest) 
while you try it. If you want to try that with just me, please do (I'm 
unavailable for the next hour, but free from approx 00:30 - 01:30 UK 
time), or tomorrow almost any time, given some notice).

Or contact me off-list and we'll find a time.
Or suggest a time and someone else might be able to join in and help.

There are lots of motivated people wanting to help - or to find out what 
they're going to need to tell their own users when those users upgrade 
to a later MacOS. :-)


Alex.


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


Re: New(?) Idea for Standalones

2021-03-29 Thread Alex Tweedly via use-livecode


On 29/03/2021 20:54, Paul Dupuis via use-livecode wrote:

On 3/29/2021 3:36 PM, Alex Tweedly via use-livecode wrote:
there is some way to allow unsigned apps to run on all current and 
foreseeable versions of the desktop OSes


I think your assumption that you will be able - even via some horribly 
convoluted series of steps - to run unsigned and unnotarized apps on 
FUTURE versions of macOS is probably in error. From Apple's actions 
and statements, they very much are moving to a similar sandboxed, 
highly vetted, approved by Apple model for macOS as exists for iOS apps.


It's only an assumption for "the foreseeable versions". I do agree with 
you that in the long term this will, or might, become either impossible 
or so burdensome it's not worth it.


But at that point, we don't know what will be possible.  MacOS may by 
then be so tied up that it has become equivalent to iOS. The 
disappointing part of this thread, for me, was how quickly those in the 
know convinced me there was no chance of a 'runner' app for mobile (in 
particular, iOS). I think by the time it becomes infeasible to 
circumvent the protections on MacOS, it will also be infeasible to 
produce a signed 'general runner' app for it.


Alex.


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


Re: New(?) Idea for Standalones

2021-03-29 Thread Alex Tweedly via use-livecode


On 29/03/2021 21:23, Roger Guay via use-livecode wrote:

I have to admit I haven’t had a lot of time to experiment yet on my wife’s 
computer as I've been busy here trying to communicate my problem. Also, my 
wife’s computer is busy helping her work from home, not to mention, her style 
is to have numerous windows open all the time. Drives me nuts!

I wish I could think of an unapproved Mac app I could download to my own 
machine to play with.


https://www.sonsothunder.com/devres/livecode/downloads/StackRunner.htm 
and download something suitable.


This  is the old (and I think no longer functioning) stackRunner - but 
although it doesn't appear to work properly (it is *very* old) it did 
come up and ask me to approve it.


Alex.


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


Re: New(?) Idea for Standalones

2021-03-29 Thread Alex Tweedly via use-livecode

Roger,

this is frustrating, isn't it !!

If I were you, I'd send an email to the list saying (something along the 
lines of )


I want to get to the bottom of this. I'm going to host a Zoom call on 
my wife's Mac at  where I will share my 
screen so you can all see what I'm doing, and I'll then accept 
suggestions of what to do/try.  Here's the key/invite ...

All welcome !!

I'll do my best to attend - but since I don't own a Mac that can run 
anything later than 10.13 I suspect I'll be a spectator, not a contributor.


Alex.

On 29/03/2021 20:43, Roger Guay via use-livecode wrote:

Craig.

You and I are very much in the same boat as far as how we use LiveCode.

The problem is not constructing the standalones. LiveCode is superb in this regard. 
The problem is distributing Apple unapproved standalones. It seems I can no longer 
do that anymore as I used to. The problem is that opening an unapproved standalone 
on an other computer other than one’s own is difficult if not impossible for OS 
11.2. Other’s in this thread have offered that it still can be done albeit with a 
more convoluted process, and I am still trying to figure this out. e.g if I send a 
standalone to my wife (called StackOmatic) to share, we inevitably end up with the  
"You do not have permission to open the application “StackOmatic”. “Contact 
your computer or network administrator for assistance” with a simple “OK” button. I 
can’t seem to replicate the process that others have suggested to get to the “Open 
Anyway” button.

Roger


On Mar 29, 2021, at 11:20 AM, Craig Newman via use-livecode 
 wrote:

For about eight users in my business I distribute standalones for desktop only, 
both Mac and Windows versions. These are developed on a Mac. Simple to update 
and make, simple to give away, simple to use.

That is the aspect of this thread that I do not understand, perhaps misreading 
that it is somehow problematic to do what I do without issue. I am certain I 
simply have this wrong.

I do all this in the Community version. I do not sell apps at all, though I own 
an Indy license just as a way to help LC a little. So I wonder if I am a 
scofflaw. If everyone was on a Mac, I might have simply distributed updated 
stacks, and have LC resident on all the other machines. But of course, the fact 
that most use Windows makes that impossible, and I will not use a Windows 
machine unless I have to. Anyway, leaving the IDE open is risky.

___
use-livecode mailing list
use-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: New(?) Idea for Standalones

2021-03-29 Thread Alex Tweedly via use-livecode



On 29/03/2021 19:20, Craig Newman via use-livecode wrote:

Roger.

For about eight users in my business I distribute standalones for desktop only, 
both Mac and Windows versions. These are developed on a Mac. Simple to update 
and make, simple to give away, simple to use.

That is the aspect of this thread that I do not understand, perhaps misreading 
that it is somehow problematic to do what I do without issue. I am certain I 
simply have this wrong.


Craig,

I think this all depends on your users, and which version(s) of 
MacOS/Windows they are using.


Both OSes require *either* signed apps, or that the user give permission 
to run unsigned apps (either doing that for each app, or once in the 
system settings). In the more recent versions (certainly of MacOS), the 
steps needed to do this have become increasingly well hidden, and the 
warning messages have become increasingly scary.


If you (i.e. your users) have been used to seeing these, and taking the 
steps around the hurdles, they probably do so naturally and without 
worrying (or, they've already down-tuned the protection in the settings 
and so no longer see any warnings for new apps).


In my case, the Macs I own are, like me, elderly, and hence restricted 
to MacOS 10.13 or older - and I barely notice; occasionally I have to 
right-click on an app and agree to it running. From Roger's description, 
this is much more intrusive in newer MacOS, and finding your way to the 
correct place to give that permission is non-trivial.


However, there is no doubt that there is some way to allow unsigned apps 
to run on all current and foreseeable versions of the desktop OSes, so 
if you have a fairly restricted audience, you can simply ignore the 
problems addressed in this thread and focus on getting the permissions 
properly changed for them.


Alex.



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


Re: New(?) Idea for Standalones

2021-03-27 Thread Alex Tweedly via use-livecode



On 27/03/2021 02:43, Richard Gaskin via use-livecode wrote:
This makes the Community Edition a natural fit for a generic player, 
since the proliferation the license explicitly encourages would be 
very much with the grain of its goals.


But then we have to ask: how many of those who might enjoy a generic 
player embrace the GPL with the stacks they'd like to distribute it with? 


hmmm - I don't get that bit.

The generic player would be built with Community Edition - and hence 
must be GPL-compliant.


However, the stacks it "plays" are merely documents. GPL is (afaiu) 
clear that documents viewed (or indeed created) by GPL apps are not 
covered by the GPL - i.e. it does not proliferate into the stacks. The 
stacks are not in any way derivative of the player.


So I could build a stack with my Indy license, and distribute that under 
any restrictive licensing terms I choose, but use the CE/GPL compliant 
player app to run them.


Of course, the source of the stacks would be visible, but there wouldn't 
seem to be any requirement on which licensing terms I apply to that stack.


Or, I may be misunderstanding GPL again - I have done on many occasions 
since I first hired a developer to work on gcc back in the mid-80s :-)


Alex.


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


Re: New(?) Idea for Standalones

2021-03-27 Thread Alex Tweedly via use-livecode


On 27/03/2021 18:29, Richard Gaskin via use-livecode wrote:
My response to Alex was apparently too long to be read, but I touched 
on this in third block, re "security", re implications for a player as 
well:

http://lists.runrev.com/pipermail/use-livecode/2021-March/263948.html

Not at all "too long to be read";  just too long to take in quickly and 
make coherent responses.


I won't even start on that until I've finished fulminating over your 
misspelling of whisky - but a response (or two) will come.


Alex.

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


Re: New(?) Idea for Standalones

2021-03-26 Thread Alex Tweedly via use-livecode


On 27/03/2021 00:35, Richard Gaskin via use-livecode wrote:


What are you looking for?  When were these "good ol days" in which one 
could run stack files without an engine, and how did that work?


I can describe what I would like; that may be similar to what Roger is 
looking for. Or it may not.

But I think it is :-)


I'd like to be able to develop a stack and give it to a friends or 
family, and have them run it on their iOS or Android devices. I don't 
want to get involved in building iOS standalones (or even installing 
xCode), so ideally I would give them a simple app (i.e. stackRunner kind 
of thing), and then my "app" as a document to load into that 'runner' app.


There are many reasons it would be problematic to make one generic 
"player" for everyone's stack files, mostly user experience but also 
app store restrictions, and additional technical requirements for any 
devs using it to keep stacks playing nicely together.


I'm not going to sell apps, or distribute them widely, so I (don't think 
I) care about app store restrictions. I also don't care about 'user 
experience' in the sense of branding or feeling like a unique app.


I'm not sure what you mean by  "additional technical requirements..."

If that's feasible, I'd happily buy (or contribute cost towards) such a 
'runner' app. I doubt that I'd be the only one.


Alex.


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


Re: Does anybody know if the Livecode Global happened yesterday?

2021-03-26 Thread Alex Tweedly via use-livecode
Yes, it happened yesterday (and I enjoyed it, and as always learnt 
something), and it will again today.


I'd email Heather (support@...) - and maybe mark it urgent if you want 
to get in in the next hour.


Alex.

On 26/03/2021 14:18, Lagi Pittas via use-livecode wrote:

HI All,

I purchase both the beginner and advanced courses (gotta have the set ;-) )

I filled in the questionnaire/registering email that was sent a few weeks
ago,  and since  . nothing.



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


Re: Array Split vs Combine

2021-03-09 Thread Alex Tweedly via use-livecode



On 09/03/2021 16:56, Sean Cole (Pi) via use-livecode wrote:

Hi all,

I have a tsv I split out as an array, process, then combine back to a tsv.
The tsv is 53MB (55,635,198 bytes) and has 228320 lines with 21 columns
(55406878 chars).

To load the tsv file : 434ms
To split the tsv to array : 506ms
To combine the array to a tsv : 2m 58s 214ms

Why does it take so much longer to combine than split?


No idea. It *doesn't* for me.

I get timings of

367 725 919

(on my aging MacBook Pro)

Alex.


Link to the file:
https://www.dropbox.com/s/r6aq3ysbj13o16o/Enhanced-GB.tsv?dl=0
Test code:

*put* the millisec into tTime1
*put* url("file:Enhanced-GB.tsv") into tTest
*put* the millisec into tTime2
*split* tTest using cr and tab
*put* the millisec into tTime3
*combine* tTest using cr and tab
*put* the millisec into tTime4
*put* tTime1,tTime2,tTime3,tTime4


Sean
___
use-livecode mailing list
use-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 container parameters

2021-03-02 Thread Alex Tweedly via use-livecode

The number of lines being sorted makes o difference.

The number of distinct sorts will - but at a single 'do' for each of 
"several hundreds", you'll not even notice except (maybe) if you are 
benchmarking it (around 5ms per 1000 'do's on an elderly MacBook Pro).


Alex.

On 02/03/2021 22:52, Paul Dupuis via use-livecode wrote:

Okay. Thank you Ralph.

I was reluctant to use "do" for performance reasons. The sort could be 
sorting a large number of lines - as many as several hundred sorts of 
a thousand to ten thousand lines.


I could of course do timing trials, but does anyone from the 
mothership (or anyone period) know if using "do" with a container sort 
causes any appreciable performance hit? All the data is in a variable 
(vs fields).



On 3/2/2021 5:19 PM, Ralph DiMola via use-livecode wrote:
I found that you must us a "Do"(thank heaven for "Do"s) if you want 
to make variable any LC token that colorizes like "stack", "the", 
"field", "button", "put" or "ascending".


I don't think "Do" is a kludge is this case.

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net

-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On 
Behalf Of Paul Dupuis via use-livecode

Sent: Tuesday, March 02, 2021 4:56 PM
To: use-livecode@lists.runrev.com
Cc: Paul Dupuis
Subject: sort container parameters

I just discovered much to my dismay that you can not execute the 
following:


put "ascending" into tDirection
soft lines of tContainer tDirection international

apparently neither the sort direction (ascending|descending) nor the 
sort type (international|text|datetime|numeric|binary) can be variable!


That means if you want to parameterize a sort direction, you have to 
do something like:


if tDirection is "ascending" then
    sort lines of tContainer ascending international else
    sort lines of tCOntainer descending international end if

I see this a a bug or perhaps a failure to fully robust impliment the 
sort container command? Does any one else see this as a bug?


I suppose I could work around it with a "do" but that seems like a 
cludge


do ("sort line of tContainer" && tDirection && tSortType)

Thoughts? Comments? Opinions? Am I expecting too much of LiveCode to 
have sort direction and type actual parameters?



___
use-livecode mailing list
use-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: [OT] Poll: What does it mean for 1 rect to be 'within' a certain distance of another rect?

2021-02-16 Thread Alex Tweedly via use-livecode
Paul - if you need to do this (i.e. find pairs of rects which are too 
close) for LARGE numbers of rects, I have some code to do this very 
efficiently (somewhere in an old archive, just ready to translate from C 
to LC). It uses a 'trailing window horizontal scan' so reduces the 
complexity/time from N^2 to N log N


Alex.

On 16/02/2021 18:27, Paul Dupuis via use-livecode wrote:

On 2/15/2021 5:53 PM, Paul Dupuis via use-livecode wrote:
This is an Off Topic informal poll of sorts, but related to LiveCode 
as I am writing a LiveCode expression to determine if 2 arbitrary 
rectangles (r1,r2) are with some distance d (in px) of one another. 
In considering this problem, the questions comes up: What is meant by 
rectangles being within a distance d of one another. What is the 'd' 
measured from?


center to center? Easiest is many ways, but I don't think this is 
what most people would think of.


adjacent edge to adjacent edge? This is harder (I think), but I think 
this is what more people intuitively think of. To me, implicit in the 
visual concept of 2 rects being within some distance of one another 
is that they are NOT overlapping, but that some gap exists between 
the nearest adjacent edges?


Something else? What does 2 rects  being 'within' d pixels of one 
another mean to you, if not one of the two above options?


Maybe there is a exact mathematical definition of what 2 rectangles 
being within distance d of one another is, but, if there is, I am 
unfamiliar with it.



Okay, Poll Closed!

Thank you everyone. I think the responses (informal as this is) 
confirms the majority fo people think of distance between 2 rectangles 
as the distance between nearest edges or vertices which is the same as 
saying the *smallest* distance between any two points in the rects 
(mathematically)


I appreciate all the responses! (and the links and code examples!)

-- Paul

___
use-livecode mailing list
use-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 Roadmap

2021-02-16 Thread Alex Tweedly via use-livecode


On 15/02/2021 12:55, Andre Garzia via use-livecode wrote:
It is with this in mind, that I decided to create content for our 
community. Books are an easy value proposition. Most of our community 
is beyond their thirties and have a fondness (and experience) for the 
written word and documentation. It is easy to sell books here, way 
easier than in other communities which are younger and prefer videos. 
That doesn’t mean that I can’t provide videos as well, damn I’ve 
graduated with a BA in filmmaking, I’m geared to start filming too. 
Books were the first step. I see myself more as a storyteller than a 
developer, that is why I want to focus on content for my own career 
moving forward. But that is only my own personal journey, other people 
here have a different path. I just wish that more people here decide 
to share their knowledge (and code) so that we can become a more 
vibrant community. 


Then I have a concrete suggestion for what would, I think, be a very 
useful e-book + stack.


A sample 'skeleton' app - i.e. complete but not fleshed-out. Initially 
it would be for a desktop app (the first sequel will cover mobile). It 
would implement "good practices" for many of the common features, with 
enough code being there to do something - but the focus should be on the 
architecture rather than on doing anything useful.


It should include (most of):

 - splash stack, with checks for updated versions, background 
downloading & installing them, etc.


 - proper locations for libraries, prefs files, other config data, 
other data, etc. as well as loading the libraries.


 - simple preferences handling (i.e. library which will store, retrieve 
and allow basic user interaction to view/update preferences - given some 
description of the preferences)


 - a menu, ready to extend or remove, with abstraction of the functionality

 - maybe a status bar

 - some groups that handle resizing well

 - multiple cards should be involved

 - probably simple SQL (i.e. sqlite + your DBLib)

And of course the most difficult part will be writing the e-book that 
describes the app, what it does, and maybe why those particular methods 
were chosen over some of the alternatives.


Then the sequel would cover mobile, so adding features like a Header 
Bar, segmented control, using library to overlay controls with native 
controls as needed, ... as well as describing the hoops one needs to 
jump through to actually do mobile developments.


Further sequels could then cover additional features - again for 
architecture and example, not just to make it a more complicated app. 
For example: toolbar, pane splitter, data grid, ...


Alex.

P.S. I'd be happy to collaborate on doing the development part - but I 
suspect you'd be quicker without me :-)


P.P.S title suggestion "The Soul of a New App".



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


Re: [OT] Poll: What does it mean for 1 rect to be 'within' a certain distance of another rect?

2021-02-16 Thread Alex Tweedly via use-livecode

Hi Henk,

No, it's maybe not obvious but it does take all cases into account.

If the smallest distance is between corners of each rectangle - only 
then does the 'sqrt' have real meaning. In all other cases, one or other 
of the DX and DY comes out as 0.


--
 |    |
| R1 |  --
 |    |  |    |
 |    |  | R2 |
 --  |    |
     -


So if there is an overlap in one dimension, (Y above) then DY is 
calculated as 0 - and the result is the distance in X (i.e. sqrt(DX*DX+0) ).


Alex.


On 16/02/2021 07:45, Henk van der Velden via use-livecode wrote:

Alex,
No one would challenge your definition I think, but your solution only takes 
the corner points into account, right? So this wouldn’t give correct results in 
case the rectangles have different sizes or are positioned obliquely.

Henk



On 16 Feb 2021, at 03:12, use-livecode-requ...@lists.runrev.com wrote:

For me, a more precise problem specification is:

Given two rectangles (in regular Livecode format), the distance between
them is :

?- if they touch or overlap, distance is zero.

?- otherwise, it's the smallest distance from any point in R1 to any
point in R2.

Which leads to a simple solution


function rdist R1, R2
?? local DX, DY
?? put max( item 1 of R1 - item 3 of R2, item 1 of R2 - item 3 of R1,
0) into DX
?? put max( item 2 of R1 - item 4 of R2, item 2 of R2 - item 4 of R1,
0) into DY
?? return sqrt( DX*DX + DY * DY)
end rdist


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: [OT] Poll: What does it mean for 1 rect to be 'within' a certain distance of another rect?

2021-02-15 Thread Alex Tweedly via use-livecode


On 15/02/2021 23:21, Sean Cole (Pi) via use-livecode wrote:

Hi,
No point reinventing the wheel..


But most of those links actually did not have this particular wheel, or 
anything like it.


The exception was the last one (programmerssought.com) which had an 
ugly, inefficient and lengthy (45 lines in Python) solution. [OK, that 
45 includs blank and comments :-) !!


For me, a more precise problem specification is:

Given two rectangles (in regular Livecode format), the distance between 
them is :


 - if they touch or overlap, distance is zero.

 - otherwise, it's the smallest distance from any point in R1 to any 
point in R2.


Which leads to a simple solution


function rdist R1, R2
   local DX, DY
   put max( item 1 of R1 - item 3 of R2, item 1 of R2 - item 3 of R1, 
0) into DX
   put max( item 2 of R1 - item 4 of R2, item 2 of R2 - item 4 of R1, 
0) into DY

   return sqrt( DX*DX + DY * DY)
end rdist


Alex.



Lots of other way. Distance between two near or far edges. distance between
corners, distance to centers, or area median, area of space between,
overal usage area minus the area used by the two rectangles. Math is fun.
Keeps us in business.

Google (distance between two rectangles):

https://stackoverflow.com/questions/4978323/how-to-calculate-distance-between-two-rectangles-context-a-game-in-lua

https://math.stackexchange.com/questions/2724537/finding-the-clear-spacing-distance-between-two-rectangles

https://www.wyzant.com/resources/answers/583373/finding-the-distance-between-two-rectangles

https://www.programmersought.com/article/44554760896/

etc

On Mon, 15 Feb 2021 at 22:53, Paul Dupuis via use-livecode <
use-livecode@lists.runrev.com> wrote:


This is an Off Topic informal poll of sorts, but related to LiveCode as
I am writing a LiveCode expression to determine if 2 arbitrary
rectangles (r1,r2) are with some distance d (in px) of one another. In
considering this problem, the questions comes up: What is meant by
rectangles being within a distance d of one another. What is the 'd'
measured from?

center to center? Easiest is many ways, but I don't think this is what
most people would think of.

adjacent edge to adjacent edge? This is harder (I think), but I think
this is what more people intuitively think of. To me, implicit in the
visual concept of 2 rects being within some distance of one another is
that they are NOT overlapping, but that some gap exists between the
nearest adjacent edges?

Something else? What does 2 rects  being 'within' d pixels of one
another mean to you, if not one of the two above options?

Maybe there is a exact mathematical definition of what 2 rectangles
being within distance d of one another is, but, if there is, I am
unfamiliar with 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


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


Re: Stack check-out/check-in

2021-01-25 Thread Alex Tweedly via use-livecode
which is fine if you are OK doing manual clean-up when, not if, if the 
stack should ever exit without 'quit'ing, or become disconnected from 
the network, or ... any of which would leave the file-flag behind.


The  easiest alternative is to have the stack update the file 
periodically, and instead of checking for the file's existence, check 
how up-to-date it is. Do the update this periodically (maybe every 
minute, every 5 minutes , ...) and if the file exists but is old by more 
than 3 * the chosen interval then delete the file and continue.  (And do 
be careful of time drift between different machines).


Alex.

On 26/01/2021 01:06, Paul Dupuis via use-livecode wrote:
If the could storage the stack is on has write access, the easiest 
mechanism is a file based flag.


When the stack is launched, if checks:

if there is a file  then
  -- the stack is already open, so exit
else
   put empty into URL ("file:"&) -- creates a empty file to 
mark as open

end

and  when the stack exists remove the file

on quit
  delete file 
end quit

Or something like that. I do not have LC open to check my code above.


On 1/25/2021 7:24 PM, Marty Knapp via use-livecode wrote:
I have an app that allows user to create specialized editable 
documents (stacks) that open in my app. Some customers use Dropbox, 
iCloud, OneDrive or similar to store these documents so that they can 
be accessed from 2 different computers. Is there a way to tell if a 
stack is already open on one computer? I need to prevent them from 
opening a 2nd instance of the stack on the other computer so that 
Dropbox (or other cloud sync service) does not create a conflicted copy.


If there is not a way to tell, has anyone created some sort of stack 
check-out/check-in system that they'd be willing to share? I need 
this for Mac, PC and mixed.


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

http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-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: opened socket in IDE prevents script changes

2021-01-15 Thread Alex Tweedly via use-livecode


On 15/01/2021 14:46, matthias rebbe via use-livecode wrote:

Alex,
for a new project which should include socket communication  i have to prototype a short 
"demo" and i was already wondering if i need to have running 2 instances of the 
LC IDE for development.

But now you wrote that you had one server and even multiple client stacks 
opened in LC.
So do i understand it correctly that both, server and client stack, can 
communicate with each other using sockets in one instance of the LC IDE?


Yes. A couple of cautions ...

 - make sure your handlers are carefully named
    I had a bad habit of using the same name (_gotpacket) each time I 
wrote a socket-handling stack,

so I had 'open socket ... with message "_gotpacket" '
and then I used the same name when I wrote the server !!

 - beware "resetall". In the server stack, I do something like


    -- would usually do
  --    resetAll
  -- but this causes problems with testing when you have both a client
  -- and a server within the IDE of Rev
  -- so here we will only reset those opensockets which have no 
'host' part

  -- intending this to be the ones which we have a current 'accept'
  repeat for each line tSock in the openSockets
 if ":" is not in tSock then close socket tSock
  end repeat

and in the client stacks I do the inverse (if ":" is in tSock ...). Note 
this is still a problem when you have multiple client stacks in the same 
IDE.


Finally,

 - when in doubt during testing - first reset the server, then the client.


Good luck,

Alex.


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


Re: opened socket in IDE prevents script changes

2021-01-15 Thread Alex Tweedly via use-livecode


On 15/01/2021 15:30, Bernard Devlin via use-livecode wrote:

I'm seeing exactly the same range of behaviours I described earlier for
9.5.1 on Win 10 but with 9.6.1 on OS X.

It's very strange that Alex is also editing scripts with sockets
opened/closed but  not losing changes made in the script editor. I also had
3 crashes on OS X within 30 minutes of working on this stack.

Alex, are you using the IDE's script editor or some external editor?  If
you are using that script editor, once you've opened a socket could you add
a comment to your stack script, apply, close the script editor, then edit
the script again to see if the comment has persisted?  I have to quit LC to
make any changes to a stack once I've opened a socket.


Yes, I'm using standard IDE script editor.

The added comment persists, both through  "apply - close - reopen" and 
"apply - save stack - close editor - reopen", and to stack and card scripts.



It seems to me that once a socket has been opened that the IDE is no longer
persisting changes.  I'm pretty sure I didn't see this behaviour on my
previous project using sockets.


Have to ask

 - do you have any plugins that might use sockets ?

 - I'm using Indy version - let me know if you're on Community / 
Business and I can try that too

  I think :-)

 - do you, or have you, used other editors / debuggers that might 
affect this ?


 - do you, or have you, used remote debugging ?

That's all the straws I can think of for now.

Alex.


Regards
Bernard

On Fri, Jan 15, 2021 at 12:21 PM Bernard Devlin  wrote:


Thanks Alex for your quick response.

I'll try with 9.6.1 on Mac.  The only other difference between us is that
my sockets are interacting with a process outside of LC. But I can't see
why that would make a difference (particularly once I've closed all
sockets, I wouldn't expect sockets to interfere with scripts being
changed).

Regards,
Bernard

On Fri, Jan 15, 2021 at 12:07 PM Alex Tweedly via use-livecode <
use-livecode@lists.runrev.com> wrote:


I've not seen any such problems - though with 9.6.1 / Mac.

I've spent most of the last week in the IDE, with two or more stacks
open (one server, one client - occasionally multiple client stacks) so I
have multiple open sockets (both 'accept'ing and 'open'ed)  almost all
the time, and had no problems with IDE or script editor.

(I know - that's no consolation, but I thought I'd mention it in case
9.6.1 was an option for you and might just help:-)



___
use-livecode mailing list
use-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: opened socket in IDE prevents script changes

2021-01-15 Thread Alex Tweedly via use-livecode

I've not seen any such problems - though with 9.6.1 / Mac.

I've spent most of the last week in the IDE, with two or more stacks 
open (one server, one client - occasionally multiple client stacks) so I 
have multiple open sockets (both 'accept'ing and 'open'ed)  almost all 
the time, and had no problems with IDE or script editor.


(I know - that's no consolation, but I thought I'd mention it in case 
9.6.1 was an option for you and might just help:-)


Alex.

On 15/01/2021 11:37, Bernard Devlin via use-livecode wrote:

This is a strange phenomenon.I wonder if anyone else has seen this.

Livecode 9.5.1 Windows 10.

If a socket is opened then changes to scripts in the IDE are not
applied/saved.  There's no error message. It *appears* from the IDE that
the changes are applied (i.e. the changes are visible in the script editor,
the "apply" button indicates the script is no longer dirty).

*Even if the socket is then closed and changes made this problem occurs.*
There are also many crashes of the IDE in working on scripts involving
sockets.  It's because of these crashes that I realised changes are not
applied.

Once a socket has been opened/closed then in the IDE the stack cannot be
closed/reopened without closing/reopening the entire IDE. Saving the stack
from the message box also results in the (not really applied) changes being
saved.

Regards
Bernard
___
use-livecode mailing list
use-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: Threads in LC

2021-01-08 Thread Alex Tweedly via use-livecode


On 08/01/2021 01:51, Bob Sneidar via use-livecode wrote:

I have thought about this a bit. If what you mean by multiprocessing is that a 
new process can be spawned while your app can go off and do other things and 
get notified later that something happened, then this is quite doable. If what 
you mean is that you want to make the app spawning the processes operate more 
efficiently by launching the same process over and over in multiple instances, 
then I don’t think so. At some point the parent process is going to have to get 
the result of each thread and do something about it.


I did something like this, but didn't spawn a new process for each 
asynch task being launched.


What I did instead was have a very general purpose 'task handler' app, 
and have multiple instances of this 'server app' running all the time; 
as long as they're not doing any task, that's a negligible "cost" in 
resources. Each instance would accept a socket connection on a different 
port (e.g. 6000, 6001, 6002, ...) and would be passed "requests" to 
handle a specific task. It would queue up multiple tasks, handle them in 
turn, and pass the result back over the connection to whichever app 
requested it.


Then there was a client library, which would handle all the "messiness" 
for the client, so the app need not be too involved. The app itself 
would simply 'start using' the library, tell it which tasks it wanted to 
be able to do (see below), and then pass in multiple requests through 
library calls. The library would determine how many task-handler apps 
were available, parcel out the requests between them, and provide the 
responses to the client (if needed).


For each task (or set of tasks) you would write a library stack, which 
would have handlers to perform the task(s), and respond.



Example (trivial and may contain typos).

(you have to imagine that generating random numbers was very time 
consuming :-),


1. Write a library stack to perform some tasks.

stack "randomstuff"
global gResultData, gResultObject   -- remember - one task at a time, so 
no race conditions


on randomint pData
   local tmp, tMin, tMax
   put word 1 of pData into tMin
   put word 2 of pData into tMax
   put random(tMax - tMin + 1) into tmp
   put tmp-1 + tMin into gResultData
   send "completedTask" to gResultObject in 1 millisec
end randomint


2. In the client app, determine the tasks to be handled

(within, say, openstack)

   taskClientLoadStack "randomstuff.livecodescript"


3. when you need a number of random integers

  repeat 1000 times
    put taskClientSendARequest("randomstuff", "randomint 12 17", the 
long ID of me) into tmp

  end repeat
   -- (the return value is a request id - often can be ignored).
...
on taskcomplete pID, pResult
   -- pID is the request ID, pResult is the returned data from that request
   put pResult  after sNumbers   -- or whatever
...
end taskcomplete

In addition, there were various 'admin' taks you could request (close 
connection, cancel pending tasks, get count of remaining tasks pending, 
...). The initial version of the client library simply round-robined the 
task requests between the task-handlers, but the 'status' request would 
allow for more intelligent load-balancing i fneeded.



I did all this many years ago (2006 ??) and had this up on the earliest 
version of revonline (which subsequently got deleted). I developed it to 
help with indexing (including md5hash) of large numbers of image files. 
Using 4 task handlers, it was able to do the indexing in around 1/3 of 
the time the single-threaded version took.


I still have the code - but unfortunately I can't find the write-up / 
documentation on how to use it. And, I admit I absolutely cringe now to 
look at the code - it *seriously* needs to be re-written, or heavily 
revised.


I'll clean up the code, write up how to use it and post it somewhere for 
anyone who wishes to try it out.


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


  1   2   3   4   5   >