Re: HTML font size in percentages

2022-05-20 Thread Keith Clarke via use-livecode
Hi Jaque,
A lot will depend:
1) Whether the changes in font size within the nested HTML tags have been set 
locally or ‘more properly' as relative to the root font size of the page in 
‘rem’, where 1 rem = 100% of the root font-size).
2) you want a global font-size adjustment or more granular.

If you can set CSS in the page (via the browser widget of by inserting text 
into the HTML), you could try experimenting with setting the body or other 
outermost element font-size to 5rem to see if that affected sizing throughout?

For example, if the page it has a body tag, you could insert the following 
style block into the HTML header tag.


body {font-size: 5rem;}

  
Best,
Keith

> On 20 May 2022, at 17:32, J. Landman Gay via use-livecode 
>  wrote:
> 
> I have a field whose HTMLtext is set to a heavily tagged HTML file that 
> changes the font size repeatedly. We want to allow the user to adjust the 
> size of the text. The easiest way would be to use percentages for the font 
> sizes so that changing the field's textsize would change the markup 
> proportionally, but LC fields don't seem to support that. Is there a trick or 
> do I need to do a series of replacements? I'm afraid that will be too slow, 
> there's a lot of text.
> 
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
> 
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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


Re: CSV to TSV (was Re: Tools & techniques for one-off consolidation of multiple 'similar' CSV files?)

2022-04-05 Thread Keith Clarke via use-livecode
Ah, thanks Alex - I’ll dig into that. 
I did search around for CSV to TSV in several places before posting but not CSV 
to Tab and not github!
Best,
Keith

> On 5 Apr 2022, at 18:17, Alex Tweedly via use-livecode 
>  wrote:
> 
> 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


___
use-livecode mailing list
use-livecode@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 Keith Clarke via use-livecode
This code sits early in the process of preparing CSV file data (from files that 
I didn’t create, so their content is unknown) into TSV text for onward 
processing.
 
So, the logic here is attempting to address the very concerns that you raise, 
albeit in reverse order i.e. 
- remove any tab characters with (future) special meaning from the (CSV) data 
before introducing tabs as delimiters - to avoid false item-breaks downstream.
- swap out the two forms of CSV delimiter (commas between quotes and commas) 
with the alternative tab delimiters
…and finally clean up any orphan quotes left at the beginning of the first item 
in the line or end of the last.  

Best,
Keith 

> On 5 Apr 2022, at 17:09, Mike Kerner via use-livecode 
>  wrote:
> 
> I'm confused by the code, above. If you are using tab as your column
> delimiter, then you wouldn't replace it with a space, since your tsv/csv
> files would have tabs in them when they were exported, originally.
> In any case, when you are going to replace a character with another
> character, you should make sure that the character you are replacing it to
> either a) does not have any special meaning (e.g. a delimiter) or b) if it
> does have a special meaning that it does not appear in the data, already.
> ___
> use-livecode mailing list
> use-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


CSV to TSV (was Re: Tools & techniques for one-off consolidation of multiple 'similar' CSV files?)

2022-04-05 Thread Keith Clarke via use-livecode
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


Tools & techniques for one-off consolidation of multiple 'similar' CSV files?

2022-04-04 Thread Keith Clarke via use-livecode
Hi folks,
I need to consolidate a couple of hundred CSV files of varying sizes (dozens to 
hundreds of rows) and column structures (some shared columns but many unique), 
into a single superset dataset that comprises all data from all files.

There are too many files and columns to attempt a manual process, so in I’ve 
been trying to achieve this with LiveCode - by iterating through the files to 
parse the column header rows into into row template and column mapping arrays 
used to build the combined table. However, I'm struggling to both compile the 
superset and render the results. 

I feel I may be designing a very complicated solution for a problem that has 
probably been solved before. I wonder if I’m missing a simpler method - with 
LiveCode or perhaps with Excel or ‘drag & drop’ into some kind of 
self-organising database GUI for SQLite, etc? 

Thanks in advance for any ideas.
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


Re: Getting Webpage Information

2022-03-27 Thread Keith Clarke via use-livecode
Hi Rick,
Maybe try 'put the text of widget "youtBrowserName" into field "yourFieldName" 
' to get the plain text? If you need the html source, try '...the htmlText' of 
widget...
Best,
Keith

> On 27 Mar 2022, at 19:01, Rick Harrison via use-livecode 
>  wrote:
> 
> I have been playing around with the WebBrowser
> widget, and I can’t seem to grab the content results of
> what the page returns.
> 
> Example:  If I use the Browser to navigate to google,
> I can program a way to search for “Bird”.
> When the results are returned in the browser, I can
> manually perform a select all. I can then do a simple
> copy and paste of the copied text into a field.
> 
> I just can’t perform the above programmatically
> with LiveCode.  What am I missing here?
> 
> Thanks,
> 
> Rick
> 
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

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


Re: How to access scripts on a modal card that is stuck / not visible?

2022-03-18 Thread Keith Clarke via use-livecode
Thanks all for the hints and tips. I was able to access the guilty scripts from 
the message bar using edit script of  Thanks Jaque!

As this is just for a personal utility, I’ve made the Browser widget (which is 
only used for login) act as a rough and ready ‘modal dialogue’...
- Browser widget sized to cover all clickable elements on the card other than a 
“Cancel” button, with its visible set to false
- “Login” button with script to set the visible of control “Browser” to true 
and then build and set its authorisation request URL and headers
- Browser widget script with browserNavigateComplete to confirm arrival at the 
post-authentication callback URL and then set the access_token of the stack 
(for global access) and set the visible of control “Browser” to false

Seems to work OK, so now I can concentrate on the web service data - and the 
reason why I started building the stack!
Best,
Keith 

