Abysmal documentation for "Answer File" command

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Lagi Pittas
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 365
Joined: Mon Jun 10, 2013 1:32 pm

Abysmal documentation for "Answer File" command

Post by Lagi Pittas » Wed Oct 18, 2017 7:03 pm

Hi

I hate it when the docs are missing information and I waste an hour or so of time (this is in Version 6), But when I finally have the sense to load Version 9 DP3 and the docs are even terser and actually missing what little information was in the original I start speaking "French" (or is it Anglo Saxon)

here are the important parts of the two dictinaries

Version 6

Code: Select all

answer file with type

Type: command

Syntax: 
answer file[s] prompt [with defaultPath] [with type types [or type types ...]] windowTitle] [as sheet]
.
.
.

Summary: 
Displays a standard file dialog for the user to select a file.

Examples: 
answer file "Select a file to delete:"
answer files "Select the files you wish to process:"
answer file "Input:" with "/Macintosh HD/"
answer file (field "Prompt") with type "LiveCode Stacks|rev|RSTK"
answer files "Select the images you wish to view:" with type "JPEG Images|jpg|JPEG"
Version 9

Code: Select all

Type :command
Syntax
answer file[s] prompt [with defaultPath] [titled windowTitle] [as sheet]
SummaryDisplays a standard file dialog for the user to select a file.

.
.
.

Examples
answer file "Select a file to delete:"
if the result is not "Cancel" then
   put it into tChosenFile
   -- Use the file path as required
end if
answer files "Select the files you wish to process:"
if the result is not "Cancel" then
   put it into tChosenFiles
   repeat for each line tFile in tChosenFiles

   end repeat
end if
answer file "Input:" with "/Macintosh HD/"
I hate to think what otherinfo is missing in V9 and probably 8.

And while I'm at it I was going to buy the printed manuals bundle when they were finally printed ... until I read this in the off topic section.

Here it is to save you the time - I would have asked for my money back without compunction.

viewtopic.php?f=5&t=29177&p=154124&hili ... ed#p154124

Code: Select all

Re: Printed Dictionary Book Bundle
Report this post Quote
Post  by exheusden » Tue May 16, 2017 12:53 pm

I have read just the first 40 pages of the printed "LiveCode User Guide" and am sorry to say that I am disappointed.

Not only is there no table of contents, there is no index, so looking up topics is impossible.

If the book has bee proofread, there is little evidence of this. Just look, for example, at pages 19 and 20, where the reader is directed to "section 1.6.3 above," when there are no section numbers; the reader is further directed to various websites, whose addresses are presumably hidden under hotlinks to those sites, but, of course, hotlinks don't work from print and the actual addresses are not shown. Setting errors are rife: ""Use the LiveCode mailing list is also possible," " Tip: tip: you can use the Google search engine… using this link;" note the two "tips" and "this link" which is all you get, no actual URL.

The topic header, "Alignment & Layering" ends page 26 and this is followed by almost half a page of nothingness: an illustration of the Size & Position Inspector starts the following page, but how this window is achieved is not explained.

On page 39, an illustration is shown on the second half of the page, whereas the caption for the illustration (Figure 30…) is printed at the top of page 40.

The reader is regularly told to, "see the section on" a particular topic, but without section numbering, without an index, or without a TOC (at the very least), this is a difficult task.

[b]I am sure that I shall continue to read the User Guide, but it does not display the care it demands. I believe, too that it is of little use to a newcomer to LiveCode.[/b]

A chance missed.
Here is his final line ..

I am sure that I shall continue to read the User Guide, but it does not display the care it demands. I believe, too that it is of little use to a newcomer to LiveCode.

Turns out if I had scrolled a bit more in my V6 dictionary I would have found this - 8 Years later and that information is not only Not in the dictionary but even less in the latest.

Code: Select all

benr_mc@cogapp.com
2009-04-30 at 10:50:19

Not explicit in the docs above is that the effect of specifying extensions and filetypes in a filter is additive not subtractive: the user will be offered any file matching the extensions, and any file matching the filetype, not just the files that match both.   So using a filter of "Image files|png|JPEG" would match any files with a ".png" extension, regardless of filetype; and any files with a "JPEG" filetype, regardless of extension.

Not noted in the docs above is that you can use multiple comma-delimited items in the 'extensions' part of a file types filter.  So for example you could use the filter "JPEG files|jpg,jpeg|JPEG,JFIF" to catch files that match at least one of four tests: extension either ".jpg" or ".jpeg", type either "JPEG" or "JFIF".

