Skip to content
Andrew Lambert edited this page Jan 8, 2023 · 12 revisions

Remarks

The DICT protocol is for requesting the definition of words over the Internet.

Examples

Synchronous

This example performs a synchronous DICT request on the calling thread for the word "antediluvian":

  Dim curl As New cURLClient
  If Not curl.Get("dict://dict.org/d:antediluvian") Then 
    MsgBox("curl error: " + Str(curl.LastError))
  End If
  Dim definition As String = curl.GetDownloadedData

Asynchronous

This example performs an asynchronous DICT lookup request in a console application, and prints the output directly to the screen. The Get method accepts an optional Writeable object to which downloaded data should be written. Because this is a console application an event loop must be supplied for the asynchronous transfers to run on:

  Dim curl As New cURLClient
  curl.Get("dict://dict.org/d:antediluvian", stdout)
  Do
    App.DoEvents() ' async transfers require an event loop!
  Loop Until curl.IsTransferComplete
  
  If curl.LastError <> 0 Then
    Print("curl error: " + Str(curl.LastError))
  End If
Clone this wiki locally