How can I refresh the dictionary?

LiveCode Builder is a language for extending LiveCode's capabilities, creating new object types as Widgets, and libraries that access lower-level APIs in OSes, applications, and DLLs.

Moderators: LCMark, LCfraser

Simon Knight
Posts: 919
Joined: Wed Nov 04, 2009 11:41 am

How can I refresh the dictionary?

Post by Simon Knight » Thu Jul 11, 2024 4:17 pm

I am trying to sort out the inline documentation of a Library that is written in livecode builder. At the moment I have to quit Livecode inorder to force the dictionary to update to the latest version of the in line documentation.

There has to be a better way.
best wishes
Skids

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10085
Joined: Fri Feb 19, 2010 10:17 am

Re: How can I refresh the dictionary?

Post by richmond62 » Thu Jul 11, 2024 4:28 pm

At the moment I have to quit Livecode inorder to force the dictionary to update to the latest version of the in line documentation.
Is the inline documentation being updated so frequently that you cannot afford the few minutes to quite LC and restart it?

Simon Knight
Posts: 919
Joined: Wed Nov 04, 2009 11:41 am

Re: How can I refresh the dictionary?

Post by Simon Knight » Thu Jul 11, 2024 4:32 pm

Yes!

Have you tried writing inline documentation?!! :cry: I feel like I am crawling about in a dark room looking for an exit.

(If you answered yes then what reference did you read?)
best wishes
Skids

stam
Posts: 3062
Joined: Sun Jun 04, 2006 9:39 pm

Re: How can I refresh the dictionary?

Post by stam » Thu Jul 11, 2024 4:58 pm

I got a lot of help with this from Bernd whey I released the TriState Switch script widget. Not LCB, but I think some similarities when generating the inline documentation. GitHub repo: https://github.com/stam66/tristate

I've kinda given up with this, as on working with another script widget and trying to include inline documentation, my dictionary now takes about 6 mins to load - every time... sigh (yes, even after restarts). I've got bigger fish to fry sadly...

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10085
Joined: Fri Feb 19, 2010 10:17 am

Re: How can I refresh the dictionary?

Post by richmond62 » Thu Jul 11, 2024 5:03 pm

I didn't read any reference, and my inline notes are strictly notes-to-self: and somewhat terse:
-
Screenshot 2024-07-11 at 18.57.11.png
-
Screenshot 2024-07-11 at 18.57.40.jpg
-
Screenshot 2024-07-11 at 18.58.03.png
-
And those 3 screen shots are from a single script in a single object. 8)

Some 'prawn' at a "university" I attended was burbling on about if I were hit by a bus, I should leave notes for who ever inherited my code:

this, frankly, struck me as a load of old tosh: and, much more to the point was to insert inline guff for yourself: and as I have been mucking around with my Devawriter Pro for nigh-on 14 years they are extremely useful as, normally, I haven't a clue as to what I was thinking a month ago, and a whole lot less so a decade back. :lol:

Simon Knight
Posts: 919
Joined: Wed Nov 04, 2009 11:41 am

Re: How can I refresh the dictionary?

Post by Simon Knight » Thu Jul 11, 2024 5:10 pm

#Stam,
Thanks for the link to your tristate switch which looks impressive. 6 minutes to load the dictionary seems excessive.

#Richmond,
I think we may be at crossed purposes. I'm trying to get the dictionary instructions which are built from key words and phrases in the LCB code looking o.k.
best wishes
Skids

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10085
Joined: Fri Feb 19, 2010 10:17 am

Re: How can I refresh the dictionary?

Post by richmond62 » Thu Jul 11, 2024 5:17 pm

What I understand by 'inline documentation' are notes inserted inwith code as per my screenshots.

stam
Posts: 3062
Joined: Sun Jun 04, 2006 9:39 pm

Re: How can I refresh the dictionary?

Post by stam » Thu Jul 11, 2024 5:21 pm

Simon Knight wrote:
Thu Jul 11, 2024 5:10 pm
#Stam,
Thanks for the link to your tristate switch which looks impressive. 6 minutes to load the dictionary seems excessive.
Yeah I don't know what I've done - obviously something wrong! - but have no bandwidth to troubleshoot this other widget... (this doesn't affect the tristate widget, that one loads just fine).

Hope that helps
S.

Simon Knight
Posts: 919
Joined: Wed Nov 04, 2009 11:41 am

Re: How can I refresh the dictionary?

Post by Simon Knight » Thu Jul 11, 2024 6:00 pm

Richmond
In the wonderful world of livecode builder there is the option of including the dictionary entries for the library or widget inside the livecode builder code. Unfortunately this is, I believe, in markdown format and also has to contain keywords followed by colons. The result in my case in much experimenting often with a poor result.

I say I believe its markdown but having just looked at Stam's Github it appears that html tags might be allowed. It true then I think its a new to me feature.
best wishes
Skids

stam
Posts: 3062
Joined: Sun Jun 04, 2006 9:39 pm

Re: How can I refresh the dictionary?

Post by stam » Thu Jul 11, 2024 6:58 pm

Simon Knight wrote:
Thu Jul 11, 2024 6:00 pm
Richmond
In the wonderful world of livecode builder there is the option of including the dictionary entries for the library or widget inside the livecode builder code. Unfortunately this is, I believe, in markdown format and also has to contain keywords followed by colons. The result in my case in much experimenting often with a poor result.

I say I believe its markdown but having just looked at Stam's Github it appears that html tags might be allowed. It true then I think its a new to me feature.
I'd be surprised if it was markdown - LCB probably predates the widespread adoption of MD, but it would definitely not be the first time I was wrong ;)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10085
Joined: Fri Feb 19, 2010 10:17 am

Re: How can I refresh the dictionary?

Post by richmond62 » Thu Jul 11, 2024 7:22 pm

The wonderful world of LCB might be a reflection of the wonderful minds of those who invented LCB: so, surely, as they have not, yet, headed for the hills, they should be asked directly about that: even pressed to provide some sort of handbook so LCB doesn't look like one of those limited vocabulary languages prepubescent boys often make up.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4164
Joined: Sun Jan 07, 2007 9:12 pm

Re: How can I refresh the dictionary?

Post by bn » Thu Jul 11, 2024 7:28 pm

Hi Simon,

For exactly the problem you describe namely to shorten the time to write inline documentation for LCB (and LCS widgets) I amended tinyDictionary by an option to load the LCB, livecodesript file and see what the dictionary looks like. I feel with you writing inline documentation is finicky and a quick look helps tremendously.

I append my current version here.

In case you use tinyDictionary remove your older version and replace it by the new one in the Plugins folder. Otherwise put it into the Plugins folder.
You can configure it via Menu "Development" -> "Plugins" -> "Plugins Settings"

I think Brian Milby did something similar but I can not find it on his GitHub repository.


Then in the new version of tinyDictionary choose your file
choose lcb or lcs file.png

Kind regards
Bernd

Edit: I made a mistake when choosing dictionary from .lcb files or .livecodescript files. LCB files where not available. Fixed in this version.
I also uploaded the current version to livecodeshare or "Sample Stacks"

This is the current tinyDictionary version.
Attachments
tinyDictionary_0_8_4_1.livecode.zip
(86.26 KiB) Downloaded 505 times
Last edited by bn on Mon Jul 15, 2024 4:40 pm, edited 1 time in total.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4164
Joined: Sun Jan 07, 2007 9:12 pm

Re: How can I refresh the dictionary?

Post by bn » Thu Jul 11, 2024 10:57 pm

Hi Simon,

Here is a stack that searches all LCB files that come with LC and those in your extension folder in "My Livecode" folder.

I found it helpful to see how others have written inline documentation for LCB.
If you leave the search field empty and hit return it will report all handlers of all LCB files it can find in your setup.

Also I found it useful to search for LCB syntax which sometimes is close to LCS but has some subtle differences that throw an error.

Clicking on a line will open that line in the Script Editor which of course throws a syntax error but you can still read or copy from the Script Editor.

Kind regards

Bernd
Attachments
findTextInLCB_0.3.2.livecode.zip
(5.52 KiB) Downloaded 690 times

Simon Knight
Posts: 919
Joined: Wed Nov 04, 2009 11:41 am

Re: How can I refresh the dictionary?

Post by Simon Knight » Fri Jul 12, 2024 9:49 am

Stam. Its a form of markdown although the dictionary reader throws a fit at certain special characters such as the humble colon.

Richmond. Its worse than you think; much of the printed documentation is old and out of date. So much for the aspiration that a 1000 widgets would be created by Christmas 2017 (made at the Edinburgh conference is circa 2017). To be fair the general script is very much like livecode script but as Bernd says there are differences and oddities.

For example I wanted to modify a public handler inside the library extension I am working on. I modified an existing handler trying to pass in an integer but no matter what I tried it refused to build because of a syntax error. The integer was going to be used to switch handlers depending on which version of MacOS is being used. In the end I gave up and added a new handler just for the other OS versions. Its a kludge.

Bug https://quality.livecode.com/show_bug.cgi?id=24054 shows some of the other issues I have encountered. Not all RunRev's fault as Apple do so love depreciating commands and are not that quick to update their documentation.

Bernd. Thanks for both the stacks which I will experiment with. I look forward to seeing how others have formatted their dictionary entries. I had this curious display happen this morning while I was scrolling my most recent dictionary entry
Screenshot 2024-07-12 at 08.45.21.png
Dictionary
All. How should I proceed ?

I have updated my library extension that reads calendar entries from the users calendar on MacOS. It should also work on iOS but I do not have any devices that run iOS. I have tested the library on Big Sur and Sonoma but again I don't have any other versions to test on. This is important because somewhere between Big Sur and Sonoma Apple changed their EkEventKit framework creating a new method to request permissions while depreciating the old (Sonoma now has two levels of permission for access to the calendar data). According to the documentation the change requires iOS 17 onwards to use the new ObjectiveC/Swift 'method'.

I don't think it is reasonable to test the library on all OS across Mac and iOS (let alone chip sets) so I am thinking of announcing that it exists and if anyone is interested then we can debug it together. It works correctly on my M2 machine and earlier versions worked on Big Sur.

I have no firm plans to use it myself and created it so that I could explore the Foreign Function Interface. I need to remove the kludge and I may look at adding code that adds events back into the calendar.

Thanks for reading.
best wishes
Skids

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10085
Joined: Fri Feb 19, 2010 10:17 am

Re: How can I refresh the dictionary?

Post by richmond62 » Fri Jul 12, 2024 10:07 am

Richmond. Its worse than you think
If I thought it was just about LCB I wouldn't be in the process (long and painful) of jumping ship.
Not all RunRev's fault as Apple do so love depreciating commands and are not that quick to update their documentation.
Um, Well, Err . . . as LCB, just as much as LiveCode itself, is meant to be cross-platform, surely LCB should be written in some way that it can float "transcendentally" over whatever operating system it is being deployed on?

Post Reply