Original Author Paul Laughton, 2011
Page 119
De Re BASIC!
Html.post <url_sexp>, <list_nexp>
Execute a Post command to an Internet location.
<url_sexp> is a string expression giving the url that will accept the Post.
<list_nexp> is a pointer to a string list which contains the Name/Value pairs needed for the Post.
Html.get.datalink <data_svar>
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
2.
The HTML code that calls the datalink function.
The BASIC! Program requires a mechanism for communicating with a website's HTML code.
Html.get.datalink gets the next datalink string from the datalink buffer. If there is no data available then
the returned data will be an empty string (""). You should program a loop waiting for data:
DO
HTML.GET.DATALINK data$
UNTIL data$ <> ""
The returned data string will always start with a specific set of four characters--three alphabetic
characters followed by a colon (":"). These four characters identify the return datalink data type. Most of
the type codes are followed by some sort of data. The codes are:
BAK: The user has tapped the BACK key. The data is either "1" or "0".
If the data is "0" then the user tapped BACK in the start screen. Going back is not possible
therefore HTML has been closed.
If the data is "1" then going back is possible. The BASIC! programmer should issue the command
Html.go.back if going back is desired.
LNK: The user has tapped a hyperlink. The linked-to url is returned. The transfer to the new url
has not been done. The BASIC! programmer must execute an Html.load.url with the returned
url (or some other url) for a transfer to occur.
ERR: Some sort of fatal error has occurred. The error condition will be returned. This error code
always closes the html engine. The BASIC! output console will be displayed.
FOR: The user has tapped the Submit button on a form with action='FORM' The form
name/value pairs are returned.
DNL: The user has clicked a link that requires a download. The download url is supplied. It is up
to the BASIC! programmer to do the download.