-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Html.get.datalink: several questions. #26
Comments
I can give only a partial answer. The strings are always three letters and a colon. BACK is incorrect; the correct string is BAK. When I get a chance I will read the sample programs to see how the data is extracted. My guess is that the programmer gets a string and lops off the first four characters to get the type, then uses the rest as data. There is an error in res/raw/f37_html_demo; I think "STT" should be "STT:". |
BACK is now BAK. Thanks for the confirmation. I'll leave this open until you get a chance to look at the sample programs. Are the sample programs kept in a separate GIT repository? I know they're on the website for general retrieval, and I've got a recent copy, but I admit to not having played with them yet. |
The sample programs are in the same repository, but they're not source files ("src" directory), they're resource files ("res" directory, specifically "res/raw"). There are also a whole lot of program files up on Paul's ftp server, some from Paul and even more from forum users, that are not in a Git repo, although I think in the long run Paul wold like to move them. I understand there's some pretty great stuff up there from the community. |
Turns out it's more complicated than that. The code catches an "STT" (sic) datalink internally and starts a speech-to-text process, then creates a "DAT:" datalink to hold the resulting text. f37 doesn't have to check for STT. We can't make the description wholly consistent without fixing that, but since the document doesn't mention STT anyway it may not matter. |
I should not offer advice when I don't know the whole story! Your question in #33 makes it clear why STT is different from the other datalinks, as I described in my previous post. I think the manual needs to explain what is meant by "datalink". That seems to be the focus of the confusion, both mine and yours. It would go in the "html.get.datalink" section. The list of valid datalink strings needs to include STT, because in the JavaScript it looks like the others, but as a special case - it's handled differently, and it needs a cross-reference to the speech-to-text section to explain why. Also, disregard my comment about "fixing" STT in the code - it's not broken, and changing it would break existing user programs. This will be about documenting what already is. When Paul says to study sample code in f37, he's not kidding. For somebody who has done JavaScript in Android, that's probably enough, but one thing people like about BASIC! is that it makes Android more approachable. In this case that may take a few more words in the manual. |
Agreed. We need an explanation of datalink, or at the very least, a link to a clear explanation of datalink. So let's leave this one open. |
The message header strings returned are: BAK:, LNK:, ERR:, FOR:, DNL:, DAT: The method for Extracting the message header and any following data should be obvious to the BASIC! programmer. The sample program, f37, has examples for doing this. I am sending you an email with a (hopefully) better explanation of datalink and STT. I am sending my email because it has special characters that git-hub swallows. |
OK, so I added the following paragraph right before the actual description of the Html.get.datalink command. I expanded your introductory material without going too far into the weeds. Is it OK? "A datalink provides a method for sending a message from an HTML program to the BASIC! programmer. There are two parts to a datalink in an HTML file: 1) the JavaScript that defines the datalink function, and 2) the HTML code that calls the datalink function. The BASIC! Program requires a mechanism for communicating with a website's HTML code." |
Around p. 70-71 Html.get.datalink: several questions (should these be separate issues?). While I can claim some knowledge of most of the other BASIC! features, I'm entirely ignorant of what happens with a datalink. Having said that, . . . .
The text was updated successfully, but these errors were encountered: