' Gambas module file

Private $hManager As DownloadManager

Public Sub Main1()

  $hManager = New DownloadManager As "Manager"
  $hManager.MaxClient = 3
  
  $hManager.Add("https://gitlab.com/gambas/gambas/-/archive/master/gambas-master.tar.bz2")
  $hManager.Add("http://ipv4.download.thinkbroadband.com/512MB.zip")
  '$hManager.Add("https://gitlab.com/gambas/gambas/-/archive/master/gambas-master.tar.gz")
  '$hManager.Add("http://gambaswiki.org/zorglub.txt")
  $hManager.Add("http://gambaswiki.org/gambas-wiki.tar.bz2")
  $hManager.Start()
  
End

Public Sub Manager_Progress()
  
  Print Format($hManager.Progress * 100, "##0"); "% "; Format($hManager.Speed / 1048576, "#.#"); " MB/s"; Space$(10); "\r";
  Flush
  
End

Public Sub Manager_Message(Key As String, Text As String)
  
  Print "["; Key; "] "; Text
  
End

Public Sub Manager_Finish(Key As String)
  
  Print "["; Key; "] ==> "; $hManager[Key].Path
  
End

Public Sub Manager_Size(Key As String)
  
  Print "["; Key; "] size = "; $hManager[Key].Size
  
End

Public Sub Main()

  Dim hDictClient As DictClient

  hDictClient = New DictClient
  hDictClient.Url = "dict://dict.org/d:monkey"
  hDictClient.Async = False
  hDictClient.Get()
  Print hDictClient.Peek()

End