Finally, note that whereas "*" in the extension list literally matches files with the extension ".*",  "*" in the filetype list is a wildcard that matches any file.  So for example you could use the following filter list to ask the user to select a JPEG file matching some broad criteria - with the option to let them select any file if they think it might work:
    answer file "Select an image" with type ("JPEG files|jpg,jpeg|JPEG,JFIF" & return & "Any file||*")
 

You can also use a wildcard "*" in the filetypes section - however, this appears to override 
8 Years and this note is not found in the dictionary - what is the excuse?

Oh My problem was that I needed to put commas between multiple file types (jpg, png) rather than my assumption of using the or with syntax given in the dictionary - maybe i'm thick but don't make me think especially when I'm RTFM (reading the fine manual).

The documentation was probably the main reason a friend of mine was reticent to use LIvecode. He went with XOJO - but I managed to get him to have another look when the community plus edition came out.

Not a happy Bunny

<End of RANT>

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Abysmal documentation for "Answer File" command

Post by bogs » Wed Oct 18, 2017 8:17 pm

I don't disagree with any of the above Laggi. When I come across this kind of thing, I either visit Max's wiki (which has usually better examples and more indepth explanations), or I pull open the help directory I rebuilt from Mc, which is usually more complete and has fuller syntax for some reason. Bonus that most of it still works in current Lcs (although I obviously haven't tested EVERYTHING yet :D ).

Shot of that 'answer' section from the standalone I made of the help directory -
McStandaloneHelpDirectory.png
The shortcoming to the Mc reference pages (as far as I am concerned) is that while I would prefer them not to be editable, I do like being able to copy/paste from all sections. That is what I am currently working on, btw, as well as adding in the ability to store notes like the Lc Dictionary has. It is a work in progress :)
Image

Lagi Pittas
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 365
Joined: Mon Jun 10, 2013 1:32 pm

Re: Abysmal documentation for "Answer File" command

Post by Lagi Pittas » Wed Oct 18, 2017 8:34 pm

Thanks Bogs - I'm not alone then.

I loved skimming through the 2 main manuals a list of commands and the whats new manual that came with foxpro) but the online help was brilliant as well.

What I can't understand is how notes added by people for this reason in 2009 for God's sake where never incorporated - worse yet the actual info is missing critical syntax. And don't start me on the new dictionary.

Anyway how do I get these Gems of which you speak and what incantations do I use to create my own - any help appreciated - Pun not intended.

I would certainly crowdfund an outside manual writer to actually fix the information - and get some real printed documentaion. - Tom Rettig why were you taken so young :?: :!:

Regards Lagi

LiveCode_Panos
Livecode Staff Member
Livecode Staff Member
Posts: 818
Joined: Fri Feb 06, 2015 4:03 pm

Re: Abysmal documentation for "Answer File" command

Post by LiveCode_Panos » Wed Oct 18, 2017 9:15 pm

Hi all,

The new LC 8/9 dictionary does not have a "User Notes" section, so we need to work out how we can re-include this useful piece of info.

Just for reference, there is this bug report:

http://quality.livecode.com/show_bug.cgi?id=16904

It has been there a long time. We have to raise its priority. Sorry for the inconvenience.

Best regards,
Panos
--

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Abysmal documentation for "Answer File" command

Post by bogs » Wed Oct 18, 2017 9:19 pm

Yah, those pdf setups are really off-putting, even using find (I can only tolerate going through them in a reader with that feature when I have to, since the TOC doesn't seem linked to anything :roll: )

Max's wiki gem (completely editable by anyone, we'd all appreciate it if you edit along with us) is right here http://livecode.wikia.com/wiki/Livecode_Wiki, no magic needed :D

I had to host The old Mc help stack , as the board apparently didn't like their size zipped, feel free to grab them here. I really find that handy after making it a standalone (sometimes I wind up changing IDES multiple times and don't want to loose my place), but it could just as easily be setup as a plugin for your favorite version of the IDE.

Just keep in mind a lot got deprecated between then and Lc 8.x, and I rarely use Lc > 6.5, the higher you go the more you may find missing or deprecated but, due to backwards compatibility you might not miss much either.

If you do start using it, let me know if a lot your using *is* missing, it will give me a list to start filling in :)

*Edit - I should also mention (I am sure you know, Laggi, but for future users that may not) that both Max and Bernd created dictionaries specifically for the later versions that work better than stock for me, when I am not using the sources I listed above, and I am in the 8.x series.
Last edited by bogs on Sun Mar 11, 2018 11:35 pm, edited 1 time in total.
Image

bwmilby
Posts: 438
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: Abysmal documentation for "Answer File" command

Post by bwmilby » Thu Oct 19, 2017 3:29 am

Just a few comments:
  • There is an "answer file with type" entry in the dictionary
  • Anyone can now contribute to the dictionary via GitHub. I'll see if I can put this together as a suggestion for the "with type" entry (unless someone beats me to it). It will take me a bit of time to test it out on Mac/Win and verify how it works. This does seem to be very useful information.
  • There is a lot of work going on right now with syntax to support the autocomplete feature. Probably more fixing the ones currently there though. If you notice glaring errors though, they are pretty quick to correct and submit a PR for.
  • I've made some changes to the dictionary code over the past few DP releases. Hopefully it is a little better (reduced white space, highlights search term, better result sort, synonym search, more responsive search - some of these are in next DP). Since I'm already working with the code, there are probably some additional things I can contribute to make it better. I've been thinking about things like how to get it to remember where you were when switching back from the guide as one example. I am open to suggestions (but since I'm just a regular user, they still need to pass the LC team's approval).
  • TinyDict does have user comment support for the dictionary. I'm not sure if that can be directly leveraged for the IDE's built in version, but it is something to consider. My guess is that it will need to be stored as JSON so the data can be loaded and integrated into the current model. Maybe done like the current dictionary data where it is in a sqlite db and JSON.
Here is an online version of a recent develop version of the dictionary:
https://milby.us/lc/docs/api.html

It works fairly well on my iPad in landscape mode. It uses the same code (HTML/CSS/JS) as the LC IDE, just running from my server instead of locally. The data needs to be refreshed to match the upcoming 9DP10 though. I'd really like to make it work on an iPhone (that will be a bit of a challenge - will probably need to do some more reorganization of the HTML/CSS, but that would allow the width minimum in the IDE to also be greatly reduced).

Bogs... thanks for pulling that old dictionary out and making it easily available. I think it will be a great resource. I went though and read the example code in it the other day which was pretty cool to see.

Max's wiki gem is pretty nice, but I have not spent much time with it.

Thanks,
Brian
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

Lagi Pittas
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 365
Joined: Mon Jun 10, 2013 1:32 pm

Re: Abysmal documentation for "Answer File" command

Post by Lagi Pittas » Thu Oct 19, 2017 7:18 am

Thank you Brian,

I wish I had the time to help as well .. all your work is much appreciated but my rant is out of frustration. I can quite catagorically say that Livecode is now my “comfortable shoes” after looking at it for years when Microsoft stopped developing foxpro.

It pains me to see such a gem of a programming environment still be sneered at and looked on as a Toy language because of scattered/missing/iffy/variable documentation and a marketing dept .... don’t let me start again there is so much they could do it ain’t just the website which is much better but they still don’t know how to use htaccess for old links.

The biggest market they could have is the Delphi and foxpro/clipper developers.

Brasil and Spain is still full of Foxpro programmers they were the next largest after the USA and Maybe Germany.

It looks like i’m Gonna retire before we get the Open language we we promised in the Kickstarter campaign
That over any other missing element really is a missed opportunity. they should stop adding other stuff and finish of the Kickstarter promises and there are still a few.

Thanks again Brian for all your help wish I could do more rather than rant.

Regard Lagi

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Abysmal documentation for "Answer File" command

Post by MaxV » Thu Oct 19, 2017 9:34 am

I agree with Lagi, and as Bogs said I created the livecode wiki. It's much better than any dictionary, because:
  • You don't need to register to edit it.
  • everyone can edit it and it's immediately updated.
  • you can add pictures
  • you may add movies
  • you can add anything: tables, font, icons, whatever you need to make clear your explanations
If you want a better dictionary, just work on it.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Lagi Pittas
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 365
Joined: Mon Jun 10, 2013 1:32 pm

Re: Abysmal documentation for "Answer File" command

Post by Lagi Pittas » Thu Oct 19, 2017 10:13 am

Hi Maxv

I have used your dictionary wiki a few times usually from a search in google and it saved my bacon.Ascit happens if google had brought up your site the docs there would have probably stopped this rant I would just have been annoyed.

You even explain that the types syntax is return delivered (Edit: should be Delimited) . where was that in the original docs?

Btw is your dictionary data available as a CSV or JSON or sql export anywhere?

thank you too!!

Lagi
Last edited by Lagi Pittas on Fri Oct 20, 2017 1:32 pm, edited 2 times in total.

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Abysmal documentation for "Answer File" command

Post by bogs » Thu Oct 19, 2017 2:07 pm

bwmilby wrote:
Thu Oct 19, 2017 3:29 am
Here is an online version of a recent develop version of the dictionary:
https://milby.us/lc/docs/api.html
....
Bogs... thanks for pulling that old dictionary out and making it easily available. I think it will be a great resource. I went though and read the example code in it the other day which was pretty cool to see.
Thank you for looking at it :D It has a lot of features I really like, the (working) examples and concept and technique stacks have changed my own learning curve making information that was (for me) hard to find right up front and easy to access. Having words that you can click on and be taken in a separate window to that information so you don't loose your place, PRICELESS. And of course, fast, well formatted, small space, etc.

The downside of course, no notes, a great feature from the 6.x to 7.x versions I have (wonder which vers. introduced it, it can really be helpful as all get out.)

I think the work Bernd, James, and you did in tinyDict is a real boon for 8. That dictionary, and either Richard's Devolution or Andy's tindyIDE are my default setup (depending on desktop or laptop being worked with) when I am in 8.x, mostly when checking something I can't run from an earlier version.

The biggest pros (again, to me) -
  • Size - it can be condensed far more than the on board dictionary, literally looks the size of the default stack at its smallest, and is still very functional.
  • Speed - it literally feels like I get an answer from tinyDict in the amount of time the included dict is still displaying my keystrokes. It may be even faster than that, but that is bad enough. Your web version (just checked that out, thanks for the link!) is by far faster than the built in over a network connection and all that goes with it. To me it is magic black box stuff, but very much appreciated.
  • Layout - logical, easy to understand, easy to use, and easy to learn how to use better, the help sections a couple paragraphs long.
I do understand from Richard's statements (other threads) and from my own previous experiences why things have precedence over other things in projects, and at least in my experiences, it seems NO ONE likes to write documentation. In many projects, really complete stuff is left to the community to provide, and to a point that is fine, since a great many people don't like to READ documentation!
...On the other hand, for the newcomer whose eyes you may have only the one time they crack your product open, I think its vital to not only have good, functional information, code examples that actually work instead of having to figure out how to get them to work, but make it as easy to access as possible, and if you can for bonus points, easy to understand (not as easy as it sounds making it easy).

I forgot to thank Panos in my post after his, and I sure don't want to give the impression that I think everything after Mc was bad and poopoo, far from it, I spend at least as much time in 6.5 as I do in Mc 3.0. But for the amount I've learned, or at least think I did (I rely heavily on Jacque to catch me gently :D ) from product resources, that is easily Mc hands down.

<Kicking out my box, throwing it in the fire> Pardon the long rambling goofy stuff, still waking up and getting pixie dust out of my eyes :?
Image

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Abysmal documentation for "Answer File" command

Post by MaxV » Fri Oct 20, 2017 11:29 am

Lagi Pittas wrote:
Thu Oct 19, 2017 10:13 am
You even explain that the types syntax is return delivered. where was that in the original docs?
Yes, it was in the dictionary I used to upload to the wiki. I don't remember which version
Lagi Pittas wrote: Btw is your dictionary data available as a CSV or JSON or sql export anywhere?
Yes, it is.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Lagi Pittas
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 365
Joined: Mon Jun 10, 2013 1:32 pm

Re: Abysmal documentation for "Answer File" command

Post by Lagi Pittas » Fri Oct 20, 2017 1:30 pm

Thanks Max,

Here is the closest I got to the types in version 6 dictionary that maybe alludes to a list and the word delimited occurs in the return value. I Understood it straight away once I read your entry.- I think the V6 entry makes the user make a very big assumption about what is intended. - The fact that it is missing totally from 9 is what got my goat.

Code: Select all

 If types are specified, the result function will return the tag of the corresponding type selected from the supplied drop-down list. 

Code: Select all

 If types are specified, the result function will return the tag of the corresponding type selected from the supplied drop-down list.
One final question do any changes in your wiki get added back to https://milby.us/lc/docs/api.sqlite

If so it opens up a lot of possibilities- thanks again Max you have been a saviour on more than 1 occasion.

Regards Lagi

bwmilby
Posts: 438
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: Abysmal documentation for "Answer File" command

Post by bwmilby » Fri Oct 20, 2017 2:08 pm

The file on my server (Milby.us) is just a dump from the current develop branch of LiveCode so it will be pretty close to the latest DP. Right now dictionary updates come to the 8.x branch first and are then merged into 9. After DP10 is released I will post an updated file. The web page doesn’t use the SQLite file, just the exported JS version.

The only way WIKI entries will get back to the LC dictionary is if someone submits them.
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”