> On 18 Mar 2022, at 17:23, J. Landman Gay via use-livecode 
>  wrote:
> 
> Modes are only for stacks and can't be used for individual cards. It sounds 
> like the whole stack is going modal. There are several ways to edit a script 
> for a control.
> 
> 1. Click the script lines in the project browser, or right click the control 
> in the app browser and choose "edit script".
> 2. In the message box: edit script of . I.e., edit script of btn 1
> 3. Turn off messages in the toolbar. Then you can edit scripts as usual.
> 4. Choose the edit tool, right click the control, choose to edit the script.
> 5. If the stack is already in modal mode, use the message box to: toplevel 
> . Or Cmd-Opt-Shift click the stack and choose toplevel from the 
> Mode menu item. (I assume on Windows that's control-alt-shift.)
> 
> There are also other keyboard shortcuts but those should get you started. 
> Since the mode doesn't change unless you click the button, you should be able 
> to edit the script normally if you don't do that.
> 
> You can display a substack as a modal login, or use a group on the current 
> card.
> 
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com

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


How to access scripts on a modal card that is stuck / not visible?

2022-03-18 Thread Keith Clarke via use-livecode
Hi folks,
Experimenting with OAuth, I built a “Login” card containing a Browser widget 
that allows me to access OAuth to log onto an online service. Once authorised, 
the script on the Browser Widget finished with 'go card “Home”’ where I’m 
building out some utilities to work with the web service.

The web service’s access token is short-lived, so I thought I’d convert the 
Login card into a pop-up dialogue on the Home card for convenience. So, I added 
a “Login” button to that card to ‘go card “Login” as modal. However, now any 
attempt to go to the Login card results in either the card flashing up and 
disappearing or the stack locking with the modal card inaccessible. I seem to 
have created some kind of loop that is in play in run or edit modes. 

I’ve not done much with multiple card stacks and never used modes before. So, I 
have two questions:

1. What’s the syntax needed to open the script of an un-open object via the 
message box, so I can break out of this loop?
2. Can anyone please suggest a worked example or lesson of a pop-up web service 
login dialogue, as I’m clearly doing something basic wrong!

Thanks & regards,
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


Re: Browser widget - follow redirects setting?

2022-01-27 Thread Keith Clarke via use-livecode
Hi Matthias,
Thanks for your response and experiment.

Unfortunately, I get the same experience with 'launch URL in...' and 'set the 
URL of…’ widget “Browser”

I think it might be my URL. I’m trying to access the Salesforce OAuth 2.0 User 
Agent flow via the browser, as I can’t get the OAuth library to work for this 
flow.

Maybe I’ll try dipping my to into tsnet, as that looks like it may have the 
comparative mechanisms to replicate a recipe I have working from PHP.

Thanks and regards,
Keith   

> On 26 Jan 2022, at 13:27, matthias rebbe via use-livecode 
>  wrote:
> 
> Keith,
> 
> what happens, if you set the URL of the browser widget to tURL?
> 
> I tried here both "set the url..." and also "launch URL ... in widget.." with 
> an online Shop. I tried to launch the account page. In both cases i was 
> redirected to the login page.
> The only thing i noticed is, that the URL of the widget kept to be the URL of 
> the account page although  the login page was opened/displayed.
> 
> Regards,
> Matthias
> 
>> Am 26.01.2022 um 12:24 schrieb Keith Clarke via use-livecode 
>> :
>> 
>> Hi folks,
>> Is there any hidden / undocumented setting for the Browser widget that will 
>> allow it to follow redirects?
>> 
>> Using launch URL tURL opens the default browser on my machine and - if I’m 
>> not logged into the server - redirects to a login page, the address of which 
>> I can see in the browser’s address bar.
>> 
>> However, launch URL tURL in widget "Browser” doesn’t redirect and 
>> subsequently put the URL of widget  “Browser" shows tURL unchanged.
>> 
>> Am I missing a trick?
>> 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


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


Browser widget - follow redirects setting?

2022-01-26 Thread Keith Clarke via use-livecode
Hi folks,
Is there any hidden / undocumented setting for the Browser widget that will 
allow it to follow redirects?

Using launch URL tURL opens the default browser on my machine and - if I’m not 
logged into the server - redirects to a login page, the address of which I can 
see in the browser’s address bar.

However, launch URL tURL in widget "Browser” doesn’t redirect and subsequently 
put the URL of widget  “Browser" shows tURL unchanged.

Am I missing a trick?
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


PDW widget: get the rect of the hilitedRange

2022-01-10 Thread Keith Clarke via use-livecode
Hi folks,
Please can anyone advise how to get the rendered rectangle of highlighted text 
in the PDF widget…?

I can successfully get the first word from the page text using something like:
put pPageNum into tHilitedArray["from"]["page”] // = 1

put pPageNum into tHilitedArray["to"]["page”] // = 1
put the length of word tWordNum of pPageText into tWordLength // = ‘3’ as the 
word is “the"

put tWordIndex into tHilitedArray["from"]["index”] // = 1

put tWordIndex + tWordLength -1 into tHilitedArray["to"]["index”] // = 3
set the hilitedRange of control "PDF1" to tHilitedArray

put the hilitedRangeText of control "PDF1" into tText // = “the"


However, when I attempt to get the rendered rect of this word, to compare with 
namedDestinations in the page ... 
put the rectangle of the hilitedRange of control "PDF1" into tRect // returns 
(Chunk: error in object expression) near “the”...

I’ve tried using the hilitedRangeText but get similar errors. 
Any clues?
TIA
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


Re: PDF Viewer widget: expected experience from set the currentDestination?

2022-01-05 Thread Keith Clarke via use-livecode
I’m still struggling to find the Rosetta Stone for the PDF widget that connects 
the page & rect of any currentDestination with its link text on that page of 
the PDF, to enable recreation with scripting of the links that one sees 
out-of-the-box in PDF viewers such as Preview or Adobe.

I must have missed something as it would appear that the metadata peters out 
after one has established that a page ’n’ in the PDF document contains:
- via currentDestinations: none to maybe a few dozen links, each with part of 
an ‘href’ and it’s rect top-left corner defined, but no label text or page text 
start & end offsets;
- via hilitedRangeText: a chunk of plain text with no html or other ‘markup’ 
hints at what might constitute link text;
- ...and never the twain shall meet. 

If this is really the state of the art with the widget and its wrapping of 
PDFium, I can’t see how it can be scripted to work - so I think I’ll need to 
start looking elsewhere, outside of LC for a mechanism to access PDF text & 
links.

Please tell me I’m wrong and am missing something obvious?
Best,
Keith
 
> On 23 Dec 2021, at 09:13, Keith Clarke via use-livecode 
>  wrote:
> 
> Thanks Monte - that code sorts the *calling* end of the recipe and the widget 
> changes page to the one containing the currentDestination.
> 
> However, what about the *receiving* end of the recipe? Nothing seems to be 
> happening upon arrival at the page to get any closer to this particular 
> destination amongst the many on the same page. 
> 
> Where should one look to understand the options and handlers for the specific 
> destination upon arrival *after* the change of page, re scroll into view, 
> zoom, focus, setting the associated hilited text, etc?
> 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


Re: PDF Viewer widget: expected experience from set the currentDestination?

2021-12-23 Thread Keith Clarke via use-livecode
Thanks Monte - that code sorts the *calling* end of the recipe and the widget 
changes page to the one containing the currentDestination.

However, what about the *receiving* end of the recipe? Nothing seems to be 
happening upon arrival at the page to get any closer to this particular 
destination amongst the many on the same page. 

Where should one look to understand the options and handlers for the specific 
destination upon arrival *after* the change of page, re scroll into view, zoom, 
focus, setting the associated hilited text, etc?
Best,
Keith 

> On 23 Dec 2021, at 03:53, Monte Goulding via use-livecode 
>  wrote:
> 
> Hi Keith
> 
> Yes it does look like the currentDestination docs leaves a lot to be desired. 
> I think there’s a couple of missing related items which is making the 
> document display incorrectly. I’ve created an issue for that here 
> https://quality.livecode.com/show_bug.cgi?id=23493
> 
> Here’s a simple example of using the currentDestination though:
> 
> local tDest
> put "goto" into tDest["type”]
> put "Fit" into tDest["mode”]
> put 3 into tDest["page”]
> set the currentDestination of widget “pdf" to tDest
> 
> Cheers
> 
> Monte
> 
>> On 23 Dec 2021, at 4:24 am, Keith Clarke via use-livecode 
>>  wrote:
>> 
>> Hi folks,
>> Please can anyone share the response/experience to be expected in the PDF 
>> Viewer widget after a successful call to set the currentDestination?
>> 
>> I have the widget successfully changing currentPage when set but I was 
>> hoping to see some visual feedback with on a change of currentDestination - 
>> to perhaps highlight something or zoom or scroll the named destination into 
>> focus? 
>> 
>> Unfortunately, the dictionary entry for currentDestination doesn’t help as 
>> it has no examples and the description of as it seems to be missing chunks 
>> of critical text regarding the ‘receive’ end of the message... 
>> 
>> "This is the format that is sent as a parameter in the message and is used 
>> by the  and  and properties for goto type destinations:...”
>> 
>> Perhaps I’ve missed some settings on the widget to allow it to respond to 
>> this message?
>> TIA
>> 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


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


PDF Viewer widget: expected experience from set the currentDestination?

2021-12-22 Thread Keith Clarke via use-livecode
Hi folks,
Please can anyone share the response/experience to be expected in the PDF 
Viewer widget after a successful call to set the currentDestination?

I have the widget successfully changing currentPage when set but I was hoping 
to see some visual feedback with on a change of currentDestination - to perhaps 
highlight something or zoom or scroll the named destination into focus? 

Unfortunately, the dictionary entry for currentDestination doesn’t help as it 
has no examples and the description of as it seems to be missing chunks of 
critical text regarding the ‘receive’ end of the message... 

"This is the format that is sent as a parameter in the message and is used by 
the  and  and properties for goto type destinations:...”

Perhaps I’ve missed some settings on the widget to allow it to respond to this 
message?
TIA
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


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

2021-12-21 Thread Keith Clarke via use-livecode
Ah, yes of course - split a list variable with comma to form an array, being 
the inverse of combine tArray with comma to create a list. 

"The Worm is the Spice! The Spice is the Worm!” - the Dune weird array thing! 

Thank you, Alex - another synapse is ignited by the enlightenment… for a while, 
anyway! :D
Best,
Keith

> On 21 Dec 2021, at 17:33, Alex Tweedly via use-livecode 
>  wrote:
> 
> 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
&g

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

2021-12-21 Thread Keith Clarke via use-livecode
Thanks for the response & resource link, Brian - much appreciated.

It’s good to know that I wasn’t barking up the wrong tree (view!), regarding 
the need to handle the returned hilitedElement array comma-delimited keys list.

I’m new to arrays (and indeed most development concepts), so it was a good 
learning experience to try to work this out - though the documentation for 
arrays could be more helpful regarding syntax and passing in variables, as much 
trial and error was needed.

I like the mechanism you’ve used for generalising the array key to be 
independent of tree node depth - consider that learned and reused! :)
Best,
Keith  

> On 21 Dec 2021, at 15:19, Brian Milby via use-livecode 
> mailto:use-livecode@lists.runrev.com>> 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
___
use-livecode mailing list
use-livecode@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 Keith Clarke via use-livecode
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:
>> 
>> I'm confused about what the goal is. The hilitedElement contains the text of 
>> the selection. The array is already in place, so you don't really need to 
>> add to it.
>> 
>> The reason you're seeing text in the message box is because the last line 
>> contains an unspecified "put". Without a destination for the "put" it will 
>> go automatically to the message box. If you want to work with it, you'd need 
>> to put the value into a variable.
>> 
>> What's the purpose of the concatenation, and what do you want to do with the 
>> selection?
>> 
>> On 12/20/21 11:11 AM, Keith Clarke via use-livecode wrote:
>>> Hi folks,
>>> I’m struggling to access the value from a Tree View widget’s data array as 
>>> the hilitedElement changes - though I think my issue is more about working 
>>> with arrays than the Tree View widget.
>>> The following test script (on the Tree widget) successfully gets the Tree’s 
>>> arrayData into tTreeData and creates a ‘correct-looking’ nested array key 
>>> syntax for any changing tHilitedElement.
>>> However, the last line displays the tHilitedElement variable string in the 
>>> message box rather than concatenating it to tTreeData as the nested key to 
>>> return the element’s value.
>>> on hiliteChanged
>>> put the hilitedElement of me into tHilitedElement
>>> if char -1 of tHilitedElement is comma then delete char -1 of 
>>> tHilitedElement
>>> replace comma with quote & "][" & quote in tHilitedElement
>>> put "[" & quote before tHilitedElement

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

2021-12-20 Thread Keith Clarke via use-livecode
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:
> 
> I'm confused about what the goal is. The hilitedElement contains the text of 
> the selection. The array is already in place, so you don't really need to add 
> to it.
> 
> The reason you're seeing text in the message box is because the last line 
> contains an unspecified "put". Without a destination for the "put" it will go 
> automatically to the message box. If you want to work with it, you'd need to 
> put the value into a variable.
> 
> What's the purpose of the concatenation, and what do you want to do with the 
> selection?
> 
> On 12/20/21 11:11 AM, Keith Clarke via use-livecode wrote:
>> Hi folks,
>> I’m struggling to access the value from a Tree View widget’s data array as 
>> the hilitedElement changes - though I think my issue is more about working 
>> with arrays than the Tree View widget.
>> The following test script (on the Tree widget) successfully gets the Tree’s 
>> arrayData into tTreeData and creates a ‘correct-looking’ nested array key 
>> syntax for any changing tHilitedElement.
>> However, the last line displays the tHilitedElement variable string in the 
>> message box rather than concatenating it to tTreeData as the nested key to 
>> return the element’s value.
>> on hiliteChanged
>> put the hilitedElement of me into tHilitedElement
>> if char -1 of tHilitedElement is comma then delete char -1 of tHilitedElement
>> replace comma with quote & "][" & quote in tHilitedElement
>> put "[" & quote before tHilitedElement
>> put quote & "]" after tHilitedElement
>> put the arrayData of me into tTreeData
>> put tTreeData & tHilitedElement
>> end hiliteChanged
>> I’ve tried various forms of brackets around the tHilitedElement variable 
>> containing the nested key string with no success - what am I doing wrong?
>> TIA.
>> 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
> 
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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


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

2021-12-20 Thread Keith Clarke via use-livecode
Hi folks,
I’m struggling to access the value from a Tree View widget’s data array as the 
hilitedElement changes - though I think my issue is more about working with 
arrays than the Tree View widget.

The following test script (on the Tree widget) successfully gets the Tree’s 
arrayData into tTreeData and creates a ‘correct-looking’ nested array key 
syntax for any changing tHilitedElement. 

However, the last line displays the tHilitedElement variable string in the 
message box rather than concatenating it to tTreeData as the nested key to 
return the element’s value.

on hiliteChanged

put the hilitedElement of me into tHilitedElement

if char -1 of tHilitedElement is comma then delete char -1 of tHilitedElement

replace comma with quote & "][" & quote in tHilitedElement

put "[" & quote before tHilitedElement

put quote & "]" after tHilitedElement

put the arrayData of me into tTreeData

put tTreeData & tHilitedElement

end hiliteChanged

I’ve tried various forms of brackets around the tHilitedElement variable 
containing the nested key string with no success - what am I doing wrong?

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


Re: PDF Viewer widget - how to enable interaction?

2021-12-09 Thread Keith Clarke via use-livecode
Thanks Monte. 

I should have been more explicit in that I’d tried that technique to handle the 
linkClicked message - none of the links in my test PDFs (that work in Preview 
and Adobe) fire it.

Assuming I’ve not missed any widget properties, it looks like there’s a problem 
with the underlying PDFium library not finding ‘clickables’ in the PDF 
documents - or the LC wrapping has a bug...

If navigation is under script control the documentation suggests that every 
‘clickable’ that works in any PDF viewer would need to be extracted into either 
the documentBookmarks or documentNamedDestinations arrays to be accessible for 
scripting - and both are empty for my ‘link-rich’ test PDFs.

Maybe the premium subscription for this widget means that it’s not been 
accessible for beta-testing by the user community, as I see nothing in the QA 
centre. 
Best,
Keith  

> On 9 Dec 2021, at 02:43, Monte Goulding via use-livecode 
>  wrote:
> 
> Hi Keith
> 
> I think you want the `linkClicked` message. Navigation via links is under 
> script control so possibly what you want is:
> 
> on linkClicked pAction
>   if pAction[“type”] is “goto” then
>   set the currentDestination of me to pAction
>   end if
> end linkClicked
> 
>> On 9 Dec 2021, at 2:01 am, Keith Clarke via use-livecode 
>>  wrote:
>> 
>> Hi folks,
>> Can anyone share any experiences with the PDF Viewer widget that’s available 
>> via the old Business Edition or Pro Pack subscription?
>> 
>> I’m testing this on LC 9.6.5 with a Pro subscription on Mac 11.6. Following 
>> the PDF guide https://livecode.com/resources/guide/ I’ve been able to load 
>> various PDF documents into the viewer widget and view, paginate, scroll, 
>> etc. I can select text, as per the example code in the guide and this 
>> ability to select toggles with the autoHighlight property on the widget - as 
>> expected. However, I’m struggling to get much else.
>> 
>> The widget seems to be rendering the PDF documents in a passive ‘preview’ 
>> mode, in that they seem to lack any of the interactive behaviour available 
>> when opened in Preview or Adobe reader. There are no hovers or navigation on 
>> obvious links or bookmarks. Furthermore, other than documentPages and 
>> documentMetadata, all of the arrays that should handle these navigation 
>> elements are empty - documentBookmarks, documentNamedDestination, linkStyles.
>> 
>> Maybe I’ve missed another property that needs to be set to enable 
>> interaction? I don’t see any obvious setting to change in the dictionary, 
>> the LC guide doc, LC forums or online sources of documentation.
>> 
>> Any clues gratefully received...
>> 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


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


Re: JSON to Datagrid

2021-12-08 Thread Keith Clarke via use-livecode
Hi Skip,
I don’t use Datagrids but have used a two-step process to get JSON into the 
Tree widget and a similar process may provide a direction of travel to test…?

1. JSON-to-array 
https://lessons.livecode.com/m/4071/l/1303394-how-to-read-in-data-from-a-json-file
 
2. Setting the array data of datagrid…

Good luck.
Best,
Keith

> On 8 Dec 2021, at 16:15, Skip Kimpel via use-livecode 
>  wrote:
> 
> I have been googling a solution for this but have not found a solid
> solution for this.
> 
> Can anybody lead me in the right direction on this?
> 
> SKIP
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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


PDF Viewer widget - how to enable interaction?

2021-12-08 Thread Keith Clarke via use-livecode
Hi folks,
Can anyone share any experiences with the PDF Viewer widget that’s available 
via the old Business Edition or Pro Pack subscription?

I’m testing this on LC 9.6.5 with a Pro subscription on Mac 11.6. Following the 
PDF guide https://livecode.com/resources/guide/ I’ve been able to load various 
PDF documents into the viewer widget and view, paginate, scroll, etc. I can 
select text, as per the example code in the guide and this ability to select 
toggles with the autoHighlight property on the widget - as expected. However, 
I’m struggling to get much else.

The widget seems to be rendering the PDF documents in a passive ‘preview’ mode, 
in that they seem to lack any of the interactive behaviour available when 
opened in Preview or Adobe reader. There are no hovers or navigation on obvious 
links or bookmarks. Furthermore, other than documentPages and documentMetadata, 
all of the arrays that should handle these navigation elements are empty - 
documentBookmarks, documentNamedDestination, linkStyles.

Maybe I’ve missed another property that needs to be set to enable interaction? 
I don’t see any obvious setting to change in the dictionary, the LC guide doc, 
LC forums or online sources of documentation.

Any clues gratefully received...
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


Re: Suggestion: Non-Appbuilding Community Edition

2021-09-02 Thread Keith Clarke via use-livecode
I came to Livecode from lightweight website hackery - cobbling together HTML & 
CSS as a non-coder (using W3schools guidance for every live of javascript). I 
was (and still am) relieved by the higher-level English-like language of 
Livecode. 

None of the (dozens of) utilities I’ve created for my personal & small business 
use have ever needed to move beyond the IDE - or a single card for that matter. 
The Livecode IDE has become a personal toolbelt item for me.

If the Livecode team can keep this ‘personal toolbelt’ IDE concept available to 
students for free (and home users for little) - the way Microsoft does with 
Office - could bring through the next generation of paying developers. But one 
doesn’t reach the long-term without passing through the short-term. So, 
meanwhile, they need to do what they must to keep the ship afloat and the crew 
inspired.

Just my tuppence-worth.
Best,
Keith   

> On 2 Sep 2021, at 15:50, Roger Guay via use-livecode 
>  wrote:
> 
> Sounds like a very cool idea to me, but I’m sure it’s complicated! I trust LC 
> to do what’s best for its future.
> 
> Roger
> 
> 
>> On Sep 2, 2021, at 7:34 AM, Keith Martin via use-livecode 
>>  wrote:
>> 
>> I think this is (potentially) an excellent idea. Running stacks is more 
>> important in education use than building standalones, and the knowledge that 
>> a standalone CAN be made by simply ’trading up’ to a paid-for version of LC 
>> might be an interesting sell. But I would be surprised if this sort of thing 
>> hasn’t already been considered.
>> 
>> k
>> 
>> 
>>> On 2 Sep 2021, at 15:20, Ralph DiMola via use-livecode 
>>>  wrote:
>>> 
>>> This is a good idea. I sometimes use the IDE to do a quickie text
>>> manipulation task. A couple of buttons and some text file/db processing and
>>> BOOM! It's done in the fraction of the time of other languages. I have now
>>> done some text chunk coding that highlights many of LCs features. I can now
>>> buy a platform or two If I want to expand the IDE to building distributable
>>> apps.
>>> 
>>> 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 Michael Kristensen via use-livecode
>>> Sent: Thursday, September 02, 2021 9:50 AM
>>> To: use-livecode@lists.runrev.com
>>> Cc: Michael Kristensen
>>> Subject: Suggestion: Non-Appbuilding Community Edition
>>> 
>>> Hi there
>>> 
>>> I suggest that there could be a Non-Appbuilding Community Edition
>>> 
>>> That would be for personal use, and to learn coding.
>>> 
>>> Michael
>>> 
>>> ___
>>> use-livecode mailing list
>>> use-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: Text encoding.

2021-09-02 Thread Keith Clarke via use-livecode
I may be wrong but I thought Mac’s ‘Plain Text’ just meant it’s a ‘text.txt’ 
MIME type file, which could be encoded as ASCII, UTF-8, UTF-16 or UTF-32, 
rather than a 'text.rtf’ rich text MIME type file, with the embedded markup for 
styling, such as bold, italic, etc.

The '’ at the start of the document is the Byte Order Mark, suggesting 
UTF-16 in ‘little-endian’ order - see 
https://en.wikipedia.org/wiki/Byte_order_mark

HTH
Best,
Keith

> On 2 Sep 2021, at 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".
> 
> 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


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


Re: Storing json - mergeJSON, textdecode and "\u00a0”

2021-08-26 Thread Keith Clarke via use-livecode
Not sure if it’s related but I had issues recently with processing JSON on Mac 
with PHP and attempts to force encoding/decoding of the JSON didn’t work. 

It was an encoding issue caused by the JSON strings being served into HTML 
pages that lacked an explicit UTF-8 tag. Adding '> replace "\u00a0” with empty in rJSON
> 
> While this is fixing the cases I have so far - I am not sure what the 
> underlying encoding issue is here. Its a unicode non-breaking-space - 
> https://www.fileformat.info/info/unicode/char/00a0/index.htm but I’m not sure 
> about the encoding and whether its valid utf8?
> 
> Bit stuck any thoughts?
> 
> Schedule a call with me
> On 15 Aug 2021, 11:46 +0100, David Bovill , wrote:
>> I’ve been historically a bit lazy in taking care of how I store json data - 
>> so mostly it works but some times I get a different result on the server 
>> than I do locally on OSX. I suspect this is due to encoding differences in 
>> how the data is stored and which characters are in the json. I’d like to 
>> standardise on utf8 encoded json as my text storage of choice, and use a 
>> standard way to store this while in Livecode I parse the json and just deal 
>> with arrays.
>> 
>> As I understand it I should really be using textEncode and textDecode() - 
>> and I should store the utf8 encoded json files using “binfile:” not “file:” 
>> - however this is not what the dictionary entry fo textEncode() illustrates:
>>> quote_type
>>> put textEncode(field "output","UTF-8") into tOutput
>>> put tOutput into url ("file:output.txt")
>> 
>> So if I want to implement best practice in storing utf8 encoded json locally 
>> on Mac, on mobile and on unix servers according to:
>>> quote_type
>>> The textEncode function takes text, and returns it as binary data, encoded 
>>> with the specified encoding.
>>> It is highly recommended that any time you interface with things outside 
>>> LiveCode (files, network sockets, processes, etc) that you explicitly 
>>> textEncode any text you send outside LiveCode and textDecode all text 
>>> received into LiveCode. If this doesnt happen, a platform-dependent 
>>> encoding will be used (which normally does not support Unicode text).
>> 
>> How should I do that? Should I not do something like this (in pseudocode):
>>> quote_type
>>> function fetchFromUrl jsonURL
>>>   put url someURL into utf8JSON
>>>   put textDecode(jsonURL, "UTF-8") into encodedJSON
>>>   put json_ToArray (encodedJSON) into someArray
>>>   return someArray
>>> end fetchFromUrl
>>> 
>>> command exportToUrl someArray, jsonURL
>>>   put json_FromArray (someArray) into encodedJSON
>>>   put textEncode(encodedJSON, "UTF-8") into decodedJSON
>>>   put decodedJSON into url someURL
>>> end exportToUrl
>> 
>> And. If so - should I be using “binfile:” or “file:” for writing to the file 
>> system?
>> 
>> Schedule a call with me
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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


Re: How to scale the content of the Browser Widget

2021-07-14 Thread Keith Clarke via use-livecode
An idea extending Ralph's suggestion to use html, along with styling to do the 
heavy lifting rather than JavaScript. A div with a background image might do 
the trick...

Image title
 

...where:
... 'vh' is viewport height units (as percentage) and '2rem' leaves some space 
for the image title, (expressed as font size relative to that in the html root 
element).

...background provides for background images, and size as 'cover' fill the 
containing div (with some scaling in one dimension that affects aspect ratio) - 
so use 'contain' if you want the image to be as large as possible with its 
aspect ratio left intact. See help for this background shorthand styling 
examples and related information here 
https://www.w3schools.com/css/css_background_shorthand.asp

HTH
Keith 

> On 13 Jul 2021, at 22:24, Ralph DiMola via use-livecode 
>  wrote:
> 
> One way...
> Create a local html template and replace an href place holder in the
> template to the url of the web server image.
> Then load the template page into the browser widget and let html do the
> resizing heavy lifting. This will not break cors.
> 
> 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 matthias rebbe via use-livecode
> Sent: Tuesday, July 13, 2021 5:00 PM
> To: How to use LiveCode
> Cc: matthias_livecode_150...@m-r-d.de
> Subject: How to scale the content of the Browser Widget
> 
> Hi,
> 
> i need to display jpeg images in the browser widget. The images are stored
> on a webserver and i  have no control about the size of the images. 
> What i can say is that the images are larger than the browser widget area.
> Is there a way to scale the images so they are fully visible in the browser
> widget? 
> I do not want to temporarily store them on hard disk, resize them and then
> display.
> I need something like an "on the fly" scaling.  
> I am wondering if this might be possible with Javascript? Unfortunately i am
> not very used Javascript.
> 
> Does anyone know if this is possible?
> 
> Regards,
> 
> Matthias
> 
> 
> ___
> use-livecode mailing list
> use-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: Browser Widget Issue

2021-05-25 Thread Keith Clarke via use-livecode
Hi David,
Pass on the framework, but regarding the page…

FWIW from the message box, I was able to set the url of widget ‘Browser’ to 
"https://obs.ninja” (apparently empty...) but then put the htmltext of widget 
“Browser” to see that there is indeed some content. 

So, it’s not scripting itself to hide and there’s some content & potential to 
investigate why it’s rendering as 'white on white'. However, only inline 
styling is available as AFAIK there’s no dev tools nor access to any downloaded 
css files, wherever resources might get cached by the LC browser widget…?

Good luck,
Keith 

> On 25 May 2021, at 17:53, David Bovill via use-livecode 
>  wrote:
> 
> I’m having trouble keeping track of which framework the browser widget uses - 
> on MacOS is it using webkit or Chromium?
> 
> A url I am trying to access is blank - https://obs.ninja  - while it is 
> showing in Safari and Chrome on the desktop - any suggestions?
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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


Re: Spurious characters from html files - text encoding issues?

2021-05-21 Thread Keith Clarke via use-livecode
Hi Ben,
Thanks for the further details and tips - my problem is now solved! 

The BBedit tip re file 'open-as UTF-8' was a great help. I’d not noticed these 
options before (as I tend to open files from PathFinder folder lists not via 
apps). However, this did indeed reveal format errors on these cache files when 
they were saved with the raw (UTF-8 confirmed) htmltext of widget “browser”. 
Text encoding to UTF-8 before saving fixed this issue and re-crawling the 
source pages has resulted in files that BBEdit recognises as ‘regular’ UTF-8.

This reduced the anomaly count but whilst testing, I also noticed that the 
read-write cycle updating the output csv file was spawning anomalies and 
expanding those already present. So I wrapped this function to also force UTF-8 
decoding/encoding - and now all is now good.

No longer will I assume that a simple text file is a simple text file! :-)

Thanks & regards,
Keith 

> On 19 May 2021, at 19:01, Ben Rubinstein via use-livecode 
>  wrote:
> 
> Hi Keith,
> 
> This might need input from the mothership, but I think if you've obtained the 
> text from the browser widget's htmlText, it will probably be in the special 
> 'internal' format. I'm not entirely sure what happens when you save that as 
> text - I suspect it depends on the platform.
> 
> So for clarity (if you have the opportunity to re-save this material; and if 
> it won't confuse things because existing files are in one format, and new 
> ones another) it would probably be best to textEncode it into UTF-8, then 
> save it as binfile. That way the files on disk should be UTF-8, which is 
> something like a standard.
> 
> What I tend to do in this situation where I have text files and I'm not sure 
> what the format is (and I spend quite a lot of time messing with text files 
> from various sources, some unknown and many not under my control) is use a 
> good text editor - I use BBedit on Mac, not sure what suitable alternatives 
> would be on Windows or Linux - to investigate the file. BBEdit makes a guess 
> when it opens the file, but allows you to try re-opening in different 
> encodings, and then warns you if there are byte sequences that don't make 
> sense with that encoding. So by doing this I can often figure out what the 
> encoding of the file is - once you've got that, you're off to the races.
> 
> But if you have the opportunity to re-collect the whole set, then I *think* 
> the above formula of textEncoding from LC's internal format to UTF-8, then 
> saving as binary file; and reversing the process when you load them back in 
> to process; and then doing the same again - possibly to a different format - 
> when you output the CSV, should see you clear.
> 
> HTH,
> 
> Ben
> 
> 
> On 17/05/2021 15:58, Keith Clarke via use-livecode wrote:
>> Thanks Ben, that’s really interesting. It never occurred to me that these 
>> html files might be anything other than simple plain text files, as I’d work 
>> with in Coda, etc., for years.
>> The local HTML files are storage of the HTML text pulled from the LiveCode 
>> browser widget, saved using the URL ‘file:’ option. I’d been working ‘live’ 
>> from the Browser widget’s html text until recently, when I’ve introduced 
>> these local files to split page ‘crawling’ and analysis activities without 
>> needing a database.
>> Reading the files back into LiveCode with the URL ‘file:’ option works quite 
>> happily with no text anomalies when put into a field to read. The problem 
>> seems to arise when I load the HTML text into a variable and then start to 
>> extract elements using LiveCode's text chunking. For example pulling the 
>> text between the offsets of say  &  tags is when these character 
>> anomalies have started to pop into the strings.
>> A quick test on reading in the local HTML files with the URL ‘binfile:’ 
>> option and then textDecode(tString, “UTF-8”) seems to reduce the frequency 
>> and size of anomalies, but some remain. So, I’ll see if re-crawling pages 
>> and saving the HTML text from the browser widget as binfiles reduces this 
>> further.
>> Thanks & regards,
>> Keith
>>> On 17 May 2021, at 12:57, Ben Rubinstein via use-livecode 
>>>  wrote:
>>> 
>>> Hi Keith,
>>> 
>>> The thing with character encoding is that you always need to know where 
>>> it's coming from and where it's going.
>>> 
>>> Do you know how the HTML documents were obtained? Saved from a browser, 
>>> fetched by curl, fetched by Livecode? Or generated on disk by something 
>>> else?
>>> 
>>> If it was saved from a browser or fetched by curl, then the format is most 
>>> likely to be UTF

Re: Spurious characters from html files - text encoding issues?

2021-05-17 Thread Keith Clarke via use-livecode
Thanks Ben, that’s really interesting. It never occurred to me that these html 
files might be anything other than simple plain text files, as I’d work with in 
Coda, etc., for years. 

The local HTML files are storage of the HTML text pulled from the LiveCode 
browser widget, saved using the URL ‘file:’ option. I’d been working ‘live’ 
from the Browser widget’s html text until recently, when I’ve introduced these 
local files to split page ‘crawling’ and analysis activities without needing a 
database. 

Reading the files back into LiveCode with the URL ‘file:’ option works quite 
happily with no text anomalies when put into a field to read. The problem seems 
to arise when I load the HTML text into a variable and then start to extract 
elements using LiveCode's text chunking. For example pulling the text between 
the offsets of say  &  tags is when these character anomalies have 
started to pop into the strings.

A quick test on reading in the local HTML files with the URL ‘binfile:’ option 
and then textDecode(tString, “UTF-8”) seems to reduce the frequency and size of 
anomalies, but some remain. So, I’ll see if re-crawling pages and saving the 
HTML text from the browser widget as binfiles reduces this further.
Thanks & regards,
Keith  

> On 17 May 2021, at 12:57, Ben Rubinstein via use-livecode 
>  wrote:
> 
> Hi Keith,
> 
> The thing with character encoding is that you always need to know where it's 
> coming from and where it's going.
> 
> Do you know how the HTML documents were obtained? Saved from a browser, 
> fetched by curl, fetched by Livecode? Or generated on disk by something else?
> 
> If it was saved from a browser or fetched by curl, then the format is most 
> likely to be UTF-8. In order to see it correctly in LiveCode, you'd need to 
> two things:
>   - read it in as a binary file, rather than text (e.g. use URL 
> "binfile://..." or "open file ... for binary read")
>   - convert it to the internal text format FROM UTF-8 - which means use 
> textDecode(tString, "UTF-8"), rather than textEncode
> 
> If it was fetched by LiveCode, then it most likely arrived over the wire as 
> UTF-8, but if it was saved by LiveCode as text (not binary) then it _may_ 
> have got corrupted.
> 
> If you can see the text looking as you expect in LiveCode, you've solved half 
> the problem. Then you need to consider where it's going: who (that) is going 
> to consume the CSV. This is the time to use textEncode, and then be sure to 
> save it as a binary file. If the consumer will be something reasonably 
> modern, then again UTF-8 is a good default. If it's something much older, you 
> might need to use "CP1252" or similar.
> 
> HTH,
> 
> Ben
> 
> 
> On 17/05/2021 09:28, Keith Clarke via use-livecode wrote:
>> Hi folks,
>> I’m using LiveCode to summarise text from HTML documents into csv summary 
>> files and am noticing that when I extract strings from html documents stored 
>> on disk - rather than visiting the sites via the browser widget & grabbing 
>> the HTML text - weird characters being inserted in place of what appear to 
>> be ‘regular’ characters.
>> The number of characters inserted can run into the thousands per instance, 
>> making my csv ‘summary’ file run into gigabytes! Has anyone seen the 
>> following type of string before, happen to know what might be causing it and 
>> offer a fix?
>> ‚Äö
>> I’ve tried deliberately setting UTF-8 on the extracted strings, with put 
>> textEncode(tString, "UTF-8") into tString. Currently I’m not attempting to 
>> force any text format on the local HTML documents.
>> Thanks & regards,
>> 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


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


Spurious characters from html files - text encoding issues?

2021-05-17 Thread Keith Clarke via use-livecode
Hi folks,
I’m using LiveCode to summarise text from HTML documents into csv summary files 
and am noticing that when I extract strings from html documents stored on disk 
- rather than visiting the sites via the browser widget & grabbing the HTML 
text - weird characters being inserted in place of what appear to be ‘regular’ 
characters.

The number of characters inserted can run into the thousands per instance, 
making my csv ‘summary’ file run into gigabytes! Has anyone seen the following 
type of string before, happen to know what might be causing it and offer a fix? 
‚Äö

I’ve tried deliberately setting UTF-8 on the extracted strings, with put 
textEncode(tString, "UTF-8") into tString. Currently I’m not attempting to 
force any text format on the local HTML documents.

Thanks & regards,
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


Re: use-livecode Digest, Vol 212, Issue 13

2021-05-11 Thread Keith Clarke via use-livecode
I will do when I attempt to climb that new learning curve!
Best,
Keith 

> On 12 May 2021, at 06:17, Brian K. Duck via use-livecode 
>  wrote:
> 
> Can you share more about your standalone settings to make this happen?
> 
> Sent from my iPad,
> Brian
> 
>> On May 11, 2021, at 12:03 PM, use-livecode-requ...@lists.runrev.com wrote:
>> 
>> I’ll be glad when I finish the project and can deploy it to a standalone 
>> that run on a dedicated Raspberry pi without all the ?helpful? 
>> infrastructure! 
>> 
>> Thanks all for the help.
>> 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: LiveCode convert seconds to dateItems - year is out by 19?

2021-05-11 Thread Keith Clarke via use-livecode
According to the Dictionary "LiveCode uses midnight, January 1, 1970 as the 
start of the eon. Date and time functions are computed from that date.” This is 
the same as MacOs, according to fandom "The epoch of Mac OS X 
<https://apple.fandom.com/wiki/Mac_OS_X>, macOS 
<https://apple.fandom.com/wiki/MacOS>, and most Unix 
<https://apple.fandom.com/wiki/Unix>-based systems begins at midnight on 
January 1, 1970 <https://apple.fandom.com/wiki/1970>."

This got me thinking - that this project's files may be on my Mac but courtesy 
of our work Google Drive via Google FileStream. And according to the wires, 
FileStream does strange things with creation date on hosting systems. So, I 
moved the project folder structure from to my Mac’s Documents folder area 
(ironically, also backed up - this time to iCloud) and everything is working!

I’ll be glad when I finish the project and can deploy it to a standalone that 
run on a dedicated Raspberry pi without all the ‘helpful’ infrastructure! 

Thanks all for the help.
Best,
Keith 

> On 11 May 2021, at 14:58, Terence Heaford via use-livecode 
>  wrote:
> 
> Could it be something to do with the base date on the mac vs the base date of 
> live code?
> 
> I believe the base date on a mac is 1970, not sure what it is in live code?
> 
> Terry
> 
>> On 11 May 2021, at 13:59, Keith Clarke via use-livecode 
>>  wrote:
>> 
>> Thanks Martin & Alex,
>> 
>> I wasn’t aware of ‘the seconds’ - thanks that’s behaving correctly here. 
>> 
>> Tracing back from this date conversion being OK to the tCreateDate variable. 
>> This is item 4 of the long files, which according to the docs, should be 
>> Creation date, in seconds. 
>> 
>> Bypassing the conversion, this item is the same for all the files in my 
>> target folder (some created yesterday & some weeks ago). It has the value 
>> 2212122496, which LiveCode converts (reliably!) to 2040,2,6,6,28,16,2.
>> 
>> Printing out the long files for one of the files in the target folder shows… 
>> 
>> filename,2055,0,2212122496,1620675773,2212122496,0,501,20,600,ttxtTEXT
>> 
>> This same weird value is being returned for the Creation Date (item 4) & 
>> Last Access date (item 6), though the Last Modified Date (item 5) looks 
>> correct.
>> 
>> Any clues?   
>> Best,
>> Keith
>> 
>>> On 11 May 2021, at 13:09, Martin Koob via use-livecode 
>>>  wrote:
>>> 
>>> Hi Keith
>>> 
>>> I just tried the following
>>> 
>>> on mouseup
>>> 
>>> convert the seconds to dateitems
>>> 
>>> put it
>>> 
>>> end mouseup
>>> 
>>> The result is 2021,5,11,7,52,5,3  So that is correct.
>>> 
>>> Where is the value in your tCreateDate variable from.  Maybe there was a 
>>> miscalculation there.
>>> 
>>> Martin
>>> 
>>>> On May 11, 2021, at 6:44 AM, 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
>> 
>> 
>> ___
>> use-livecode mailing list
>> use-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 convert seconds to dateItems - year is out by 19?

2021-05-11 Thread Keith Clarke via use-livecode
Thanks Martin & Alex,

I wasn’t aware of ‘the seconds’ - thanks that’s behaving correctly here. 

Tracing back from this date conversion being OK to the tCreateDate variable. 
This is item 4 of the long files, which according to the docs, should be 
Creation date, in seconds. 

Bypassing the conversion, this item is the same for all the files in my target 
folder (some created yesterday & some weeks ago). It has the value 2212122496, 
which LiveCode converts (reliably!) to 2040,2,6,6,28,16,2.

Printing out the long files for one of the files in the target folder shows… 

filename,2055,0,2212122496,1620675773,2212122496,0,501,20,600,ttxtTEXT

This same weird value is being returned for the Creation Date (item 4) & Last 
Access date (item 6), though the Last Modified Date (item 5) looks correct.
 
Any clues?   
Best,
Keith

> On 11 May 2021, at 13:09, Martin Koob via use-livecode 
>  wrote:
> 
> Hi Keith
> 
> I just tried the following
> 
> on mouseup
> 
>   convert the seconds to dateitems
> 
>   put it
> 
> end mouseup
> 
> The result is 2021,5,11,7,52,5,3  So that is correct.
> 
> Where is the value in your tCreateDate variable from.  Maybe there was a 
> miscalculation there.
> 
> Martin
> 
>> On May 11, 2021, at 6:44 AM, 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


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


LiveCode convert seconds to dateItems - year is out by 19?

2021-05-11 Thread Keith Clarke via use-livecode
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


Re: Dynamic scripted nested array keys?

2021-04-24 Thread Keith Clarke via use-livecode
Thanks Brian this conversion to pPath to an array of keys hit the nail on the 
head.

So, for anyone else looking to show the (full non-truncated) content of a node 
in a read-only Tree widget in a tooltip, by clicking the actionInspect icon, is…
on actionInspect pPath

put the arrayData of widget "Tree" into aContent -- get the Tree's data

split pPath by comma -- convert pPath from list to an array of keys

set the tooltip of widget "Tree" to aContent[pPath] -- the current Tree node's 
content

end actionInspect


Thanks too Jaque, Paul, Bob & Henry for playing! :-) 
Best,
Keith  

> On 24 Apr 2021, at 14:31, Brian Milby via use-livecode 
>  wrote:
> 
> I guess I should reply to myself and say why this works.  At some point the
> feature was added that you could use an array as an index into an array.
> The format is a one based ordered array of keys.  So tPath[1] is the first
> level key, tPath[2] is the second level, etc.  If you wanted to get
> tTree["one"]["two"] then tPath[1]="one" and tPath[2]="two" so you could
> just get tTree[tPath].  Since comma is the default path delimiter (which
> can be changed), you can use split to turn a path list into a path array.
> 
> On Sat, Apr 24, 2021 at 9:26 AM Brian Milby  wrote:
> 
>> Easiest way is to use split...
>> 
>> Given a tree widget this will take a path from field 1 and put the value
>> at that path in field 2
>> 
>> on mouseUp pMouseButton
>>   local tTree, tLoc
>>   put the arrayData of widget 1 into tTree
>>   put field 1 into tLoc
>>   split tLoc by comma
>>   put tTree[tLoc] into field 2
>> end mouseUp
>> 
>> Thanks,
>> Brian
>> 
>> On Sat, Apr 24, 2021 at 9:06 AM Paul Dupuis via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>> 
>>> I have only partially been following this thread, but if you need to
>>> find the array 'content' in an arbitrary nested array from a comma
>>> delimited path of array keys, recursion is the way to do it:
>>> 
>>> function fetchArrayContentFromPath pArray,pPath
>>>   -- pArray is an array
>>>   -- pPath is a comma delimited 'path' of array keys to the desired
>>> content
>>>   local tKey
>>>   if pArray is not an array then
>>> return pArray -- I have reached the content, so return that content
>>>   else if pPath is empty then
>>> return pArray -- should not happen in a tree widget, but this is if
>>> the path ends in an array instead of the content of an array element
>>>   else
>>> put item 1 of pPath into tKey -- get the key of element in the
>>> currnet path
>>> delete item 1 of pPath-- remove it from the current path,
>>> so the path is the next set of key(s)
>>> return fetchArrayContentFromPath(pArray[tKey],pPath) - recursively
>>> fetch the remainig keys from the currnet array element
>>>   end if
>>> end fetchArrayContentFromPath
>>> 
>>> It will not matter is the 'path' is key1,key1 or
>>> key1,key2,key3,key4,key5,key6,key7, or whatever.
>>> 
>>> 
>>> On 4/24/2021 7:10 AM, Keith Clarke via use-livecode wrote:
>>>> Hi folks,
>>>> Inspired by Jaque’s (working - thank you!) response to my question
>>> “Show Tree widget row contents on hover” I’ve isolated the final piece of
>>> that puzzle that leaves me baffled.
>>>> 
>>>> Specifically, can LiveCode accept a dynamically built key for a nested
>>> multi-dimensional array? Copy the button script recipe below to see the
>>> problem.
>>>> 
>>>> Perhaps the LC array experts here can help explain why Jaque’s
>>> hard-wired key definition works but my attempts to replicate this syntax
>>> via scripting to support variable depth of arrays  get ignored? Is it my
>>> syntax or just the way arrays work in LC…?
>>>> on mouseUp pButtonNumber
>>>> 
>>>> # Create a nested array
>>>> 
>>>> put "Content" into tArray["key1"]["key2"]["key3"]["key4"]
>>>> 
>>>> 
>>>> # Replicate the path response from the Tree widget actionInspect
>>> function
>>>> 
>>>> put "key1,key2,key3,key4" into pPath
>>>> 
>>>> 
>>>> # Jaque's 'hard-wired' array key recipe works!
>>>> 
>>>> answer tArray[item 1 of pPath][item 2 of pPath][item 3 of pPath][item 4
>>> of pPath] --returns 'Content'
>>>

Dynamic scripted nested array keys?

2021-04-24 Thread Keith Clarke via use-livecode
Hi folks,
Inspired by Jaque’s (working - thank you!) response to my question “Show Tree 
widget row contents on hover” I’ve isolated the final piece of that puzzle that 
leaves me baffled.

Specifically, can LiveCode accept a dynamically built key for a nested 
multi-dimensional array? Copy the button script recipe below to see the problem.

Perhaps the LC array experts here can help explain why Jaque’s hard-wired key 
definition works but my attempts to replicate this syntax via scripting to 
support variable depth of arrays  get ignored? Is it my syntax or just the way 
arrays work in LC…?
on mouseUp pButtonNumber

# Create a nested array

put "Content" into tArray["key1"]["key2"]["key3"]["key4"]


# Replicate the path response from the Tree widget actionInspect function

put "key1,key2,key3,key4" into pPath


# Jaque's 'hard-wired' array key recipe works!

answer tArray[item 1 of pPath][item 2 of pPath][item 3 of pPath][item 4 of 
pPath] --returns 'Content'


# Replicate Jaque's syntax dynamically

put the number of items in pPath into tKeyCount

put empty into iNum

repeat for each item i in pPath

add 1 to iNum

# Try building the full key string

put "[" & item iNum of pPath & "]"after tKey1


# Try building keys string to 'embed' into the regular array key syntax

put item iNum of pPath after tKey2

if iNum < tKeyCount then put "][" after tKey2


# Try building by each key

if i is not empty then put "[" & item iNum of pPath & "]" after tArray2

end repeat


# Dynamic tKey1 results

answer tKey1 -- returns '["key1"]["key2"]["key3"]["key4"]' ...seems 'correct'

answer tArray & tKey1 -- returns '["key1"]["key2"]["key3"]["key4"]' ...dynamic 
key definition is not appended to array(?)


# Dynamic tKey2 results

answer tKey2 -- returns '"key1"]["key2"]["key3"]["key4"'

answer tArray[tKey2] -- returns null ...dynamic key definition is not 
understood (as first level key)?


answer tArray2 -- returns '["key1"]["key2"]["key3"]["key4"]' ...dynamic key 
definition is not appended to array(?)

end mouseUp


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


Re: Show Tree widget row contents on hover?

2021-04-23 Thread Keith Clarke via use-livecode
Thanks Bob for the syntax for setting the widget’s tooltip. That’ll help once I 
have some sensible data appearing in the answer dialogue box that I can use in 
the tooltip.

My key problem now is how to translate the comma-delimited path returned by the 
actionInspect function - pPath - of the form 'Key1,Key2,Key3' …to the correct 
syntax to have the array return the content of Key3.

My code below converts pPath to LiveCode array key syntax, i.e. 
[Key1][Key2][Key3] ...and then concatenates this after aContent, the name of 
the array variable into which the widget’s arrayData has been extracted.

As far as I can tell, this should resolve to... answer 
aContent[Key1][Key2][Key3] ...which should return the content of Key3 but I’m 
seeing '[Key1][Key2][Key3]’ in the answer dialogue box.

Any clues?
Best,
Keith

> On 23 Apr 2021, at 19:17, Bob Sneidar via use-livecode 
>  wrote:
> 
> Okay I see you are setting the tooltip. 
> 
> set the tooltip of widget "Tree View" to tDataA [1]
> 
> or whatever the element is. 
> 
> Bob S
> 
> 
>> On Apr 23, 2021, at 11:13 , Bob Sneidar via use-livecode 
>>  wrote:
>> 
>> Is this what you are looking for? 
>> 
>> on mouseUp
>>  put the arrayData of widget "Tree View" into tDataA
>>  put tDataA [1] into tValue1
>>  put tDataA [2] into tValue2
>>  -- etc...
>> end mouseUp
>> 
>> I am unsure of what you are trying to do. Are you trying to put the items of 
>> a list into a tree view widget? 
>> 
>> put the arrayData of widget "Tree View" into tDataA
>> put item 1 of tList into tDataA [1]
>> put item 2 of tList into tDataA [2]
>> -- etc...
>> set the arrayData of widget "Tree View" to tDataA
>> 
>> you can do this in a loop of course. 
>> 
>> Bob S
>> 
>> 
>>> On Apr 23, 2021, at 10:57 , Keith Clarke via use-livecode 
>>>  wrote:
>>> 
>>> Thanks for responding Henry. 
>>> 
>>> I did try that property when I found no hover capability on the Tree 
>>> widget. I set the widget to read-only and scripted...
>>> on actionInspect pPath
>>> 
>>> put the arrayData of widget "Tree" into aContent
>>> 
>>> replace comma with "][" in pPath
>>> 
>>> answer aContent & "[" & pPath & "]"
>>> 
>>> end actionInspect
>>> 
>>> …however, like the highlightedElement property, this still returns the 
>>> element’s key rather than its content, despite my feeble attempts at 
>>> post-processing.
>>> 
>>> Hence the second part of my question which reveals my lack of array syntax 
>>> knowledge! :)
>>> 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


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


Re: Show Tree widget row contents on hover?

2021-04-23 Thread Keith Clarke via use-livecode
Thanks for responding Henry. 

I did try that property when I found no hover capability on the Tree widget. I 
set the widget to read-only and scripted...
on actionInspect pPath

put the arrayData of widget "Tree" into aContent

replace comma with "][" in pPath

answer aContent & "[" & pPath & "]"

end actionInspect

…however, like the highlightedElement property, this still returns the 
element’s key rather than its content, despite my feeble attempts at 
post-processing.

Hence the second part of my question which reveals my lack of array syntax 
knowledge! :)
Best,
Keith

> On 23 Apr 2021, at 17:35, HENRY LOWE via use-livecode 
>  wrote:
> 
> Keith,
> 
> Take a look at the widget’s ActionInspect message. 
> 
> The actionInspect message is sent to the widget's script object when the 
> inspect icon is clicked on.
> The inspect icon appears when the value string of a particular array element 
> contains a newline character,
> OR if it is too large to fit in the space provided. The pPath parameter 
> contains the path to the element whose icon was clicked.
> 
> Use the ActionInspect pPath message to get the array element and then use a 
> contextual menu to display the truncated element (tElement):
> 
> set the text of btn “TreeView_Contextual_Menu" to tElement
> popup button “TreeView_Contextual_Menu"
> 
> This requires the user to click on the inspect icon of the truncated array 
> element element to display the full element.
> 
> I agree that it would be nice to do this with a hover.
> 
> Henry
> 
>> On Apr 23, 2021, at 9:10 AM, Keith Clarke via use-livecode 
>>  wrote:
>> 
>> Hi folks,
>> I’m experimenting with a tree widget and indentation means that row content 
>> gets truncated, so I’m wondering if there is any simple way to show the 
>> current row’s content in a tooltip on hover?
>> 
>> The dictionary doesn’t mention any mouse-related messages and the 
>> highlightedElement property returns a path as a comma-delimited list of 
>> array keys but not the row’s content.
>> 
>> Am I missing some LiveCode magic here that’s too obvious to document?
>> 
>> Thanks in advance.
>> 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

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


Show Tree widget row contents on hover?

2021-04-23 Thread Keith Clarke via use-livecode
Hi folks,
I’m experimenting with a tree widget and indentation means that row content 
gets truncated, so I’m wondering if there is any simple way to show the current 
row’s content in a tooltip on hover?

The dictionary doesn’t mention any mouse-related messages and the 
highlightedElement property returns a path as a comma-delimited list of array 
keys but not the row’s content.

Am I missing some LiveCode magic here that’s too obvious to document?

Thanks in advance.
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


Re: How to find the offset of the first character in a string that's not a tab?

2021-01-21 Thread Keith Clarke via use-livecode
Ah, thanks, Brian - re-reading more carefully, I see how the first item in the 
positionVarsList would provide the offset of the first non-tab character.

Re prettification, I’m trying to create a quick & dirty tool to process a set 
of comma-delimited query strings - to see their common patterns. They have 
nested label:value pairs, some of which expand further into arrays of varying 
depth bounded with curly braces & square brackets but they’re not 
standards-based JSON HTML or XML, so Coda prettification tools can’t won’t 
recognise and clean them up for me.

It’s (hopefully) a one-off activity, so I’m hoping to get away with quick & 
dirty text manipulation. I’ve made reasonable progress by iterating through 
chars but now need to do some post-processing cleanup of the ’tab-nested’ lines 
- hence the need to count the tab indentations.

I try to avoid arrays, as I can’t see the workings! :-D
Best,
Keith  

> On 21 Jan 2021, at 15:06, Brian Milby via use-livecode 
>  wrote:
> 
> Just to clarify my suggestion, it isn’t the return value that you would use 
> (other than to check for success), but the third variable in the call that 
> has the position that you would be looking for.
> 
> When you say that you are prettifying... are you doing something to adjust 
> each tab in the line?  If so, split may be useful to chunk the data into an 
> array.
> 
> And yes, there are many ways to do just about anything.  Glad you found 
> something that works for your situation.
> 
> Sent from my iPhone
> 
>> On Jan 21, 2021, at 9:38 AM, Keith Clarke via use-livecode 
>>  wrote:
>> 
>> Thanks Brian. I looked at matchChunk in the dictionary & it seems to return 
>> a boolean, rather than the offset. 
>> 
>> Thanks all - I’ve stopped trying to find the syntax for ‘find any char but 
>> this’ in offset and instead, taken Dick’s advice to iterate through the 
>> chars and count the loops until char <> tab. :)
>> Best,
>> Keith 
>> 
>>> On 21 Jan 2021, at 14:03, Brian Milby via use-livecode 
>>>  wrote:
>>> 
>>> You could also use matchChunk with a regular expression that excludes the 
>>> tab character.
>>> 
>>> Sent from my iPhone
>>> 
>>>>> On Jan 21, 2021, at 7:14 AM, Keith Clarke via use-livecode 
>>>>>  wrote:
>>>> 
>>>> Ah yes indeed, I’d forgotten I could test with 'put not(tab)’ in the 
>>>> message box - that certainly proves the syntax was wrong! :-)
>>>> Best,
>>>> Keith
>>>> 
>>>>>> On 21 Jan 2021, at 10:49, Dick Kriesel via use-livecode 
>>>>>>  wrote:
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>>> On Jan 21, 2021, at 2:34 AM, Keith Clarke via use-livecode 
>>>>>>>  wrote:
>>>>>> 
>>>>>> I was just keen to understand why offset wasn’t happy with the 
>>>>>> ‘not(tab)’ in this instance.
>>>>> 
>>>>> expression "not(tab)" evaluates to true, which doesn’t serve your purpose
>>>>> 
>>>>> — Dick
>>>>> 
>>>>> 
>>>>> ___
>>>>> use-livecode mailing list
>>>>> use-livecode@lists.runrev.com
>>>>> Please visit this url to subscribe, unsubscribe and manage your 
>>>>> subscription preferences:
>>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>> 
>>>> ___
>>>> use-livecode mailing list
>>>> use-livecode@lists.runrev.com
>>>> Please visit this url to subscribe, unsubscribe and manage your 
>>>> subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>> 
>>> ___
>>> use-livecode mailing list
>>> use-livecode@lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your 
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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


Re: How to find the offset of the first character in a string that's not a tab?

2021-01-21 Thread Keith Clarke via use-livecode
Thanks Brian. I looked at matchChunk in the dictionary & it seems to return a 
boolean, rather than the offset. 

Thanks all - I’ve stopped trying to find the syntax for ‘find any char but 
this’ in offset and instead, taken Dick’s advice to iterate through the chars 
and count the loops until char <> tab. :)
Best,
Keith 

> On 21 Jan 2021, at 14:03, Brian Milby via use-livecode 
>  wrote:
> 
> You could also use matchChunk with a regular expression that excludes the tab 
> character.
> 
> Sent from my iPhone
> 
>> On Jan 21, 2021, at 7:14 AM, Keith Clarke via use-livecode 
>>  wrote:
>> 
>> Ah yes indeed, I’d forgotten I could test with 'put not(tab)’ in the 
>> message box - that certainly proves the syntax was wrong! :-)
>> Best,
>> Keith
>> 
>>>> On 21 Jan 2021, at 10:49, Dick Kriesel via use-livecode 
>>>>  wrote:
>>>> 
>>>> 
>>>> 
>>>>> On Jan 21, 2021, at 2:34 AM, Keith Clarke via use-livecode 
>>>>>  wrote:
>>>> 
>>>> I was just keen to understand why offset wasn’t happy with the ‘not(tab)’ 
>>>> in this instance.
>>> 
>>> expression "not(tab)" evaluates to true, which doesn’t serve your purpose
>>> 
>>> — Dick
>>> 
>>> 
>>> ___
>>> use-livecode mailing list
>>> use-livecode@lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your 
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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


Re: How to find the offset of the first character in a string that's not a tab?

2021-01-21 Thread Keith Clarke via use-livecode
Ah yes indeed, I’d forgotten I could test with 'put not(tab)’ in the message 
box - that certainly proves the syntax was wrong! :-)
Best,
Keith

> On 21 Jan 2021, at 10:49, Dick Kriesel via use-livecode 
>  wrote:
> 
> 
> 
>> On Jan 21, 2021, at 2:34 AM, Keith Clarke via use-livecode 
>>  wrote:
> 
>> I was just keen to understand why offset wasn’t happy with the ‘not(tab)’ in 
>> this instance.
> 
> expression "not(tab)" evaluates to true, which doesn’t serve your purpose
> 
> — Dick
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

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


Re: How to find the offset of the first character in a string that's not a tab?

2021-01-21 Thread Keith Clarke via use-livecode
Thanks Dick, this would definitely work - and I’m iterating through characters 
and lines anyway as I attempt to prettify a long data string for eased human 
readability. 
I was just keen to understand why offset wasn’t happy with the ‘not(tab)’ in 
this instance.
Best,
Keith   

> On 21 Jan 2021, at 10:25, Dick Kriesel via use-livecode 
>  wrote:
> 
> 
>> On Jan 21, 2021, at 1:30 AM, Keith Clarke via use-livecode 
>> mailto:use-livecode@lists.runrev.com>> wrote:
>> 
>> Please can anyone advise on the correct syntax for trying to find the first 
>> non-tab character offset in a string
> 
> Hi, Keith.  You could test each character until you find a tab:
> 
> function offsetOfNotTab pString
> local i
> repeat for each char tChar in pString
>add 1 to i
>if tChar <> tab then return i
> end repeat
> end offsetOfNotTab
> 
> — Dick
> ___
> use-livecode mailing list
> use-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


How to find the offset of the first character in a string that's not a tab?

2021-01-21 Thread Keith Clarke via use-livecode
Hi folks,
Please can anyone advise on the correct syntax for trying to find the first 
non-tab character offset in a string, as 'offset(not(tab), tString)’ seems to 
be returning strange results - i.e. a number but not the correct one?
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


Re: How to render a two-dimensional array correctly with empty/missing 'cell' elements?

2020-12-30 Thread Keith Clarke via use-livecode
Hi Alex,
Thanks for the response and suggested code - the change from iterating through 
array column items in each row to the header row[0] keys was the enlightenment 
I needed... “Eureka!" :) 

A couple of tweaks and it’s working very nicely!

function displayArray @pArray

local tLineItem, tTag -- variables for array line and column (headers)

local tPrintLine -- variable for output printing

put empty into tPrintLine


# loop through each row of the array

put item 2 of line 1 of the extents of pArray into tNumItems

repeat with I = 0 to tNumItems -- row 0 contains column labels

# loop through each column for each row

repeat for each key K in pArray[0]

put K into tTag

put pArray[I][tTag] & "," after tPrintLine -- write content of the row ‘cell' 
to tPrintLine

end repeat

put return after tPrintLine -- insert a return after each row we have written 
to tPrintLine

end repeat


return tPrintLine

end displayArray


Thanks & regards,
Keith

> On 30 Dec 2020, at 13:56, Alex Tweedly via use-livecode 
>  wrote:
> 
> Hi Keith
> 
> here's a quick answer typed into email (i.e. not tested at all, sorry)
> 
> function displayArray @pArray
>  # create variables that point to the line and column of the array
>  local tLineItem, tColumnItem
>  # create a variable that stores the output for printing
>  local tPrintLine
>  put empty into tPrintLine
>  # loop through each row of the array
>  put item 2 of line 1 of the extents of pArray into tNumItem
>  repeat with I = 1 to tNumItems
># loop through each column of the array
>repeat for each key K in pArray[0] -- loop through the tags
>  put [pArray[0][K] into tTag
>  # write content of the array to tPrintLine
>  put pArray[I] & "," after tPrintLine
>end repeat
># insert a return after each row we have written to tPrintLine
>put return after tPrintLine
>  end repeat
>  return tPrintLine
> end displayArray
> 
> Alex
> 
> On 30/12/2020 13:48, Keith Clarke via use-livecode wrote:
>> Hi folks,
>> I’m using LiveCode to parse a set of xml files with varying subsets of tags 
>> (dmarc reports) into a CSV file.
>> 
>> The utility iterates through the files in the folder and the lines of the 
>> files, to identify unique opening tags and their content, all of which get 
>> parsed into an array:
>> - Tags go into aDetails[0][tTagName]
>> - Values go into aDetails[tFileNumber][tTagName]
>> 
>> This is then displayed as a table, using the function below, borrowed from 
>> an LC lesson 
>> https://lessons.livecode.com/m/4071/l/12250-how-do-i-store-an-array-variable-inside-of-another-array-variable
>>  
>> <https://lessons.livecode.com/m/4071/l/12250-how-do-i-store-an-array-variable-inside-of-another-array-variable>…
>> 
>> function displayArray @pArray
>>   # create variables that point to the line and column of the array
>>   local tLineItem, tColumnItem
>>   # create a variable that stores the output for printing
>>   local tPrintLine
>>   put empty into tPrintLine
>>   # loop through each row of the array
>>   repeat for each element tLineItem in pArray
>> # loop through each column of the array
>> repeat for each element tColumnItem in tLineItem
>>   # write content of the array to tPrintLine
>>   put tColumnItem & "," after tPrintLine
>> end repeat
>>   # insert a return after each row we have written to tPrintLine
>>   put return after tPrintLine
>>   end repeat
>>   return tPrintLine
>> end displayArray
>> 
>> However, the above function seems to assume that all array elements have 
>> content, so I’m getting problems where there are empty elements in the xml 
>> files coming from various sources.
>> 
>> I’m sure the loop repeating for each element can be refined to check for 
>> ‘empty cells’ by the tTagName key in my array but my LC array knowledge is 
>> to sparse to begin the search.
>> 
>> Dos anyone have any tips on where I should start looking?
>> 
>> Thanks & regards,
>> 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

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


How to render a two-dimensional array correctly with empty/missing 'cell' elements?

2020-12-30 Thread Keith Clarke via use-livecode
Hi folks,
I’m using LiveCode to parse a set of xml files with varying subsets of tags 
(dmarc reports) into a CSV file.

The utility iterates through the files in the folder and the lines of the 
files, to identify unique opening tags and their content, all of which get 
parsed into an array:
- Tags go into aDetails[0][tTagName]
- Values go into aDetails[tFileNumber][tTagName]

This is then displayed as a table, using the function below, borrowed from an 
LC lesson 
https://lessons.livecode.com/m/4071/l/12250-how-do-i-store-an-array-variable-inside-of-another-array-variable
 
…

function displayArray @pArray
  # create variables that point to the line and column of the array
  local tLineItem, tColumnItem
  # create a variable that stores the output for printing
  local tPrintLine
  put empty into tPrintLine
  # loop through each row of the array
  repeat for each element tLineItem in pArray
# loop through each column of the array
repeat for each element tColumnItem in tLineItem
  # write content of the array to tPrintLine
  put tColumnItem & "," after tPrintLine
end repeat
  # insert a return after each row we have written to tPrintLine
  put return after tPrintLine
  end repeat
  return tPrintLine
end displayArray  

However, the above function seems to assume that all array elements have 
content, so I’m getting problems where there are empty elements in the xml 
files coming from various sources.

I’m sure the loop repeating for each element can be refined to check for ‘empty 
cells’ by the tTagName key in my array but my LC array knowledge is to sparse 
to begin the search.

Dos anyone have any tips on where I should start looking?

Thanks & regards,
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


Re: filter

2020-11-19 Thread Keith Clarke via use-livecode
The chronicles of regex - a potential blockbuster there, Bob! :-)
Best,
Keith

> On 19 Nov 2020, at 16:49, Bob Sneidar via use-livecode 
>  wrote:
> 
> No one escapes the lair of the Regex Demon. Except for maybe Riddick.
> 
> Bob S
> 
> 
> On Nov 19, 2020, at 8:15 AM, Keith Clarke via use-livecode 
> mailto:use-livecode@lists.runrev.com>> wrote:
> 
> Ha, yes I understand that desire - and Mark’s one-character escape trick 
> beats my hack to bypass the lair of the regex demon! :D
> 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: filter

2020-11-19 Thread Keith Clarke via use-livecode
Ha, yes I understand that desire - and Mark’s one-character escape trick beats 
my hack to bypass the lair of the regex demon! :D
Best,
Keith

> On 19 Nov 2020, at 15:51, Klaus major-k via use-livecode 
>  wrote:
> 
> Hi Keith,
> 
>> Am 19.11.2020 um 16:38 schrieb Keith Clarke via use-livecode 
>> :
>> 
>> Hi Klaus,
>> Maybe iterate the lines - untested...
>> repeat for each line l in fld 1
>> if and( offset( “[“, l) > 0 , offset(“]”, l) > 0 ) then put line l of fld 1 
>> into tList
>> end repeat 
>> put tList
> 
> yes, sure, but "lazy moi" wanted to use FILTER and also understand why my 
> first script did not work. :-)
> 
>> Best,
>> Keith 
> 
> Best
> 
> Klaus
> 
> --
> Klaus Major
> https://www.major-k.de
> kl...@major-k.de
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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


Re: filter

2020-11-19 Thread Keith Clarke via use-livecode
Hi Klaus,
Maybe iterate the lines - untested...

repeat for each line l in fld 1
  if and( offset( “[“, l) > 0 , offset(“]”, l) > 0 ) then put line l of fld 1 
into tList
end repeat 

put tList

Best,
Keith 

> On 19 Nov 2020, at 15:19, Klaus major-k via use-livecode 
>  wrote:
> 
> Hi all,
> 
> I am surely missing something here with filter.
> 
> I have a field with some lines like:
> ...
> [500]
> text yadda
> yadda
> [100]
> ...
> And want to filter the field that only the lines with [...] remain in the 
> field.
> 
> So I thought
> ...
> filter fld 1 with "[*" 
> ...
> would do the job, but that EMPTIES the field!?
> Obviously this [ interferes with some REGEX mechanism of filter?
> So what should I use now?
> 
> Any hints very appreciated!
> 
> 
> Best
> 
> Klaus
> --
> Klaus Major
> https://www.major-k.de
> kl...@major-k.de
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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


Re: Query large CSV file as a data source?

2020-11-03 Thread Keith Clarke via use-livecode
Thank you Matthias, I wasn’t aware of that ability to open the file and read 
its contents straight from the disk. 

A quick experiment looks positive - no hanging and fast access - so I just need 
to work on the loop.

Much obliged.

Best,
Keith   

> On 3 Nov 2020, at 13:37, matthias rebbe via use-livecode 
>  wrote:
> 
> Couldn't you read the file partially
> 
> you would open the file for read
> 
>   open file tFile for read
> 
> then in a repeat loop you could read e.g. 1 lines and process the data
> 
>   read from file tFile for 1 lines
> 
> 
> Just a thought.
> 
> 
> -
> Matthias Rebbe
> Life Is Too Short For Boring Code
> 
>> Am 03.11.2020 um 13:14 schrieb Keith Clarke via use-livecode 
>> :
>> 
>> Hi folks,
>> I’ve a 3GB CSV file with 18M rows from which I need to create a subset CSV 
>> file for the rows containing tString. The following script results in 
>> LiveCode becoming unresponsive, so I’m wondering if I’m missing an obvious 
>> trick or what alternative approach I might take...
>> on mouseUp pButtonNumber
>> 
>> -- Select CSV File
>> 
>> answer file prompt as sheet
>> 
>> put it into tFile
>> 
>> put tFile into field "File"
>> 
>> -- Process CSV extract
>> 
>> put URL ("file:" & tFile) into tText
>> 
>> put line 1 of tText into field "List"
>> 
>> filter lines of tText with "*tString*"
>> 
>> put tText into field tList
>> 
>> end mouseUp
>> 
>> I don’t normally deal with large data sets, so maybe LiveCode isn’t the best 
>> tool for this but Excel 365 seems to only offer CSV file import, not query.
>> 
>> Any thoughts greatly appreciated.
>> 
>> Thanks & regards,
>> 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


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


Query large CSV file as a data source?

2020-11-03 Thread Keith Clarke via use-livecode
Hi folks,
I’ve a 3GB CSV file with 18M rows from which I need to create a subset CSV file 
for the rows containing tString. The following script results in LiveCode 
becoming unresponsive, so I’m wondering if I’m missing an obvious trick or what 
alternative approach I might take...
on mouseUp pButtonNumber

-- Select CSV File

answer file prompt as sheet

put it into tFile

put tFile into field "File"

-- Process CSV extract

put URL ("file:" & tFile) into tText

put line 1 of tText into field "List"

filter lines of tText with "*tString*"

put tText into field tList

end mouseUp

I don’t normally deal with large data sets, so maybe LiveCode isn’t the best 
tool for this but Excel 365 seems to only offer CSV file import, not query.

Any thoughts greatly appreciated.

Thanks & regards,
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


Re: How to divide card with/in 3 vertical lines?

2020-10-28 Thread Keith Clarke via use-livecode
Are you able to use 'CardWidth*4/3' to get 1.33 recurring?
Best,
Keith

> On 28 Oct 2020, at 20:16, William de Smet via use-livecode 
>  wrote:
> 
> Hi Scott,
> 
> Line 3 should be at loc 768,384 but is now at loc 770,384 (stack 1024x768).
> This is because 'cardWidth/1.33' is not precise enough?
> 
> Greetings,
> 
> William
> 
> 
> 
> 
> Op wo 28 okt. 2020 om 20:54 schreef scott--- via use-livecode <
> use-livecode@lists.runrev.com>:
> 
>> When you say "almost perfect but not quite” what exactly are you meaning?
>> 
>> —Scott
>> 
>>> On Oct 28, 2020, at 11:04 AM, William de Smet via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>>> 
>>> Hi there,
>>> 
>>> I need 3 vertical lines in my iOS app with equal distance and from top to
>>> bottom.
>>> So I use the script below. It is almost perfect but not quite.
>>> Is there a better way to do this?
>>> --
>>> *s*et the loc of grc "line1" to cardWidth/4, cardHeight/2
>>> set the loc of grc "line2" to cardWidth/2, cardHeight/2
>>> set the loc of grc "line3" to cardWidth/1.33, cardHeight/2
>>> 
>>> set the height of grc "line1" to cardHeight
>>> set the height of grc "line2" to cardHeight
>>> set the height of grc "line3" to cardHeight
>>> --
>>> 
>>> greetings,
>>> 
>>> William
>>> ___
>>> use-livecode mailing list
>>> use-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: Correct use of string A 'is in' string B?

2020-10-14 Thread Keith Clarke via use-livecode
Indeed. The joy of web services integration projects - sometimes there are more 
standards and variations of words than characters in a crime drama! :)
Best,
Keith

> On 14 Oct 2020, at 12:25, Tore Nilsen via use-livecode 
>  wrote:
> 
> You should not be to embarrassed. There is a particular reason why I spotted 
> this. I think we have all been there at one time or another.
> 
> Best regards
> Tore
> 
>> 14. okt. 2020 kl. 13:22 skrev Keith Clarke via use-livecode 
>> :
>> 
>> Oh, dear - that's embarrassing! Thanks Tore - time to take a break and check 
>> for updates on my eyeball firmware! :-D
>> Best,
>> Keith
>> 
>>> On 14 Oct 2020, at 12:04, Tore Nilsen via use-livecode 
>>>  wrote:
>>> 
>>> In the url itself you use access_token but in your search you use 
>>> access_code. May this be the reason for your problems?
>>> 
>>> Best regards
>>> Tore Nilsen
>>> 
>>>> 14. okt. 2020 kl. 13:00 skrev Keith Clarke via use-livecode 
>>>> :
>>>> 
>>>> Hi folks,
>>>> Am I misreading the docs and abusing the 'is in' logic or syntax here...?
>>>> 
>>>> In my test case, the browser widget URL takes the form (truncated) 
>>>> https://somewhere.com/callback.lc#access_token=0123456789;...
>>>> 
>>>> This is visible in the field "ResponseURL" but the if statement is not 
>>>> firing. 
>>>> 
>>>> Is this a syntax or logic error on my part?
>>>> on browserNavigateComplete
>>>> 
>>>> get the URL of widget "Browser" 
>>>> put it into field "ResponseURL" 
>>>> 
>>>> # Update Access Token
>>>> 
>>>> put it into tURL
>>>> 
>>>> if "access_code" is in tURL then
>>>> 
>>>> put tURL
>>>> 
>>>> do UpdateAccessToken(tURL)
>>>> 
>>>> end if
>>>> 
>>>> get the HTMLText of widget "Browser" 
>>>> 
>>>> put it into field "Content" 
>>>> 
>>>> end browserNavigateComplete
>>>> 
>>>> BTW I've also tried the inverse if 'tURL contains 'access_code" 
>>>> 
>>>> Thanks & regards,
>>>> 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
>> 
>> 
>> ___
>> use-livecode mailing list
>> use-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: Correct use of string A 'is in' string B?

2020-10-14 Thread Keith Clarke via use-livecode
Oh, dear - that's embarrassing! Thanks Tore - time to take a break and check 
for updates on my eyeball firmware! :-D
Best,
Keith

> On 14 Oct 2020, at 12:04, Tore Nilsen via use-livecode 
>  wrote:
> 
> In the url itself you use access_token but in your search you use 
> access_code. May this be the reason for your problems?
> 
> Best regards
> Tore Nilsen
> 
>> 14. okt. 2020 kl. 13:00 skrev Keith Clarke via use-livecode 
>> :
>> 
>> Hi folks,
>> Am I misreading the docs and abusing the 'is in' logic or syntax here...?
>> 
>> In my test case, the browser widget URL takes the form (truncated) 
>> https://somewhere.com/callback.lc#access_token=0123456789;...
>> 
>> This is visible in the field "ResponseURL" but the if statement is not 
>> firing. 
>> 
>> Is this a syntax or logic error on my part?
>> on browserNavigateComplete
>> 
>> get the URL of widget "Browser" 
>> put it into field "ResponseURL" 
>> 
>> # Update Access Token
>> 
>> put it into tURL
>> 
>> if "access_code" is in tURL then
>> 
>> put tURL
>> 
>> do UpdateAccessToken(tURL)
>> 
>> end if
>> 
>> get the HTMLText of widget "Browser" 
>> 
>> put it into field "Content" 
>> 
>> end browserNavigateComplete
>> 
>> BTW I've also tried the inverse if 'tURL contains 'access_code" 
>> 
>> Thanks & regards,
>> 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


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


Correct use of string A 'is in' string B?

2020-10-14 Thread Keith Clarke via use-livecode
Hi folks,
Am I misreading the docs and abusing the 'is in' logic or syntax here...?

In my test case, the browser widget URL takes the form (truncated) 
https://somewhere.com/callback.lc#access_token=0123456789;...

This is visible in the field "ResponseURL" but the if statement is not firing. 

Is this a syntax or logic error on my part?
on browserNavigateComplete

get the URL of widget "Browser" 
put it into field "ResponseURL" 

# Update Access Token

put it into tURL

if "access_code" is in tURL then

put tURL

do UpdateAccessToken(tURL)

end if

get the HTMLText of widget "Browser" 

put it into field "Content" 

end browserNavigateComplete

BTW I've also tried the inverse if 'tURL contains 'access_code" 

Thanks & regards,
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


Re: LiveCode server IDE

2020-10-13 Thread Keith Clarke via use-livecode
Hi Alex,
Thanks for the description of your workflow, toolset and dev/test rig - an 
interesting direction of travel, especially as it extends to my current setup.

I really like the division of labour between the LC IDE for LC and Coda for 
html, CSS and native sync to server. Nice too, the 'closed-loop environment, 
with the local test stack that can call, display (and if necessary interrogate) 
specific rendered web pages.

So, my learning path moves on, from tools to building out my own dev/test 
scaffolding and moving my thinking from LC stacks with UI to script-only stacks 
in an LC Server CGI context serving web forms. Plenty of reading to do! :-)

Thanks & regards,
Keith

> On 12 Oct 2020, at 20:51, Alex Tweedly via use-livecode 
>  wrote:
> 
> Hi Keith,
> 
> My workflow is not much different from Ralph's.
> 
> Short answer:
> 
>  - edit in IDE, test in IDE
> 
>  - upload to server using Coda 2  (which I also use to edit non-lc files).
> 
> Long answer:
> 
>  - I don't use any of the LCserver specific features -  no entangled html, no 
> includes, ... - everything is a regular script-only stack
> 
>  - I have a test stack that I use in the IDE which lets me specify which page 
> (and parameters, cookies, etc.) I want, generates the web page and displays 
> the output in a web browser instance within the testing stack.
> 
>  - when satisfied, I use Coda 2 to upload the LC files (I never edit them in 
> Coda))
> 
>  - I edit other files (menu definitions, form definitions, web pages, views, 
> etc.)  in Coda2
> 
> I use both on-rev and hostM for servers - both have everything already 
> installed,  good support, etc.
> 
> (tbh, if on-rev hadn't had a bad patch a few years ago with email problems, I 
> would probably never have strayed, but it's kind of good to know that hostM 
> is there as an alternate source in case I need it :-)
> 
> Alex.
> 
> On 12/10/2020 15:49, Keith Clarke via use-livecode wrote:
> 
>> Thanks for the response, Ralph.
>> 
>> I've struggled to retain/regain my old local Sites, web server and LC Server 
>> on my home Macs. So, I was thinking of embarking down the script-only stacks 
>> route, using an on-rev LC-Server instance to do any web-services 
>> heavy-lifting work server-to-server, on behalf of client apps that use 
>> either LC desktop or simple html forms.
>> 
>> My html & css 'hackery-pokery' has been on Coda2 to date, but its 
>> replacement, Nova, still lacks any LiveCode autocompletion.
>> 
>> I may need to learn a new text-editing based IDE tool. Thanks for the Atom 
>> suggestion - I see that there's a LiveCode language pack available that 
>> includes LC Server, so that may be a better place to play than VS Code, etc.
>> 
>> Thanks & regards,
>> Keith
>> 
>>> On 12 Oct 2020, at 15:01, Ralph DiMola via use-livecode 
>>>  wrote:
>>> 
>>> Keith,
>>> 
>>> As a follow up... If you have a web server with LC installed running on your
>>> local machine then just a ctrl S in the LC IDE will let you test your server
>>> script(stack) immediately in the currently open IDE instance.
>>> 
>>> IDE alternatives to edit LC script only stacks are many. I use the Atom for
>>> LC builder and html(when Dreamweaver is just to much).
>>> 
>>> 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 Keith Clarke via use-livecode
>>> Sent: Monday, October 12, 2020 3:18 AM
>>> To: use-livecode@lists.runrev.com
>>> Cc: Keith Clarke
>>> Subject: LiveCode server IDE
>>> 
>>> Hi folks,
>>> What is the current state of the art regarding LiveCode server IDE -
>>> searching around, this seems down to personal preference of text editor plus
>>> FTP?
>>> 
>>> I'm Mac-based and looking to experiment with web services.
>>> Thanks and regards,
>>> Keith
>>> 
>>> 
>>> Sent from my iPad
>>> ___
>>> use-livecode mailing list
>>> use-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
>>> Pleas

Re: LiveCode server IDE

2020-10-12 Thread Keith Clarke via use-livecode
Thanks for the response, Ralph.

I've struggled to retain/regain my old local Sites, web server and LC Server on 
my home Macs. So, I was thinking of embarking down the script-only stacks 
route, using an on-rev LC-Server instance to do any web-services heavy-lifting 
work server-to-server, on behalf of client apps that use either LC desktop or 
simple html forms.

My html & css 'hackery-pokery' has been on Coda2 to date, but its replacement, 
Nova, still lacks any LiveCode autocompletion.

I may need to learn a new text-editing based IDE tool. Thanks for the Atom 
suggestion - I see that there's a LiveCode language pack available that 
includes LC Server, so that may be a better place to play than VS Code, etc.

Thanks & regards,
Keith 

> On 12 Oct 2020, at 15:01, Ralph DiMola via use-livecode 
>  wrote:
> 
> Keith,
> 
> As a follow up... If you have a web server with LC installed running on your
> local machine then just a ctrl S in the LC IDE will let you test your server
> script(stack) immediately in the currently open IDE instance.
> 
> IDE alternatives to edit LC script only stacks are many. I use the Atom for
> LC builder and html(when Dreamweaver is just to much).
> 
> 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 Keith Clarke via use-livecode
> Sent: Monday, October 12, 2020 3:18 AM
> To: use-livecode@lists.runrev.com
> Cc: Keith Clarke
> Subject: LiveCode server IDE
> 
> Hi folks,
> What is the current state of the art regarding LiveCode server IDE -
> searching around, this seems down to personal preference of text editor plus
> FTP?
> 
> I'm Mac-based and looking to experiment with web services.
> Thanks and regards,
> Keith
> 
> 
> Sent from my iPad
> ___
> use-livecode mailing list
> use-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


LiveCode server IDE

2020-10-12 Thread Keith Clarke via use-livecode
Hi folks,
What is the current state of the art regarding LiveCode server IDE - searching 
around, this seems down to personal preference of text editor plus FTP?

I'm Mac-based and looking to experiment with web services.
Thanks and regards,
Keith


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


Re: Basic question about behaviors

2020-08-26 Thread Keith Clarke via use-livecode
Certainly best to avoid any made backwards.

> On 26 Aug 2020, at 15:20, Martin Koob via use-livecode 
>  wrote:
> 
> Is there a rule regarding puns?
> 
> Martin
> 
>> On Aug 26, 2020, at 9:30 AM, Paul Pystcat via use-livecode 
>>  wrote:
>> 
>> ROFL
>> 
>> THAT was gouda!
>> 
>> (I know, I know!  I broke one of the rules… no politics, no religion and no 
>> cheese)
>> 
>>> On Aug 26, 2020, at 9:09 AM, Mike Kerner via use-livecode 
>>>  wrote:
>>> 
>>> On Tue, Aug 25, 2020 at 12:41 PM Sean Cole (Pi) via use-livecode <
>>> use-livecode@lists.runrev.com> wrote:
>>> 
 I LOVE 'this me'. This extraordinary use of coding language is truly where
 LC  shines and why I love it so much, - sometimes. [sigh]
 
 Sean
 
>>> 
>>> and that's why your fonts break - because you "LOVE" - not "love", not
>>> "Love", not "l-o-l-o-l-o-v-e", but "LOVE" "this me".
>>> you're welcome.
>>> ___
>>> use-livecode mailing list
>>> use-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: Recommended (simple) Linux distro for Livecode server home dev/test?

2020-05-10 Thread Keith Clarke via use-livecode
Great, thanks - to all who responded - nothing quite like a shortlist of one to 
ease decision-making! :)

Time to have a play...
Best,
Keith..

>> On 9 May 2020, at 20:01, Richard Gaskin via use-livecode 
>>  wrote:
>> 
>> Keith Clarke wrote:
>> Hi folks,
>> Which distro(s) would you recommend for a Linux newbie as the easiest
>> way to repurpose an old PC, Mac Laptop or Mini to host Livecode Server
>> for lightweight ‘LAMP/LAML' dev/test dabbling?
>> I’ve never had a Linux desktop machine and server-wise, never had to
>> delve below C-Panel & WHM on hosted VPS Linux environments - so am
>> very much the newbie on this.
> 
> Ubuntu, without question.
> 
> There many great distros, and I don't think there is a single "best". But 
> Ubuntu has by far the largest installed base, so most of the tutorials and 
> other support materials you'll find are written with Ubuntu in mind.
> 
> This is especially true on servers. Heck, even on Microsoft's Azure cloud 
> ecosystem. Ubuntu is the leading OS.
> 
> Desktop:
> https://ubuntu.com/download/desktop
> 
> Server:
> https://ubuntu.com/download/server
> 
> You may change later; some folks like to distro-hop often. But the vast range 
> of support materials makes Ubuntu the go-to starting point for getting into 
> Linux.
> 
> 
>> Hardware specs would be useful, too - to gauge how far back on the
>> cupboard to reach to source an appropriate box!
> 
> You can check the requirements at the site, but you probably don't need to 
> worry about it.  If it's for a sever you won't need the GUI desktop edition, 
> and it's the desktop where requirements tend to be much higher.  There's a 
> flavor of Ubuntu for everything from Raspberry Pi to supercomputing clusters 
> - you should have no trouble finding one for your old PCs. The Server edition 
> should get you up and running on just about any machine made in the last 10 
> years or more.
> 
> 
> If you want a GUI desktop edition and have an old machine that's a bit 
> underpowered for Ubuntu, there's a lightweight flavor you can use:
> 
> https://lubuntu.net/
> 
> Lubuntu is the leanest Ubuntu flavor I've tried.  It's been running on my 
> desk almost continuously for the last decade, downloading, collating, and 
> posting data for the info you see in LiveNet (see the GoLiveNet plugin in 
> LC's Plugins menu).
> 
> I prefer Ubuntu's Gnome Shell for my main workstation, but on lower-powered 
> machines I've been impressed with how efficiently Lubuntu runs.
> 
> -- 
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> 
> ambassa...@fourthworld.comhttp://www.FourthWorld.com
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

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


Recommended (simple) Linux distro for Livecode server home dev/test?

2020-05-09 Thread Keith Clarke via use-livecode
Hi folks,
Which distro(s) would you recommend for a Linux newbie as the easiest way to 
repurpose an old PC, Mac Laptop or Mini to host Livecode Server for lightweight 
‘LAMP/LAML' dev/test dabbling?

I’ve never had a Linux desktop machine and server-wise, never had to delve 
below C-Panel & WHM on hosted VPS Linux environments - so am very much the 
newbie on this.

Hardware specs would be useful, too - to gauge how far back on the cupboard to 
reach to source an appropriate box!  

Thanks & regards,
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


Re: Making my book free until the end of May

2020-03-18 Thread Keith Clarke via use-livecode
Hi Andre,
I wasn’t aware that you’d written that book - but a spooky coincidence, as last 
weekend I’d just started revisiting RevIgniter for LiveCode server and as a 
hobbyist, was struggling to get my head around MVC & mapping to (limited 
knowledge of) LiveCode concepts.

So, good timing and I was happy to pay the $20 - consider it a 'virtual beer' 
in these times of social isolation & lockdown! :-D

Cheers Andre - and stay safe, all.

Best,
Keith

> On 18 Mar 2020, at 11:51, Andre Garzia via use-livecode 
>  wrote:
> 
> Hi Folks,
> 
> Many of you are probably working from home right now and some might be
> self-isolating or under lockdown. I understand that this poses many
> challenges to many of you, most of which I can't help with at all, but I
> can however make it easier for you to get more LC content. The current time
> is stressing the ability of many of us to make a living, especially people
> here who might be forced into unpaid leave. Because of that I decided to
> make my book free until the end of May. You can get it at:
> 
> https://leanpub.com/livecodeapparchitecture
> 
> The way Leanpub works is that there is a price slider that lets you adjust
> the price from the minimum value set by the author all the way to as much
> as you want. I've adjusted the minimum price and the recommended price to 0
> USD. You can still adjust that if you want. The book is usually 20 USD but
> with that cut, you can use that cash for something else and improve your LC
> skills.
> 
> Best
> Andre
> 
> -- 
> http://www.andregarzia.com -- All We Do Is Code.
> http://fon.nu -- minimalist url shortening service.
> ___
> use-livecode mailing list
> use-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: Can the Browser widget access dev tools?

2020-03-13 Thread Keith Clarke via use-livecode
Hi Sean,
Thanks for the response - that saves me researching further on browser widget 
usage for this. 

I’ve also looked at trying to drive a regular Chrome browser instance on my Mac 
but there seems to be a more fundamental snag…

Unlike the Console, the Dev Tools Network settings seem to lack any API 
https://developers.google.com/web/tools/chrome-devtools/network 
<https://developers.google.com/web/tools/chrome-devtools/network>.

Good call on raising a change request to Google on tools & throttling 
persistence - I’ll see if I can find where to do that!
Best,
Keith

> On 13 Mar 2020, at 13:21, Pi Digital via use-livecode 
>  wrote:
> 
> Hi Keith
> 
> The chromium engine is not the same as the chrome browser. So the browser has 
> the dev tools. The engine will have some code base that the browser can pull 
> from to display as tools. 
> 
> The browser widget is a browser in its own right. It does not, at least as 
> far as I’m aware, embed a chrome browser into a container. It uses the 
> chromium engine to feed data that can be interpreted and displayed within a 
> widget canvas. 
> 
> So dev tools would have to be written into the widget to access things l’île 
> the throttling settings so that you could manipulate them using properties in 
> the UI or by code. 
> 
> I hope this leads to solving your rsi problem eventually. It is a pain when 
> the dev tools disappear when you load a new page and you can’t set it to stay 
> up and stay throttled. Send a feature request to google. 
> 
> All the best 
> 
> Sean Cole
> Pi Digital
> 
> 
>> On 13 Mar 2020, at 10:55, Keith Clarke via use-livecode 
>>  wrote:
>> 
>> Hi folks,
>> I understand that the browser widget uses the platform’s default browser 
>> engine. The (default?) feature set seems to be limited - e.g. no right-click 
>> (on Mac).
>> 
>> There don’t seem to be obvious entries in the dictionary concerning 
>> developer tools/menu/option. Please can anyone confirm whether it’s possible 
>> to access Safari (Mac) or Chromium (Windows) Developer Tools 
>> programmatically from LC - or control the right-click page inspector access 
>> (and it’s content once displayed)?
>> 
>> And, just in case I’m taking the wrong direction of travel, the use case is 
>> that I’m looking to cobble together a simple test rig to help test page load 
>> times on limited bandwidth connections using Chrome’s network throttling 
>> settings, as I’m getting bored (& RSI) from the current manual process!
>> 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

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


Can the Browser widget access dev tools?

2020-03-13 Thread Keith Clarke via use-livecode
Hi folks,
I understand that the browser widget uses the platform’s default browser 
engine. The (default?) feature set seems to be limited - e.g. no right-click 
(on Mac).

There don’t seem to be obvious entries in the dictionary concerning developer 
tools/menu/option. Please can anyone confirm whether it’s possible to access 
Safari (Mac) or Chromium (Windows) Developer Tools programmatically from LC - 
or control the right-click page inspector access (and it’s content once 
displayed)?

And, just in case I’m taking the wrong direction of travel, the use case is 
that I’m looking to cobble together a simple test rig to help test page load 
times on limited bandwidth connections using Chrome’s network throttling 
settings, as I’m getting bored (& RSI) from the current manual process!
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


Re: View XML file in Tree View widget - worth the effort?

2019-06-05 Thread Keith Clarke via use-livecode
Partial success with that resource, downloading it into a local script-only 
library stack...
put ConvertXMLToArray (tXML, "utf8") into tArrayXML

set the arrayData of widget 1 of this stack to tArrayXML


...successfully parses the XML nodes into array keys that get rendered into the 
TreeView widget - and I can set the third parameter to force ‘@value’ keys.

Unfortunately, there are no values being displayed in the TreeView - with or 
without ‘@value’ keys being forced on. 

I don’t think they’re being created in the array from a couple of quick tests 
and attempting to recreate the XML using…
put ConvertArrayToXML(tArrayXML)

…returns just a number

Any ideas gratefully received, meanwhile I’ll look for alternative resources, 
as this one (6 years old) may not be compatible with LiveCode 9.x...?
Best,
Keith 

> On 5 Jun 2019, at 08:27, Keith Clarke  wrote:
> 
> Thanks Ali - the 'XML to LiveCode multi-dimensional array’ handler should get 
> me close.
> Best,
> Keith
> 
>> On 5 Jun 2019, at 06:06, Ali Lloyd via use-livecode 
>>  wrote:
>> 
>> Not sure if it's exactly the format you're looking for but this code
>> snippet from Trevor DeVore converts between XML and LiveCode arrays:
>> https://gist.github.com/trevordevore/5584753
>> 
>> On Tue, 4 Jun 2019 at 18:57, Keith Clarke via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>> 
>>> Hi folks,
>>> Is parsing an XML file into a LiveCode TreeView widget a sensible (and
>>> easy) approach to render it more human-readable to understand it’s
>>> structure & content, etc., for potential onward processing / transformation?
>>> 
>>> If so, can anyone please share the current state of the art for
>>> transforming an XML file to the requisite array form to seed the TreeView
>>> widget?
>>> 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
> 

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

Re: View XML file in Tree View widget - worth the effort?

2019-06-05 Thread Keith Clarke via use-livecode
Thanks Ali - the 'XML to LiveCode multi-dimensional array’ handler should get 
me close.
Best,
Keith

> On 5 Jun 2019, at 06:06, Ali Lloyd via use-livecode 
>  wrote:
> 
> Not sure if it's exactly the format you're looking for but this code
> snippet from Trevor DeVore converts between XML and LiveCode arrays:
> https://gist.github.com/trevordevore/5584753
> 
> On Tue, 4 Jun 2019 at 18:57, Keith Clarke via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> 
>> Hi folks,
>> Is parsing an XML file into a LiveCode TreeView widget a sensible (and
>> easy) approach to render it more human-readable to understand it’s
>> structure & content, etc., for potential onward processing / transformation?
>> 
>> If so, can anyone please share the current state of the art for
>> transforming an XML file to the requisite array form to seed the TreeView
>> widget?
>> 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


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

View XML file in Tree View widget - worth the effort?

2019-06-04 Thread Keith Clarke via use-livecode
Hi folks,
Is parsing an XML file into a LiveCode TreeView widget a sensible (and easy) 
approach to render it more human-readable to understand it’s structure & 
content, etc., for potential onward processing / transformation?

If so, can anyone please share the current state of the art for transforming an 
XML file to the requisite array form to seed the TreeView widget?
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

Re: LC Server on OSX Mojave - Local host & sites

2019-04-05 Thread Keith Clarke via use-livecode
Thanks Bob - those articles are much more recent than those I was referencing, 
so it looks like I have a weekend of experimentation lined up!
Best
Keith

> On 4 Apr 2019, at 11:29, bob--- via use-livecode 
>  wrote:
> 
> There are changes in how things work in 10.14.x of Mac OS. When I setup my 
> system for full stack dev (iMac 27” Late 2014) I did a mashup of the 
> following 2 posts. Not sure that you should start right in with these but 
> maybe there’s something in the text that will help you get the configuration 
> you need.
> 
> You will see that there’s a PHP focus in the setups. Once you are able to get 
> the php info page working you should be good to get LC server running. The 
> second link is a 3 part article. I’ve included a link to the first post.
> 
> The Perfect Web Development Environment for Your New Mac (Not updated 
> recently but a good reference)
> https://mallinson.ca/posts/5/the-perfect-web-development-environment-for-your-new-mac
>  
> 
> 
> Part 1: macOS 10.14 Mojave Web Development Environment (updated as recently 
> as Jan 2019)
> https://getgrav.org/blog/macos-mojave-apache-multiple-php-versions
> 
> Hope this might help you,
> Bob H.
> 
> 
> ___
> use-livecode mailing list
> use-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 Server on OSX Mojave - Local host & sites

2019-04-03 Thread Keith Clarke via use-livecode
Rick - thanks for sharing. That all sounds extremely frustrating and I was 
hoping to avoid opening the SSL can-of-worms for a desktop-based MALM 
(Mac-Apache-LiveCode-Maria) dev server installation!

JJS - I’m just trying to recover the old Mac Sites web server functionality in 
Mojave to get back my desktop web-dev playground - but it’s failing before I 
get to testing LC Server. 

I have followed (pre-Mojave) online setup advice regarding httpd.conf, 
httpd-user.conf and keith.conf files that should recover this service and 
apachectl configtest passes OK, but I’m getting permission errors at any page 
URLs for http://localhost/keith/Sites and below.

Best,
Keith

> On 3 Apr 2019, at 17:55, JJS via use-livecode  
> wrote:
> 
> Is this a local server you are using? because you are having localhost after 
> http://
> 
> 
> So it is not reachable by anyone else on the internet right?
> 
> 
> Op 3-4-2019 om 16:09 schreef Rick Harrison via use-livecode:
>> Hi Keith,
>> 
>> Unfortunately, Apple, Inc. has really screwed us over with the removal of
>> website control in their newest version of macOS Server.  All they gave us
>> was the macOS-Server-Service-Migration-Guide.pdf which says very little
>> about the most important things like SSL under Mojave. To quote:
>> 
>> “1. The virtual hosts won’t be behind a reverse proxy; they’ll be listening 
>> on
>> standard HTTP ports unless configured otherwise.
>> 2. The SSL certificates will reside in the System.keychain, not in the file 
>> system.
>> 3. The SSL processing will be managed by Apple’s mod_secure_transport
>> plug-in for Apache, not by mod_ssl.”
>> 
>> They give very little in the way of instructions, and instead show a bunch 
>> of diff files
>> that show the differences between the configuration files under old macOS 
>> Server
>> and the way they should look for Mojave.
>> 
>> I managed to work my way through the document making all the changes, and
>> got LC Server to work too!  (I thought that would be a the hard part.  I was
>> wrong to make that assumption.)
>> 
>> When it was time to get my SSL I found I was unable to get it to work, so
>> I thought I would hire an experienced Sectigo SSL guy to do it.  Perhaps
>> he would succeed where I had failed since they do these things all the time.
>> The guy tried 3 times on 3 different days.  He failed, and told me that I 
>> would
>> have to call Apple Support about the matter.  I tried to see if he would call
>> them for me as this problem impacts their business more severely, but he
>> wouldn’t do it.  They did agree to refund my SSL Installation Service money,
>> which I appreciated.
>> 
>> When I called Apple, Inc. support, they bumped the problem up by
>> three levels and then told me they would have to bump it up yet
>> another level.  They wanted $700 to work on the problem!  This is a
>> problem they have caused, and they expect me to pay that much
>> for a fix?  Really?  I told them I would keep it in mind as a last resort.
>> 
>> I tried to look for other solutions.  I looked at VirtualHostX and thought
>> I would try a letsencrypt.org SSL Certificate just in case there was
>> something wrong with my Sectigo SSL Certificate.  I was able to
>> get my SSL working with that, but VirtualHostX sets up a Virtual Debian Linux
>> computer inside of my Mac. Emulation slows down the computer and
>> I thought there must still be a pure macOS solution out there.
>> 
>> I decided to give MAMP Pro a try. That didn’t work either!  When I contacted
>> their support people they said:
>> 
>>  "MAMP PRO is mostly intended for local development mostly. You can
>> use it as a live server if you would like, but we cannot provide support
>> for this. At this time we don' have a how-to on setting up a
>> letsencrypt ssl key. If you cannot get this working, and this is
>> why you purchased MAMP PRO, to use it as a live server, then we
>> can offer you a refund.”
>> 
>> That has put me back to square one.
>> 
>> If anyone can work through the SSL problem and get it working under
>> macOS 10.14.4 Mojave, I would be happy to help out getting LC
>> Server to work.
>> 
>> Let me know if you have any suggestions.
>> 
>> Thanks,
>> 
>> Rick
>> 
>> 
>> 
>>> On Apr 2, 2019, at 3:43 PM, Keith Clarke via use-livecode 
>>>  wrote:
>>> 
>>> Hi Folks,
>>> Is there a recipe more recent than the LC Server on OSX lesson that covers 
>>> the Mohave Apache environment setup to recognise Sites URLs in localhost - 

LC Server on OSX Mojave - Local host & sites

2019-04-02 Thread Keith Clarke via use-livecode
Hi Folks,
Is there a recipe more recent than the LC Server on OSX lesson that covers the 
Mohave Apache environment setup to recognise Sites URLs in localhost - now that 
Apple has hidden point & click web sharing facilities?

I have localhost working but get "The requested URL /keith/Sites/test.lc was 
not found on this server.” for http://localhost/keith/Sites/test.lc 


Any clues gratefully received.
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

Re: Feature request: merge function!

2019-01-18 Thread Keith Clarke via use-livecode
I don’t know the setting but might a line or two of preprocessing allow LC to 
replace the (specific) strings in the template with curly brackets into ones 
with square brackets for processing?
Best,
Keith   

> On 18 Jan 2019, at 09:33, Richard Gaskin via use-livecode 
>  wrote:
> 
> David Bovill wrote:
> 
> > I would love to be able to change the characters that merge uses -
> > especially from “[[..]]” to “{{...}}”.
> >
> > Quite a lot of templating uses curly brackets - and I especially want
> > to use it for wiki style templates which can’t use square brackets as
> > they are used for internal links.
> 
> Only LC can process the LC-specific code inside of its brackets.  With the 
> current setup it allows LC to be used very gracefully as a preprocessor with 
> curly-bracket-based systems, so LC processes its stuff without stepping on 
> directives for other processors.
> 
> -- 
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> 
> ambassa...@fourthworld.comhttp://www.FourthWorld.com
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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

Re: Livecode Server GoDaddy

2019-01-02 Thread Keith Clarke via use-livecode
It’s a few months ago now and I’m no linux expert so not good with logs, etc. 
Maybe the first check is whether the hosting is CentOS 6 or 7? 

When I hit these issues, I started a thread on this list “LiveCode Server on 
CentOS 6?” on 28 July, 2018. Warren Samples kindly confirmed that glibc 2.13+ 
was required for LC 8 & 9, he had LC Server running on CentOS 7 and CentOS 
ships with glibc 2.12, which is too old.

Apparently the command ldd --version might reveal what’s running.

Best,
Keith

> On 2 Jan 2019, at 20:24, Ralph DiMola via use-livecode 
>  wrote:
> 
> Where did you see that error? The error log is empty.
> 
> That's very depressing. I sold this based on the info I got from the GoDaddy
> sales team before I signed up.
> 
> 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 Keith Clarke via use-livecode
> Sent: Wednesday, January 02, 2019 2:48 PM
> To: How to use LiveCode
> Cc: Keith Clarke
> Subject: Re: Livecode Server GoDaddy
> 
> Ralph, I gave up on getting LCS running on a GoDaddy VPS back in the summer
> as it was too old at CentOS 6 with dependencies on glibc failing - I was
> getting 500 errors IIRC.
> 
> Good luck!
> 
> Keith
> 
>> On 2 Jan 2019, at 19:42, Ralph DiMola via use-livecode
>  wrote:
>> 
>> I keep getting 500 errors. I changed the htacces file to point .lc 
>> files to the livecode server executable. Log files have no useful 
>> info. The error log has nothing.
>> Has anyone gotten LC Server working on GoDaddy shared hosting?
>> 
>> Thanks
>> 
>> Ralph DiMola
>> IT Director
>> Evergreen Information Services
>> rdim...@evergreeninfo.net
>> 
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> ___
> use-livecode mailing list
> use-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 Server GoDaddy

2019-01-02 Thread Keith Clarke via use-livecode
Ralph, I gave up on getting LCS running on a GoDaddy VPS back in the summer as 
it was too old at CentOS 6 with dependencies on glibc failing - I was getting 
500 errors IIRC.

Good luck!

Keith

> On 2 Jan 2019, at 19:42, Ralph DiMola via use-livecode 
>  wrote:
> 
> I keep getting 500 errors. I changed the htacces file to point .lc files to
> the livecode server executable. Log files have no useful info. The error log
> has nothing.
> Has anyone gotten LC Server working on GoDaddy shared hosting?
> 
> Thanks
> 
> Ralph DiMola
> IT Director
> Evergreen Information Services
> rdim...@evergreeninfo.net
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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


Re: Troubleshooting revIgniter library functions

2018-11-30 Thread Keith Clarke via use-livecode
Brilliant - thanks for the analysis and syntax corrections, Ralf. 

That’s clarified more of the LCS / MVC ‘plumbing' and provided a worked example 
I can repeat as I start to build-out the app proper.

Much appreciated
Best,
Keith  

> On 30 Nov 2018, at 22:56, Ralf Bitter via use-livecode 
>  wrote:
> 
> Hi Keith,
> 
> seems that you have overlooked that your library  
> handler is not a function, see line  
> 
>   put somehandler() into gData["testlib"]
> 
> in your controller.  
> 
> Furthermore don’t forget to adjust the name of your library  
> initialisation handler to “rigRunInitialteslibConfig”.  
> 
> 
> Ralf
> 
> 
> 
>> On 30. Nov 2018, at 18:26, Keith Clarke via use-livecode 
>>  wrote:
>> 
>> Thanks Ralf. Renaming the library got past that library load error. However, 
>> the view page is listing other errors, which may hint at other mistakes I’ve 
>> made.
>> 
>> The key page markup is below - I’d appreciate any advice.
> 
> 
> ___
> use-livecode mailing list
> use-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: Setting hidden of lines very slow

2018-11-30 Thread Keith Clarke via use-livecode
In jQuery it’d be something like $j(‘div #id’).text(); selecting the field’s 
enclosing div by ID or class. 

Best,
Keith

> On 30 Nov 2018, at 17:43, Bob Sneidar via use-livecode 
>  wrote:
> 
> And how much would the Javascript training and certification cost be to learn 
> how to do it? ;-)
> 
> Bob S
> 
> 
>> On Nov 30, 2018, at 09:17 , Kaveh Bazargan via use-livecode 
>>  wrote:
>> 
>>> FWIW, the fastest way that I know to remove all text stylings from a field
>>> of text is this:
>>> 
>>> put fld 1 into fld 1
>>> 
>>> 
>> That's poetically beautiful. Now how many lines of JavaScript would that
>> be? ;-)
> 
> 
> ___
> use-livecode mailing list
> use-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: Troubleshooting revIgniter library functions

2018-11-30 Thread Keith Clarke via use-livecode
Thanks Ralf. Renaming the library got past that library load error. However, 
the view page is listing other errors, which may hint at other mistakes I’ve 
made.

The key page markup is below - I’d appreciate any advice.

**

The testlib.lc library content is just the prototype with a “Hello World” test 
return in the example handler...

[[gData["testlib"] ]]



The inline error list override of the view page may provide some clues (paths 
truncated with ‘…' ) ...
file “/.../system/application/config/autoload.lc"
file “/.../system/libraries/Controller.lc"
file “/.../system/libraries/Loader.lc"
file “/.../system/libraries/Language.lc"
file “/.../system/libraries/Output.lc"
file “/.../system/application/config/routes.lc"
file “/.../system/libraries/Input.lc"
file “/.../system/libraries/Router.lc"
file “/.../system/libraries/Config.lc"
file “/.../system/libraries/URI.lc"
file “/.../system/libraries/Log.lc"
file “/.../system/libraries/Hooks.lc"
file “/.../system/libraries/Benchmark.lc"
file “/.../system/application/config/config.lc"
file “/.../system/revigniter/Common.lc"
file “/.../system/application/config/constants.lc"
file “/.../system/revigniter/RevIgniter.lc"
file “/.../index.lc"
file “/.../system/application/config/config.lc"
  row 1822, col 1: Handler: can't find handler (rigRunInitialtestlibConfig)
  row 1823, col 1: do: error in statement (rigRunInitialtestlibConfig "")
  row 1823, col 1: if-then: error in statement
  row 1819, col 1: Handler: error in statement (_rigRiInitLibrary)
  row 1284, col 1: Handler: can't find handler (_rigRiInitLibrary)
  row 1284, col 1: repeat: error in statement
  row 1284, col 1: repeat: error in statement
  row 1187, col 1: Handler: error in statement (_rigLoadLibrary)
  row 106, col 1: Handler: can't find handler (_rigLoadLibrary)
  row 106, col 1: if-then: error in statement
  row 106, col 1: if-then: error in statement
  row 95, col 1: Handler: error in statement (rigLoaderLoadLibrary)
file “/.../system/revigniter/RevIgniter.lc"
  row 13, col 1: Handler: can't find handler (rigLoaderLoadLibrary)
  row 13, col 1: Handler: error in statement (home)
file “/.../system/application/controllers/home.lc"
  row 399, col 1: Handler: can't find handler (home)
  row 400, col 1: do: error in statement (home)
  row 400, col 1: if-then: error in statement
  row 400, col 1: if-then: error in statement
  row 387, col 1: Handler: error in statement (_rigDo)
  row 273, col 1: Handler: can't find handler (_rigDo)
file “/.../system/application/libraries/testlib.lc"
Best,
Keith

> On 30 Nov 2018, at 16:14, Ralf Bitter via use-livecode 
>  wrote:
> 
> Hi Keith,
> 
> if you change the name of your library to Testlib.lc
> and if you adjust the name in your controller respectively
> all should work as expected.
> There is a naming convention for library files, i.e.
> camel case is not allowed, but it seems this is not
> mentioned in the user guide.
> Sorry for the hassle. Will fix that.
> 
> 
> Ralf
> 
>> On 30. Nov 2018, at 15:23, Keith Clarke via use-livecode 
>>  wrote:
>> 
>> Thanks Ralf (& Andre) for the responses.
>> 
>> I have read the user guide and understood more than I expected, given my 
>> basic HTML + jQuery + CSS background! I’ve also been learning more as I 
>> build my app out using user guide worked examples where they exist.
>> 
>> Thanks for the syntax for processing the response returned from the library 
>> - I know understand the central role of the controller page and how that 
>> call & response should work. 
>> 
>> Thanks also for the tip regarding the log, as that has proven more 
>> revealing… errors when attempting to load library files into any controllers.
>> 
>> Stripping back to basics, I have created a testLib.lc library file in the 
>> default system/application/libraries folder that contains just the prototype 
>> markup from the user guide.
>> 
>> My default controller is home.lc (copied from welcome.lc) which throws an 
>> error "Unable to load the requested library:Testlib” if I add 
>> 'rigLoaderLoadLibrary “testLib” ‘ to the home or index handler markup.
>> 
>> Any clues as to what I may have missed?  
>> 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: Troubleshooting revIgniter library functions

2018-11-30 Thread Keith Clarke via use-livecode
Thanks Ralf (& Andre) for the responses.

I have read the user guide and understood more than I expected, given my basic 
HTML + jQuery + CSS background! I’ve also been learning more as I build my app 
out using user guide worked examples where they exist.

Thanks for the syntax for processing the response returned from the library - I 
know understand the central role of the controller page and how that call & 
response should work. 

Thanks also for the tip regarding the log, as that has proven more revealing… 
errors when attempting to load library files into any controllers.

Stripping back to basics, I have created a testLib.lc library file in the 
default system/application/libraries folder that contains just the prototype 
markup from the user guide.

My default controller is home.lc (copied from welcome.lc) which throws an error 
"Unable to load the requested library:Testlib” if I add 'rigLoaderLoadLibrary 
“testLib” ‘ to the home or index handler markup.

Any clues as to what I may have missed?  
Thanks
Keith

> On 30 Nov 2018, at 12:37, Ralf Bitter via use-livecode 
>  wrote:
> 
> Hi Keith,  
> 
> in addition to Andre’s valuable tips I would like  
> to comment that your approach should actually work,  
> but be advised to make sure you include your custom  
> library as described here:  
> 
> https://revigniter.com/userGuide/general/creating_libraries.html  
> 
> Furthermore you can leave your function as is i.e.  
> call your library function within your DocLogin.lc controller like:  
> 
>   put myDocLoginHandler() into gData["doc_token"]
>   
> For debugging purposes make sure the logs folder is writable,  
> set the gConfig["logThreshold"]  in config.lc to 4 and check the  
> log file in case something goes wrong.  
> 
> 
> Ralf  
> 
>> On 30. Nov 2018, at 10:32, Keith Clarke via use-livecode 
>>  wrote:
>> 
>> Folks,
>> I’m struggling to get my head around revIgniter / MVC concepts and map basic 
>> LC desktop concepts to the right places in LCS + revIgniter. (I’m still 
>> searching for a 'Rosetta Stone’ to translate between these two worlds!)  
>> 
>> My use case is to share public FAQs from specific pages designated as public 
>> in our knowledge base. I have a basic LC desktop prototype that I’m 
>> migrating to LCS + revIgniter. The desktop stack includes a single function 
>> stack script that logs into the KB server as a proxy ‘public user' and 
>> returns an access token string for subsequent page requests. 
>> 
>> To migrate this across to the server environment, I have simply transferred 
>> the stack script into a DocLogin.lc library file, replacing the final 
>> 'return “token”’ with put tToken into gData[“doc_token”] I may have 
>> misunderstood the revIgniter docs that this is the way to get the data 
>> ‘back’ to the controller, rather than use the desktop-style function do & 
>> return to a library (or stack) file?
>> 
>> A DocLogin.lc controller file then attempts to call the above library and 
>> open a view file to check that the token is available via 
>> [[gData[“doc_token"] ]] 
>> 
>> The controller is opening the view but the token merge field is not shown 
>> and adding the generic rigShowError “message” alerts that the library 
>> couldn’t be loaded. 
>> 
>> I’d appreciate a steer as I’ve a feeling my approach here is fundamentally 
>> wrong for the LCS + revIgniter way of working.
>> 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: LiveCode equivalent to 'cron' for automated background functions?

2018-11-30 Thread Keith Clarke via use-livecode
Thanks Andre - good call. 
Following others’ reminders of the single-threaded nature of LCS, I’m trying to 
rethink data flows as on-demand, to avoid all background tasks.
Best,
Keith

> On 30 Nov 2018, at 12:10, Andre Alves Garzia via use-livecode 
>  wrote:
> 
> Keith,
> 
> 
>> The examples in the dictionary look potentially useful for a couple of 
>> lightweight activities I’d like to have ticking-over in the background on my 
>> LC Server, pending page visits.
> 
> You shouldn't have the CGI engine hogging up like that, thats not how web 
> stuff is supposed to work. First, Apache (or whatever you're running) will 
> kill the process after some seconds if it fails to exit on its own. Second, 
> it is a waste of resources. Imagine that you have this running for every 
> request that is made, so each time a user requests your site, your LC Server 
> engine hangs in the background for a while, hogging up system resources.
> 
> LC Servers should reply as fast as possible and then exit. If you need a long 
> running process to do some administrative stuff regularly, then, consider 
> building a little script and running that as a real proper cronjob on the 
> server, not tied to visits.
> 
> Cheers
> 
> andre
> 
> 
> 
> 
> ___
> use-livecode mailing list
> use-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

Troubleshooting revIgniter library functions

2018-11-30 Thread Keith Clarke via use-livecode
Folks,
I’m struggling to get my head around revIgniter / MVC concepts and map basic LC 
desktop concepts to the right places in LCS + revIgniter. (I’m still searching 
for a 'Rosetta Stone’ to translate between these two worlds!)  

My use case is to share public FAQs from specific pages designated as public in 
our knowledge base. I have a basic LC desktop prototype that I’m migrating to 
LCS + revIgniter. The desktop stack includes a single function stack script 
that logs into the KB server as a proxy ‘public user' and returns an access 
token string for subsequent page requests. 

To migrate this across to the server environment, I have simply transferred the 
stack script into a DocLogin.lc library file, replacing the final 'return 
“token”’ with put tToken into gData[“doc_token”] I may have misunderstood the 
revIgniter docs that this is the way to get the data ‘back’ to the controller, 
rather than use the desktop-style function do & return to a library (or stack) 
file?

A DocLogin.lc controller file then attempts to call the above library and open 
a view file to check that the token is available via [[gData[“doc_token"] ]] 

The controller is opening the view but the token merge field is not shown and 
adding the generic rigShowError “message” alerts that the library couldn’t be 
loaded. 

I’d appreciate a steer as I’ve a feeling my approach here is fundamentally 
wrong for the LCS + revIgniter way of working.
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

Re: LiveCode equivalent to 'cron' for automated background functions?

2018-11-29 Thread Keith Clarke via use-livecode
Thanks for the really useful responses Richard, Alex & Tom - great to know the 
art of the possible.
I think most of my current use cases will be supported by send with time, as 
they’re more lightweight ’tick-over’ activities than big batch jobs.
Best,
Keith

> On 28 Nov 2018, at 21:51, Richard Gaskin via use-livecode 
>  wrote:
> 
> Alex Tweedly wrote:
> 
> > On 28/11/2018 20:45, Richard Gaskin via use-livecode wrote:
> >>
> >> FWIW, cron is for periodic tasks.  If you need a one-off at a
> >> specific time see at.
> >>
> >> But can be managed from the command line, which means you can drive
> >> them from LC if needed through the shell function.
> >>
> > And. conversely, you can drive LC from cron - i.e. to schedule
> > something regular, just use cron, and make the cron task be something
> > like
> >
> > wget https://mydomain.com/index.lc/domynightlytask
> >
> > so you get to script the task in your usual way (e.g. within
> > revigniter), and do the scheduling with cron (generally accessible
> > from cPanel as well as shell).
> 
> And for local tasks:
> 
>   ~/somescript.lc
> 
> ...where line 1 of somescript.lc is:
> 
> #!/path/to/your/copy/of/livecodeserver
> 
> 
> Or launch the engine and specify the script in the command line:
> 
> ~/livecode-server  somescript.lc
> 
> 
> Lots of flexibility mixing and matching LC with other tools to make the best 
> use of what each brings to the table.
> 
> -- 
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> 
> ambassa...@fourthworld.comhttp://www.FourthWorld.com
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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

Re: LiveCode equivalent to 'cron' for automated background functions?

2018-11-28 Thread Keith Clarke via use-livecode
Thanks Mike, I was aware of ‘do’ but hadn’t used ’send’, so not seen its timer 
aspect.

The examples in the dictionary look potentially useful for a couple of 
lightweight activities I’d like to have ticking-over in the background on my LC 
Server, pending page visits.  
Best,
Keith 

> On 28 Nov 2018, at 17:30, Mike Kerner via use-livecode 
>  wrote:
> 
> In the meantime, there are two commands to have a look at if you want to
> have a crack at rolling your own
> send and do
> send "doSomething" to me in 60 seconds
> then there is a way to see if you're interrupting an asynchronous activity
> pendingMessages
> 
> On Wed, Nov 28, 2018 at 12:02 PM Mike Kerner 
> wrote:
> 
>> LC is single-threaded so CRON is a little tricky.  I have code that works
>> with those limitations.  I suppose I should repo it.  Some day I might even
>> get the secondary process part working.
>> 
>> On Wed, Nov 28, 2018 at 11:15 AM Keith Clarke via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>> 
>>> Folks,
>>> Please can anyone steer me towards the dictionary keyword equivalent to
>>> ‘cron' jobs for initiating time-based background functions, along the lines
>>> of…
>>> 
>>> on TimeAt pHour pMinute pSecond
>>>do stuff
>>> end TimeAt
>>> 
>>> 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
>> 
>> 
>> 
>> --
>> On the first day, God created the heavens and the Earth
>> On the second day, God created the oceans.
>> On the third day, God put the animals on hold for a few hours,
>>   and did a little diving.
>> And God said, "This is good."
>> 
> 
> 
> -- 
> On the first day, God created the heavens and the Earth
> On the second day, God created the oceans.
> On the third day, God put the animals on hold for a few hours,
>   and did a little diving.
> And God said, "This is good."
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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

LiveCode equivalent to 'cron' for automated background functions?

2018-11-28 Thread Keith Clarke via use-livecode
Folks,
Please can anyone steer me towards the dictionary keyword equivalent to ‘cron' 
jobs for initiating time-based background functions, along the lines of…

on TimeAt pHour pMinute pSecond
do stuff
end TimeAt

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

Re: LiveCode server with revIgniter - new controller pages get 404 errors?

2018-11-28 Thread Keith Clarke via use-livecode
No worries, Ralf. Thanks for your response and your efforts with revIgniter - 
I’m very impressed with what I’ve discovered (& learned) so far! :-)
Best,
Keith

> On 28 Nov 2018, at 12:05, Ralf Bitter via use-livecode 
>  wrote:
> 
> Hi Keith,
> 
> sorry for responding late. Glad you found
> the source of the issue, and thanks for the
> suggestion to improve the docs, changed
> the user guide accordingly.
> 
> 
> Thanks again
> 
> Ralf
> 
> 
>> On 28. Nov 2018, at 11:03, Keith Clarke via use-livecode 
>>  wrote:
>> 
>> Fixed shared for future reference…. 
>> 
>> This issue was down to me missing the need for a required change to 
>> system/application/config/config.lc when using .htaccess to hide the 
>> index.lc page from the URIs structure.
>> 
>> This setting is clearly documented within the config.lc file, in the 'Index 
>> file'... "If you are using mod_rewrite to remove the page set this variable 
>> so that it is blank." i.e. 'put empty into gConfig["indexPage”]' ). The 
>> config.lc file is also mentioned specifically in the user guide section on 
>> ‘revIgniter URIs: Removing the index.lc file’ 
>> https://revigniter.com/userGuide/general/urls.html However, the 
>> cross-reference is for other use cases and their troubleshooting - there’s 
>> no specific mention of the change required when seeking to hide the index 
>> page with the example .htaccess file.
>> 
>> Ideally, this use case of the (excellent) docs could be extended slightly to 
>> close this gap, along the following lines...
>> 
>> "In the above example, any HTTP request other than those for index.lc, 
>> images, assets, robots.txt, css and js is treated as a request for your 
>> index.lc file. If you use this method to remove the page, set the Index file 
>> variable in your application/config/config.lc file so that it is blank."
>> 
>> Best,
>> Keith
>> 
>>> On 27 Nov 2018, at 19:02, Keith Clarke  wrote:
>>> 
>>> Folks,
>>> Can anyone using LC Server with revIgniter share any tips on why new 
>>> controller pages might throw 404 errors, even if they contains the content 
>>> from the (working) welcome.lc controller or blog.lc example from the 
>>> revIgniter docs…? https://revigniter.com/userGuide/general/controllers.html
>>> 
>>> My new (as in newbie) setup is sitting on an add-on domain on my on-rev 
>>> account. The index.lc page worked, so I implemented the default .htaccess 
>>> file to hide the index.lc page.
>>> 
>>> This works as expected - I get the expected welcome.lc view page content 
>>> whether I navigate to 'https://domain’ or ‘https://domain/index.lc’ 
>>> 
>>> However, I  get 404 errors at 'https://domain/blog’ & 
>>> ‘https://domain/index.lc/blog’ (with or without trailing slash or ‘.lc’ 
>>> suffix) when working through the doc examples.
>>> 
>>> It seems to be just the new files that are causing issues but file 
>>> permissions look OK at 0644 - the same as the working pages.
>>> 
>>> 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


___
use-livecode mailing list
use-livecode@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 server with revIgniter - new controller pages get 404 errors?

2018-11-28 Thread Keith Clarke via use-livecode
Fixed shared for future reference…. 

This issue was down to me missing the need for a required change to 
system/application/config/config.lc when using .htaccess to hide the index.lc 
page from the URIs structure.

This setting is clearly documented within the config.lc file, in the 'Index 
file'... "If you are using mod_rewrite to remove the page set this variable so 
that it is blank." i.e. 'put empty into gConfig["indexPage”]' ). The config.lc 
file is also mentioned specifically in the user guide section on ‘revIgniter 
URIs: Removing the index.lc file’ 
https://revigniter.com/userGuide/general/urls.html However, the cross-reference 
is for other use cases and their troubleshooting - there’s no specific mention 
of the change required when seeking to hide the index page with the example 
.htaccess file.

Ideally, this use case of the (excellent) docs could be extended slightly to 
close this gap, along the following lines...

"In the above example, any HTTP request other than those for index.lc, images, 
assets, robots.txt, css and js is treated as a request for your index.lc file. 
If you use this method to remove the page, set the Index file variable in your 
application/config/config.lc file so that it is blank."

Best,
Keith

> On 27 Nov 2018, at 19:02, Keith Clarke  wrote:
> 
> Folks,
> Can anyone using LC Server with revIgniter share any tips on why new 
> controller pages might throw 404 errors, even if they contains the content 
> from the (working) welcome.lc controller or blog.lc example from the 
> revIgniter docs…? https://revigniter.com/userGuide/general/controllers.html
> 
> My new (as in newbie) setup is sitting on an add-on domain on my on-rev 
> account. The index.lc page worked, so I implemented the default .htaccess 
> file to hide the index.lc page.
> 
> This works as expected - I get the expected welcome.lc view page content 
> whether I navigate to 'https://domain’ or ‘https://domain/index.lc’ 
> 
> However, I  get 404 errors at 'https://domain/blog’ & 
> ‘https://domain/index.lc/blog’ (with or without trailing slash or ‘.lc’ 
> suffix) when working through the doc examples.
> 
> It seems to be just the new files that are causing issues but file 
> permissions look OK at 0644 - the same as the working pages.
> 
> 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

LiveCode server with revIgniter - new controller pages get 404 errors?

2018-11-27 Thread Keith Clarke via use-livecode
Folks,
Can anyone using LC Server with revIgniter share any tips on why new controller 
pages might throw 404 errors, even if they contains the content from the 
(working) welcome.lc controller or blog.lc example from the revIgniter docs…? 
https://revigniter.com/userGuide/general/controllers.html

My new (as in newbie) setup is sitting on an add-on domain on my on-rev 
account. The index.lc page worked, so I implemented the default .htaccess file 
to hide the index.lc page.

This works as expected - I get the expected welcome.lc view page content 
whether I navigate to 'https://domain’ or ‘https://domain/index.lc’ 

However, I  get 404 errors at 'https://domain/blog’ & 
‘https://domain/index.lc/blog’ (with or without trailing slash or ‘.lc’ suffix) 
when working through the doc examples.

It seems to be just the new files that are causing issues but file permissions 
look OK at 0644 - the same as the working pages.

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

Re: How to extract an entire element from an HTML file?

2018-11-26 Thread Keith Clarke via use-livecode
Thanks for the warning and the link to the parsers, Trevor. 

I get the point regarding unclean HTML - as I won’t be in control of the 
source. Following a cursory glance through the dictionary, I’m also a tad 
concerned about the variability in HTML tag content (e.g. 

content & elements
vs.
content & elements

...and hence, how much wrangling might be needed to identify all the nodes in 
the tree with a specific class, where jQuery’s "$j(‘.red’).html();” saves a lot 
of the heavy lifting involved.

I’ll have a look at those parsers, too - though I doubt my coding chops are up 
to creating a library wrapper - indeed, I’ll have to Google what one is! :-)
Best,
Keith

> On 26 Nov 2018, at 13:42, Trevor DeVore via use-livecode 
>  wrote:
> 
> On Mon, Nov 26, 2018 at 3:30 AM Keith Clarke via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> 
>> Thanks for the steer, Paul - I’ve not worked with XML in LiveCode so
>> hadn’t made the connection between the HTML markup structure & XML.
> 
> 
> Keith,
> 
> I’ve used revXML for parsing HTML in somewhat controlled conditions. While
> revXML can work for HTML, your results will vary based on how well
> structured the HTML is. If there are tags that are not closed or are out of
> balance then revXML won’t give you the results you expect. If you are
> generating the HTML then it shouldn’t be a problem. If it is third party
> HTML then you may have to massage the HTML input to get it to work.
> 
> It would be great if there were a library wrapper around one of the
> dedicated HTML parsers listed on this page:
> 
> https://en.m.wikipedia.org/wiki/Comparison_of_HTML_parsers
> 
> -- 
> Trevor DeVore
> ScreenSteps
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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

Re: How to extract an entire element from an HTML file?

2018-11-26 Thread Keith Clarke via use-livecode
Thanks for the steer, Paul - I’ve not worked with XML in LiveCode so hadn’t 
made the connection between the HTML markup structure & XML.

A quick scan through suggests that this library could prove really useful - 
I’ll dig further and look for related resources, thanks.
Best,
Keith   

> On 25 Nov 2018, at 13:55, Paul Dupuis via use-livecode 
>  wrote:
> 
> You could do this with revXML (see teh dictionary), but it is not a
> single call.
> 
> 
> On 11/25/2018 7:12 AM, Keith Clarke via use-livecode wrote:
>> Folks,
>> Can anyone please guide me towards an LiveCode feature(s) that might provide 
>> the equivalent to the javascript jQuery library’s "jQuery(‘.class’).html();" 
>> mechanism that allows one to select an entire element’s content (including 
>> nested elements) from the page DOM?
>> 
>> I have experimented with using jQuery in a browser widget for this purpose 
>> but it introduces dependencies & integration complexities - and I’d prefer 
>> to work without necessitating a desktop UI to contain for the browser 
>> widget, so the code could potentially run on LC Server. 
>> 
>> I can see how I might build a 'roll-your-own' approach, using LiveCode’s 
>> powerful text & chunk features. This would seem to need the HTML file to be 
>> pre-processed, to iterate through the tags of the text file to both find & 
>> mark both each nesting level within elements and also ‘pair-up’ the 
>> (anonymous) closing tags.
>> 
>> Is there a smarter way - any HTML parsing utilities/libraries/lessons/stacks 
>> I should study?
>> 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


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

How to extract an entire element from an HTML file?

2018-11-25 Thread Keith Clarke via use-livecode
Folks,
Can anyone please guide me towards an LiveCode feature(s) that might provide 
the equivalent to the javascript jQuery library’s "jQuery(‘.class’).html();" 
mechanism that allows one to select an entire element’s content (including 
nested elements) from the page DOM?

I have experimented with using jQuery in a browser widget for this purpose but 
it introduces dependencies & integration complexities - and I’d prefer to work 
without necessitating a desktop UI to contain for the browser widget, so the 
code could potentially run on LC Server. 

I can see how I might build a 'roll-your-own' approach, using LiveCode’s 
powerful text & chunk features. This would seem to need the HTML file to be 
pre-processed, to iterate through the tags of the text file to both find & mark 
both each nesting level within elements and also ‘pair-up’ the (anonymous) 
closing tags.

Is there a smarter way - any HTML parsing utilities/libraries/lessons/stacks I 
should study?
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

Re: LiveCode Server syntax to call function in CGI folder

2018-11-23 Thread Keith Clarke via use-livecode
Thanks Matthias, '’ worked a treat. 

I was overthinking the security aspects and attempting to call the private CGI 
function from ‘across the divide’ in the public_html root rather than include 
the CGI files.

Clearly too much time spent with javascript, where included files are visible 
client-side in the browser (and its dev tools). Now I can see that the included 
LiveCode scripts stay server-side …and private!
 
Best,
Keith

> On 23 Nov 2018, at 20:37, Matthias Rebbe via use-livecode 
>  wrote:
> 
> Do you want to call an .lc file from outside the public_html file?
> If so then
> copy the .lc file  (lets say myscript.lc) to outside of the public_html, for 
> example to /home/custom_scripts.
> 
> Then in your .lc file in public_html use
> 
> include "home/custom_scripts/myscript.lc
> 
> to include the script myscript.lc into your main script.
> 
> Regards,
> 
> Matthias
> 
> 
> Matthias Rebbe
> 
> free tools for Livecoders:
> https://instamaker.dermattes.de
> https://winsignhelper.dermattes.de
> 
>> Am 23.11.2018 um 21:21 schrieb Keith Clarke via use-livecode 
>> :
>> 
>> Folks,
>> Can anyone please steer me to any docs explaining the (relative?) path 
>> syntax needed to traverse from a public file 'public_html/index.lc' to more 
>> private resources in 'public_html/CGI’ folder, to:
>> 1: Require CGI/myFile.lc?  
>> 2: Call myFunction() in CGI/myFile.lc?
>> 
>> The LC Server introductory lessons don’t seem to cover how to split 
>> public/private assets - unless I’m missing something?
>> 
>> Thanks in advance
>> 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


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

LiveCode Server syntax to call function in CGI folder

2018-11-23 Thread Keith Clarke via use-livecode
Folks,
Can anyone please steer me to any docs explaining the (relative?) path syntax 
needed to traverse from a public file 'public_html/index.lc' to more private 
resources in 'public_html/CGI’ folder, to:
1: Require CGI/myFile.lc?  
2: Call myFunction() in CGI/myFile.lc?

The LC Server introductory lessons don’t seem to cover how to split 
public/private assets - unless I’m missing something?

Thanks in advance
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

Re: How to diagnose browser widget JS handlers failing silently?

2018-11-23 Thread Keith Clarke via use-livecode
Thanks for the response, Herman.

In the error state I’m getting, the LC JShandler script parameters are empty 
and so far, I’m having no luck with getting toString(); to stringify javascript 
objects such that LC doesn’t fail silently.

Indeed, your test scripts fail in my situation - so I’m going to have to create 
a simpler test-bed.
Best,
Keith

> On 14 Nov 2018, at 16:34, hh via use-livecode  
> wrote:
> 
> You can use the params to see what arrives.
> 
> Most probably you didn't convert the parameters of the handler
> in the JavaScript to arrays or strings.
> 
> LiveCode expects strings or arrays as params of javaScriptHandlers.
> 
> So "combine" on the LC side and/or ".toString()" on the JS side are
> your friends.
> 
> Example test:
> 
> -- script of the widget (or above it in the message path)
> on JS u,v,w -- a javaScriptHandler of widget "browser"
>  if u is an array then combine u with ":"
>  put u & cr & v & cr & w
> end JS
> 
> on mouseUp
>  do "var x=[1,2,3], y='hello'; " & \
>"liveCode.JS(x, y, x.toString())" in widget "browser"
> end mouseUp
> 
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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

How to diagnose browser widget JS handlers failing silently?

2018-11-14 Thread Keith Clarke via use-livecode
Folks,
Is there any way to see the raw message that arrive in LC from javascripts in a 
browser widget?

I’m getting silent failures on some JSHandlers and would like to determine 
whether it’s JS failing to send (unlikely as they’re variations on working 
themes) or LC rejecting the inbound message due to syntax, unescaped quotes, 
etc.
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

Re: LiveCoders from London, lets meet!

2018-11-09 Thread Keith Clarke via use-livecode
Andre, I’m based near London and would be happy to meet in Town & buy you a 
beer. :-)
Best,
Keith

> On 9 Nov 2018, at 17:04, Andre Alves Garzia via use-livecode 
>  wrote:
> 
> Hey Friends,
> 
> Who here is from London or nearby and would be interested in regular meetups? 
> We could meet once a month or so in a pub or quieter setting. I am thinking 
> of informal meet & drink, chatting.
> 
> Cheers
> 
> andre
> 
> 
> ___
> use-livecode mailing list
> use-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: Where is the declarative border color setting in the property

2018-11-09 Thread Keith Clarke via use-livecode
D’Oh - of course, in LC the basic 'border fill' = CSS ‘border: color' (as shown 
in the clearly 'not-quite-idiot-proof' tool-tip!). Thanks!

Sorry to waste your time - I’m jumping between LC, Javascript and CSS and my 
Babel Fish has clearly fallen asleep or out… 
https://www.youtube.com/watch?v=YWqHkYtREAE 

  …boy am I glad the weekend is fast-approaching! :-)
Best,
Keith  

> On 9 Nov 2018, at 11:41, Niggemann, Bernd via use-livecode 
>  wrote:
> 
> Keith,
> 
> I see "Border fill" when the preference setting is "Description of option" 
> for a field. For an image I see "Border/grid Color" with the same setting.
> 
> Since I always have "Name of Livecode Property" set in Preferences I never 
> noticed the difference.
> 
> Anyhow the tooltip shows the alternative option
> 
> Kind regards
> 
> Bernd
> 
> 
> Thanks Bernd. That’s exactly what I was expecting, but see neither - 'Border
> fill' is the only Border color property I see in the list?!?
> 
> Could I have accidentally set something to hide this?
> Best,
> Keith
> 
> 
> Am 09.11.2018 um 12:13 schrieb berndnig 
> mailto:bernd.niggem...@uni-wh.de>>:
> 
> Keith,
> 
> depending on your settings in Preferences -> General -> "Description of 
> option" or "Name of Livecode Property" border color will show up in 
> Properties Inspector in tab "Colors" as
> 
> "Border/grid Color" or "borderColor"
> 
> Kind regards
> Bernd
> 
> 
> Date: Fri, 09 Nov 2018 09:02:18 +
> From: Keith Clarke
> 
> Folks,
> Am I missing something - has border color been removed from the Property 
> Inspector?s ?colors? tab or has one always had to code this?
> 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: Where is the declarative border color setting in the property

2018-11-09 Thread Keith Clarke via use-livecode
Thanks Bernd. That’s exactly what I was expecting, but see neither - 'Border 
fill' is the only Border color property I see in the list?!?

Could I have accidentally set something to hide this?
Best,
Keith  

> On 9 Nov 2018, at 11:13, Niggemann, Bernd via use-livecode 
>  wrote:
> 
> Keith,
> 
> depending on your settings in Preferences -> General -> "Description of 
> option" or "Name of Livecode Property" border color will show up in 
> Properties Inspector in tab "Colors" as 
> 
> "Border/grid Color" or "borderColor"
> 
> Kind regards
> Bernd
> 
> 
>> Date: Fri, 09 Nov 2018 09:02:18 +
>> From: Keith Clarke
> 
>> Folks,
>> Am I missing something - has border color been removed from the Property 
>> Inspector?s ?colors? tab or has one always had to code this?
>> 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

Where is the declarative border color setting in the property inspector?

2018-11-09 Thread Keith Clarke via use-livecode
Folks,
Am I missing something - has border color been removed from the Property 
Inspector’s ‘colors’ tab or has one always had to code this?
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

Re: Do javascript function in browser widget?

2018-11-06 Thread Keith Clarke via use-livecode
Thanks for the link, Herman - some interesting use cases there …once I’ve got 
the connectivity in place. :-)
Best,
Keith 

> On 6 Nov 2018, at 10:42, hh via use-livecode  
> wrote:
> 
> Browser widget usage examples:
> http://forums.livecode.com/viewtopic.php?f=93=29018
> 
> ___
> use-livecode mailing list
> use-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: Do javascript function in browser widget?

2018-11-06 Thread Keith Clarke via use-livecode
Thanks Andre for the detailed response and HTTPD library steer - that’s new to 
me so I shall review with interest. :-)

I’m not in control of the pages, so that may be more useful than my first 
experiments - which were to download the page content into LC, add some markup 
and load the HTML text into the browser widget as a local ‘offline’ page.
Best,
Keith

> On 6 Nov 2018, at 10:38, Andre Alves Garzia via use-livecode 
>  wrote:
> 
> Keith,
> 
> If you're in control of the HTML used in the widget, then I'd advise you to 
> build functions inside the HTML and just call them from LC instead of 
> executing script directly, such as:
> 
>  in the html 
> 
> 
> 
>  
> 
>   ...
> 
>
> 
>function paintItRed() {
> 
>  document.body.style.backgroundColor = "red";
> 
>}
> 
>
> 
>  
> 
>  
> 
>  ...
> 
>  
> 
> 
> 
> ---
> 
> 
> Then in the LC part you can do something like:
> 
> 
>   do "paintItRed()" in widget "Browser"
> 
> 
> Which is more readable. Also, the body of the function inside the HTML can be 
> as complex as you want. Now, if you're not in control of the HTML, I'd opt 
> for some out-of-the-box strategy where you have the LC HTTPD library serving 
> the JS content and then use the LC "do .. in widget" form to add a new 
> 

Do javascript function in browser widget?

2018-11-06 Thread Keith Clarke via use-livecode
Folks,
I’ve found a few examples of simple inline script injection to the browser 
widget, such as do "document.body.style.background = ‘red';" in widget 
"Browser” 

Is it possible to inject a multi-line javascript function - with variables 
definition, loops, etc - in this fashion or would the function need to be 
injected into the page within the browser as markup and then called from a 
one-line script from LiveCode?

Thanks & regards,
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

Re: How best to check if string contains any of a list of substrings?

2018-11-01 Thread Keith Clarke via use-livecode
Thanks Alex - I thought the single-pass ‘is among’ with wildcards was a 
long-shot, so I’ll concentrate on debugging the list iteration using the 
‘contains’ check. :-)

The strings & sub-strings are simple - I have a large list of URLs that need to 
be processed differently (or ignored), based on various sub-string ’signatures’ 
that route them into different ‘buckets’ in an array.

The ’signatures’ vary - hence my use of a list variable (derived from a field) 
rather than hard-coding the plain text as literals.

BTW Good spot on the asterisk wildcard characters in the contains example 
below. This is just a typo in the email - they’re not (among the numerous 
bugs!) in the real code. :-)

Thanks again for the steer.
Best,
Keith

> On 1 Nov 2018, at 10:34, Alex Tweedly via use-livecode 
>  wrote:
> 
> Hi Keith,
> 
> I think the simplest method would be (almost) your second attempt below. 
> However, you were using "*est*" - i.e. with the '*'s before and after the 
> phrase, which is what you would need for 'filter' but not for 'contains'. So 
> it should work with just
> 
>> put “my test phrase” into myTestPhrase
>> put “est” & cr & “phr” into tSubstrings
>> 
>> repeat for each line L in tSubstrings
>>  if myTestPhrase contains L then answer “true”
>> end repeat
> There's almost certainly also a way of doing it in a single pass using regex 
> - but I'm not brave enough to go there :-)
> 
> Are you expecting reallylarge strings to search ?  Or really many phrases to 
> search for ?
> 
> "beware optimizing something that is just plain fast enough already"
> 
> Alex.
> 
> On 01/11/2018 09:41, Keith Clarke via use-livecode wrote:
>> Folks,
>> What is the most efficient way to test whether a variable containing a 
>> string such as “my test phrase” contains one of several variable substrings, 
>> such as “est” OR “phr” OR... ?
>> 
>> So far I’ve tried (without luck) approaches that simplify into...
>> 
>> put “my test phrase” into myTestPhrase
>> put “*est*” & cr & “*phr*” into tSubstrings
>> 
>> if myTestPhrase is among the lines of tSubstrings then answer “true”
>> 
>> repeat for each line L in tSubstrings
>>  if myTestPhrase contains L then answer “true”
>> end repeat
>> 
>> Both seem to be failing - do I have the wrong syntax or approach to the 
>> problem?
>> 
>> TIA
>> 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


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